Graphic in R Language
In this assignment I was prompt to create a basic graphic chart using R programming open source. below is my code and results.
x=c(75,35,30,22,15)
x
[1] 75 35 30 22 15
#creating barplot graph and name
barplot(x)
names(x)=c("USA","China","Russia","Frace","Japan")
x
#hit enter
USA China Russia Frace Japan
75 35 30 22 15
#creating Barplot graph
> barplot(x)
#Adding colors
> mycolors=("green","purple","blue","yellow","orange")
Error: unexpected ',' in "mycolors=("green","
> mycolors=c("green","purple","blue","yellow","orange")
> barplot(x,col=mycolors)
x=c(75,35,30,22,15)
x
[1] 75 35 30 22 15
#creating barplot graph and name
barplot(x)
names(x)=c("USA","China","Russia","Frace","Japan")
x
#hit enter
USA China Russia Frace Japan
75 35 30 22 15
#creating Barplot graph
> barplot(x)
#Adding colors
> mycolors=("green","purple","blue","yellow","orange")
Error: unexpected ',' in "mycolors=("green","
> mycolors=c("green","purple","blue","yellow","orange")
> barplot(x,col=mycolors)
Comments
Post a Comment