[R] problem with accents and Catalan characters (for ex. ç) using geocode function (ggmap)

2015-08-24 Thread Marc Marí Dell';Olmo
Dear all, I'm trying to geocode addresses (of Catalonia) with accents and Catalan characters (as for example "ç"). I'm using the "geocode" function (package ggmap), but I obtain some Google "INVALID_REQUEST" when the addresses have these characters. For example: > geocode("Carrer Veneçuela, 10,

Re: [R] A vector of normal distributed values with a sum-to-zero constraint

2014-04-01 Thread Marc Marí Dell';Olmo
Thus the solution is >> > N <- 100 >> > x <- rnorm(N-1) >> > x <- c(x, -sum(x)) >> > sum(x) >> [1] -7.199102e-17 >> >> > >> >> >> >> >> >> >> >> >> Boris Stei

[R] A vector of normal distributed values with a sum-to-zero constraint

2014-04-01 Thread Marc Marí Dell';Olmo
Dear all, Anyone knows how to generate a vector of Normal distributed values (for example N(0,0.5)), but with a sum-to-zero constraint?? The sum would be exactly zero, without decimals. I made some attempts: > l <- 100 > aux <- rnorm(l,0,0.5) > s <- sum(aux)/l > aux2 <- aux-s > sum(aux2) [1

Re: [R] if(...){next} with "foreach" loop?

2014-02-11 Thread Marc Marí Dell';Olmo
You are absolutly right! I can use If(!cond) inside the loop. Thank you! 2014-02-11 12:43 GMT+01:00 Duncan Murdoch : > On 14-02-11 5:30 AM, Marc Marí Dell'Olmo wrote: > >> Dear all, >> >> I want to do a loop with foreach. But, I would like to include a condition

Re: [R] if(...){next} with "foreach" loop?

2014-02-11 Thread Marc Marí Dell';Olmo
iginal Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > project.org] On Behalf Of Marc Marí Dell'Olmo > > Sent: Tuesday, February 11, 2014 11:31 AM > > To: r-help@r-project.org > > Subject: [R] if(...){next} with "foreach

[R] if(...){next} with "foreach" loop?

2014-02-11 Thread Marc Marí Dell';Olmo
Dear all, I want to do a loop with foreach. But, I would like to include a condition with "next" to don't loop over some elements. For example, I would like to translate this "for loop" to a "foreach loop": for (i in 1:10) { for (j in 1:2) { ... if((i==2 & j==1) | (i==4 & j==3)) { next }

[R] Pubmed (XML) data to data.frame

2014-02-04 Thread Marc Marí Dell';Olmo
Dear all, I would like to obtain a data.frame with some data selected from pubmed information. For example, I would like to do an specific search and obtain a data.frame with the title of each article and the publication type. Example of syntax: > library(reutils) > library(XML) > > pmid <- esea

[R] Merging two dataframes with a condition involving variables of both dataframes

2013-11-07 Thread Marc Marí Dell';Olmo
Dear all, I would like to merge two dataframes using two conditions. For example, if I have the dataframes df1 and df2: > (df1 <- data.frame(var1=c("a","b","d","e","g"), var2=c(25,14,53,26,84), infodf1=c(1,1,1,1,1))) var1 var2 infodf1 1a 25 1 2b 14 1 3d 53 1

Re: [R] Problem reading a graph file

2012-03-15 Thread Marc Marí Dell';Olmo
I obtain this message: Error: C stack usage is too close to the limit Marc Marí-Dell'Olmo CIBER Epidemiología y Salud Pública Servei de Sistemes d'Informació Sanitària (SeSIS) Agència de Salut Pública de Barcelona Pl. Lesseps 1. 08023 Barcelona Tel. 93 2027775 | Fax. 93 3686943 ww

[R] convert point coordinates UTM to WSG

2009-03-20 Thread Marc Marí Dell';Olmo
Dear R-users, Can anyone tell me how to convert point coordinates from WSG84 (google maps coordinates) format to UTM HUSO-31 ED-50. And if I have a map (shp format) with UTM HUSO-31 ED-50 coordinates, how can I convert to WSG84 (google maps coordinates) coordinates. Should I install some external

[R] Functions in R like lincom and nlcom of Stata

2008-12-12 Thread Marc Marí Dell';Olmo
Hello all, Does anyone know if there exists any function in R that resembles the "lincom" and "nlcom" of STATA?. These functions computes point estimates, standard errors, significance levels, confidence intervals, etc. for linear and non linear combinations of previous estimated parameters. Down

[R] Functions in R like lincom and nlcom of Stata

2008-12-12 Thread Marc Marí Dell';Olmo
Hello all, Does anyone know if there exists any function in R that resembles the "lincom" and "nlcom" of STATA?. These functions computes point estimates, standard errors, significance levels, confidence intervals, etc. for linear and non linear combinations of previous estimated parameters. Down