您的位置:首页 > 其它

Using R to read and plot the csv data

2013-06-20 01:22 417 查看
Example code:

w1<-read.csv(file="apple-table.csv",sep=",",head=TRUE)
names(w1)
hist(w1$Close,breaks=12,xlim=c(0,800)) #histgram form of the data
boxplot(w1) # box form of the data
plot(w1$Date,w1$Close,main="apple-table",xlab="Date",ylab="Close Price") #plot the column data of Close Price with Date


If you save these commands into a R file and then store it in a current work directory(getwd() to check it),

then input the Source("Your R file name"), it will run!

PS: you can change the current work directory by setwd or choose file--change the work directory in the

R GUI.

Reference: http://www.cyclismo.org/tutorial/R/plotting.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐