Using R to read and plot the csv data

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

你可能感兴趣的:(Using R to read and plot the csv data)