I am doing exploratory data analysis and trying to generate multiple histograms and boxplots for each column in my dataframe.
Here is the function that I tried to write:
iterate_boxplot <- function(df, y) {
for (i in ncol(df)) {
print(ggplot(df, aes(x=1, y=df[ ,i])) +
geom_boxplot()+
labs(
title = "Boxplot of 'colnames(df[ ,i])'",
y = "'colnames(df[ ,i])'")+
Sys.sleep(2)
)
}
}
> iterate_boxplot(cont_ptchar_b)
Don't know how to automatically pick scale for object of type tbl_df/tbl/data.frame. Defaulting to continuous.
Error in is.finite(x) : default method not implemented for type 'list'
The "cont_ptchar_b" object is a tibble of 4 double type columns.
Many many thanks for your help from a novice R user.