Evaaa
October 13, 2019, 7:57am
1
Thanks for helping me!
Here is my code.
norm1<-data.frame(rnorm(20,0,1))
library(ggplot2)
ggplot(data=data.frame(norm1),aes(x))+
geom_histogram(color="white",fill="pink",alpha=0.5,bins=20)
norm1<-data.frame(rnorm(20,0,1))
library(ggplot2)
ggplot(data=data.frame(norm1),aes(x))+
geom_histogram(color="white",fill="pink",alpha=0.5,bins=20)
Error: Aesthetics must be either length 1 or the same as the data (20): x
You did not define the column names in your dataframe, therefor ggplot was not able to find the correct data.
This works:
norm1<-data.frame(x = rnorm(20,0,1))
Evaaa
October 13, 2019, 4:01pm
3
Maybe you can mark the topic as solved, so others know they don't have to click on it anymore?
1 Like
system
Closed
October 21, 2019, 9:27am
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.