[R] Beginner: error when I plot histogram from imported table

Arslan Rehman goheer_ at hotmail.com
Sat Feb 20 23:10:43 CET 2016


Hello R users,
#I import a txt file from following code:
> da=read.table("C:/Users/agohir/Desktop/ARModel.txt",header=T)
> head(da)      ytsim1  3.04497412 -0.95401593  0.25043094 -0.69580895  1.95196236  1.4400745
#Now, I get error for following code:
> hist(da,freq=FALSE,nclass=30,ylim=c(0,60),col="blue")Error in hist.default(da, freq = FALSE, nclass = 30, ylim = c(0, 60),  :   'x' must be numeric

#when I check imported data it mention it is numeric?
> str(da)'data.frame':   999 obs. of  1 variable: $ ytsim: num  3.045 -0.954 0.25 -0.696 1.952 ..

#If not, how do I convert and then plot histogram.
#I also want to plot a probability density line afterwards
Any help is appreciated.
Thank you,Arslan

 		 	   		   		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list