Displaying 3 results from an estimated 3 matches for "datayear".
Did you mean:
datavar
2012 Feb 14
1
cumsum function to determine plankton phenology
...to the threshold values. The function in
excel is INDEX and in R is which.min.
R method:
# convert data
zoo_date <- strptime(mc_pheno$zoo_date,"%m/%d/%Y")
# check dates
str(zoo_date)
# prepare data frame
data<-na.omit(data.frame(date=zoo_date,sp=mc_pheno[,2])
# start the series
datayear<-data[format(data$date,"%Y")==1984,]
# calculate cumulative sum
datayear$cumsum<-cumsum(datayear$sp)
# calculate cumsum standardised
datayear$cumsum<-cumsum(datayear$sp)/max(cumsum(datayear$sp))
# take index of minimum value of cumsum
idq15<-which.min(mean(.15-datayear$cum...
2007 Jun 29
1
Assign name to a name
...as different years in it. I am writing scripts using R
and I would like to give a month a generic name and then use the generic
name to do different analysis. The reason for the generic name would be
so that I only have to change one thing if I wanted to change the year.
For example.
Year1 = 1999
datayear <- subset(dataset, Year = Year1)
I would want to subset for whatever year is in "Year1". I am not sure
if R does this but it would be great if it does. Is there also anyway
for R to ask the user for the variable in the console without going into
the script and then use whatever the...
2009 Mar 21
5
macro in a loop
Hi there,
Thanks for your time in advance.
I am trying to read in multiple files. For example,
data.1940 <- read.table("c:/data/1940.csv",header=TRUE,sep=",")
data.1950 <- read.table("c:/data/1950.csv",header=TRUE,sep=",")
data.1960 <- read.table("c:/data/1960.csv",header=TRUE,sep=",")
How can I write a loop to read the