[R] Loading in Large Dataset + variables via loop
colose21 at gmail.com
Sat Jul 14 04:44:43 CEST 2012
Hello, I'm new to R with a (probably elementary) question.
Suppose I have a dataset called /A/ with /n/ locations, and each location
contains within it 3 time series of different variables (all of 100 years
length); each time series is of a weather variable (for each location there
is a temperature, precipitation, and pressure). For instance, location 1
has a temperature1 time series, a precip1 time series, and a pressure1 time
series; location two has a temperature2, precip2, and pressure2
timeseries...That is, there are 100 rows, and (/n/*3)+1 columns. The extra
column is the time.
I want to load in this dataset and declare a variable for each time series.
The columns are in order of location, so it goes temp1, precip1,pressure1,
temp2,... and so forth in increasing column order. There are always 100
rows. Manually, Id have to do:
and so forth.....
Problem is, n is large, so I don't want to repeat this pattern forever. I
figure I need a loop both for the variable name (ie.., the variable at a
particular location) as well as for what column it reads from.
View this message in context: http://r.789695.n4.nabble.com/Loading-in-Large-Dataset-variables-via-loop-tp4636501.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help