Hello,

I currently splitting a file into individual files (time series each separated into one file), the file I read in skips the first four lines and extracts the data columns I need. I was wondering if there is a way for R to automatically scan and separate the files based on the head information?

The header delineates the observation with a 254 space time space day space month space year.
254      0     26      NOV    1995

I would like to then use the program I have written to do the analysis. I have attached a small subset text file of data (two observations). Any thoughts would be very helpful.

# Read in data file
data <- read.table("file.txt", skip=4, header=F)
temp <- data$V4
elev <- data$V3

Thank you,
Doug

--
---------------------------------
Douglas M. Hultstrand, MS
Senior Hydrometeorologist
Metstat, Inc. Windsor, Colorado
voice: 720.771.5840
email: dmhul...@metstat.com
web: http://www.metstat.com
---------------------------------

    254      0     26      NOV    1995
      1  24232  72694  44.92N123.02W    61   2302
      2    100   1960   2680    149  99999      4
      3           SLE                99999     kt
      9  10071     61    106     94    180     10
      5  10037     89    110     82    183     12
      4  10000    120    106     84    186     12
      6   9780    304  99999  99999    205     19
      6   9500    544     74     59    221     19
    254     12     26      NOV    1995
      1  24232  72694  44.92N123.02W    61   2302
      2    100   1960   2680    149  99999      4
      3           SLE                99999     kt
      9  10071     61    106     94    180     10
      5  10037     89    110     82    183     12
      4  10000    120    106     84    186     12
      6   9780    304  99999  99999    205     19
      6   9500    544     74     59    221     19
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to