Re: [R] apply function to spatial grid data frame to calculate CTI

2011-08-25 Thread Paul Hiemstra
On 08/25/2011 10:54 AM, Tom Vanwalleghem wrote: > Dear R helpers, > I'm new to R and struggling with applying functions to a spatial grid data > frame, called data for example.data has a variable named "slope" and "uparea" > Basically, I need to calculate the tan(data$slope)Next, I need to divide

Re: [R] apply function to spatial grid data frame to calculate CTI

2011-08-25 Thread Jean V Adams
It's not clear to me what problem you're having. tan(data$slope) should work. As should log(data$uparea/data$slope) I suggest that you provide a small subset of example data along with an example of any code you've tried, and the output that you'd like. Jean Tom Vanwalleghem wrote on

[R] apply function to spatial grid data frame to calculate CTI

2011-08-25 Thread Tom Vanwalleghem
Dear R helpers, I'm new to R and struggling with applying functions to a spatial grid data frame, called data for example.data has a variable named "slope" and "uparea" Basically, I need to calculate the tan(data$slope)Next, I need to divide data$uparea by data$slope and take the log() of that a