Re: [R] combine

2017-03-25 Thread Boris Steipe
Initially: dat3 <- merge(dat1, dat2, all.x = TRUE, all.y = TRUE) ... and then you had asked for 0, not NA in your results. I think that's not a good idea - since you can't distinguish a legitimate value 0 from a missing value that way, but if you must: dat3[is.na(dat3)] <- 0 B. (and don't post

[R] combine

2017-03-25 Thread Ashta
Hi all, I have more than two files and merge by a single column and preserve the other columns. Here is an example of two files dat1 <- read.table(header=TRUE, text=' ID T1 T2 ID1125245 ID2141264 ID3133281') dat2 <- read.table(header=TRUE, text=' ID G1 G2 ID225 46

Re: [R] Need class/object type advice to store a particular data structure

2017-03-25 Thread Bert Gunter
Can't personally help, but I assume you've checked out the CRAN "Spatial" task view, right? https://cran.r-project.org/web/views/Spatial.html Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Brea

Re: [R] Need class/object type advice to store a particular data structure

2017-03-25 Thread Bert Gunter
... or, better yet, the SpatioTemperal task view ... https://cran.r-project.org/web/views/SpatioTemporal.html Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

Re: [R] Error: could not find function "ap"

2017-03-25 Thread Frederic Ntirenganya
It seems like it is from sirad packages. Thanks for the help. Cheers Frederic Ntirenganya Maseno University, African Maths Initiative, Kenya. Mobile:(+254)718492836 Email: fr...@aims.ac.za https://sites.google.com/a/aims.ac.za/fredo/ On Fri, Mar 24, 2017 at 4:28 PM, PIKAL Petr wrote: > Hi > >

[R] Need class/object type advice to store a particular data structure

2017-03-25 Thread Ismail SEZEN
Hello Everyone, I have a particular data structure and need your advice what would be the best class/object type to store this kind of a data. In summary, data is consist of a time series of vertical observations of more than one variables. Observations are made at a particular latitude/longitu

[R] passing API key in leaflet

2017-03-25 Thread Thierry Onkelinx
Dear all, I'd like to use the OpenCycleMap as background image in a leaflet map. This requires an API key. I've stored the key in an environment variable. Below is a minimal example of the leaflet map. I still get the "API Key Required" message on the tiles. Any suggestions? library(leaflet) leaf

Re: [R] create new

2017-03-25 Thread Jim Lemon
Hi Val, How about this: cinmat<- matrix(c(mydat$x1>0,mydat$x1==0&mydat$x2==0,mydat$x1==0&mydat$x2>0), ncol=3) mydat$x4<-rowSums(mydat[,c("x1","x3","x2")]*cinmat) Jim On Sat, Mar 25, 2017 at 2:56 PM, Val wrote: > Hi all, > > > I have several variables in a group and one group contains three

Re: [R] change the value of vector based on the string of its name

2017-03-25 Thread Jim Lemon
Hi Qill, If I have interpreted your example correctly: proc1<-0 proc2<-0 cpd<-c("proc1","proc2") assign("proc1",which(cpd=="proc1")) Jim On Sat, Mar 25, 2017 at 4:12 AM, Qill Bel wrote: > Dear R-users, > > Imagine I have 3 vectors: > *proc1<-0* > *proc2<-0* > *cpd<-c("proc1","proc2")* > > How

Re: [R] Post hoc comparisons for interaction effects linear mixed effects models (lm4)

2017-03-25 Thread Thierry Onkelinx
Dear Katherina, Multcomp can't handle interactions automatically. You need to create the contrasts manually. Best regards, Thierry Op 25-mrt.-2017 08:13 schreef "Katharina Voigt" : > Hi, > I want to obtain post hoc comparisons for a model with a three-way > interaction (FullModel5 <- lmer(CIVA

[R] Post hoc comparisons for interaction effects linear mixed effects models (lm4)

2017-03-25 Thread Katharina Voigt
Hi, I want to obtain post hoc comparisons for a model with a three-way interaction (FullModel5 <- lmer(CIVADmc ~ 1 + Factor1 * Factor2 * Factor3 + (1|ID) + (1 | Item), data=Exp3_WTP_diffi). I tried: "summary(glht(FullModel4, linfct = mcp(Factor1*Factor2*Factor3 = "Tukey")), test = adjusted("holm