[R] Regarding acf

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Feb 24 11:50:32 CET 2002



Ravi Malayambakkam-n wrote:
> 
> help .
> 
> I have a file which contains a table that has 2 columns of which the first
> one is a time sereis.  I need to extract the first column alone and do an
> acf plot on it.  I dont know how to extract the first column and pass it
> to the acf function in the ts package.  Can anybody pls help me.

Please read "An Introduction to R"! After that you can answer those
questions yourself!

Nevertheless, here's an example:

 mydf <- read.table(...)	# reads the file
 myts <- mydf[[1]]		# extracts first column
 library(ts)			# loads package ts
 acf(myts)			# calculates and plots acf


Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list