I am not sure what this error refers to:
Don’t know how to automatically pick scale for object of type function.
I dont seem got reason in stackoverflow for the error. Can some one please clarify on this ?
My Data Set:
- I did an aggregate from a data set and got the above resulted data as data frame.
and I am trying to plot the frequency (y axis) with class as X axis.
#upscale_class is the resultant data frame, contains same data as in image.
ggplot(data=upscale_class, aes(x=class, y=BusCentTOT)) +
I get an error :
Don’t know how to automatically pick scale for object of type function. Defaulting to continuous.
Error in data.frame(x = .Primitive(“class”), y = c(80, 1717, 629, 793, : **
** arguments imply differing number of rows: 0, 7
- But when I manually create a data frame with values as shown below:
da <- data.frame(
class = factor(c(“Economy Class”," Luxury Class",“Midscale Class”,“NA”,“Upper Midscale Class”,“Upper Upscale Class”,“Upscale Class”),
BusCentTOT = c(80, 1717,629,793,761,2415,1593)
ggplot(da=upscale_class, aes(x=class, y=BusCentTOT)) +
I get the graph plotted.
Can some one please guide me on this, both the data frame has same data,
- both with same values and columns
- first data frame is derived from a main data set where as second one is manually created.
- all the data types of columns are same for both the data frame.
Not sure why I am unable to plot for first data frame ?
Can some one help me on this ?
Thank you in advance!