Dear all, 

i have a programming problem that should be simple, though i am stuck with it. 
Please note that this is not a specific geonames problem, though i use it as an 
example - it´s just a basic problem with lapply.

I use the geonames webservices with the R geonames packages which works almost 
smoothly. 
I have a vector of Zipcodes and i want to do a geonames lookup for all of them, 
which should not be a problem. 
Of course i could create a loop for that one, but i think lapply should be 
possible, too. 

The problem is to hand over the variable to the lookup function. 

lapply(zipcodes,GNpostalCodeLookup(postalcode=zipcodes,country="US"))

where zipcodes is my vector of zip codes an GNpostalCodeLookup is the function 
that gives back some information like longitude and aptitude etc. Is it 
possible to use lapply in that context or can I just use it in contexts like 
lapply(somelistofvectors, mean) ?

all i´d like to have is some data.frame like this

zip     apt    long
1234  xy.x        xx.x
1235  ax.x   aa.a

thx in advance

matt
        [[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