Re: [R] Retain parts of a matrix

2011-11-28 Thread Katrina Bennett
Hi David and Jim! Thanks very much for your help, this worked for me. #generate two matrices that are the same size for elevation and temperature: t.mean.1.c <- matrix(c(-15, -20, -30, -20, -25, -35, -40, -8, 9, 10), nrow=10, ncol=15, byrow=F) cdem <- matrix(c(300, 400, 700, 900, 1000, 250, 200,

Re: [R] Retain parts of a matrix

2011-11-28 Thread Jim Lemon
On 11/28/2011 04:06 PM, Katrina Bennett wrote: Sorry for not being more clear. I'll try to explain again. I have a rather large DEM and I need to scale daily temperature values for 10 years. I am using the sapply function to adjust temperatures (t.mean.1.c) based on lapse rates across DEM poin

Re: [R] Retain parts of a matrix

2011-11-28 Thread Katrina Bennett
Sorry for not being more clear. I'll try to explain again. I have a rather large DEM and I need to scale daily temperature values for 10 years. I am using the sapply function to adjust temperatures (t.mean.1.c) based on lapse rates across DEM points (cdem) which meet the condition of elevation b

Re: [R] Retain parts of a matrix

2011-11-27 Thread David Winsemius
On Nov 28, 2011, at 12:06 AM, Katrina Bennett wrote: Sorry for not being more clear. I'll try to explain again. I have a rather large DEM and I need to scale daily temperature values for 10 years. I have no idea what a DEM might be. I am using the sapply function to adjust temperatures

Re: [R] Retain parts of a matrix

2011-11-27 Thread David Winsemius
On Nov 27, 2011, at 10:15 PM, Katrina Bennett wrote: Hi all, I'm working to apply a function that will generate a matrix of results only when a specific criteria is met. I want my final results to be a matrix with both the values that meet the criteria (the results of the function), and