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 all
In the basic examples I found how to make simple multiplications with a scalar 
likedata[["slope"]] = data[["slope"]]/2 # assigns new attribute
I come from a background in GIS and fortran, so used to dealing with ordinary 
matrices, I'll admit I'm having trouble with understanding the format of this 
spatial grid data frame structureI've been trying different methods to index 
the data frame, or working with the function "lapply" but so far I can't seem 
to get my head wrapped around it.
I appreciate any help.TomResearcher@University of CordobaSpain                  
                  
        [[alternative HTML version deleted]]

______________________________________________
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