[R] geocoding using the Google API with a key

2013-07-31 Thread Vergari, Fabiano
Hello, I am trying to geocode an address using the Google API and R. So far, I have used the following code: location<-c('120 Avenue de la Republique, 92120 Montrouge, France') location <- gsub(' ', '+', location) sensor<-c('FALSE') sensor4url <- paste('sensor=', tolower(as.character(sensor)), se

Re: [R] replacement has length zero

2012-07-11 Thread fabiano
Thanks Peter. We did manage to solve the problem using the approach bellow. Hab <- cbind(seq(1,21),habitat) hab <- matrix(NA,nrow=3,ncol=7) for (i in 1:3) {hab[i,] <- Hab[habitat==i,1]} The problem was that the hab matrix was not a multiple of habitat. -- View this message in context: ht

Re: [R] replacement has length zero

2012-07-08 Thread fabiano
Thanks Peter. We had a look at both Hab and habitat. These are integers representing habitat types. habitat <- read.csv("Ungulate_vegetation.csv") habitat <- habitat[,3] habitat [1] 3 3 4 3 3 3 4 4 3 3 3 3 3 4 2 3 2 3 2 3 Hab <- cbind(seq(1,20),habitat) Hab habitat [1,] 1 3 [2

[R] replacement has length zero

2012-07-07 Thread fabiano
I have been working on the following code but keep getting an err message. My current thinking is that the problem is on the indexing but do not know how to fix it. Any help please? ungulate <- read.csv("Ungulate.csv",row.names=1) ungulate <- as.matrix(ungulate);colnames(ungulate)<-NULL;rownames(u