Re: [R] No keyboard control in the R terminal

2018-01-08 Thread Jeff Newmiller
Unlikely. My guess is you compiled it yourself without having readline development support installed where the configure script could find it. -- Sent from my phone. Please excuse my brevity. On January 8, 2018 6:23:34 PM PST, Olson Roman wrote: >Dear R Users, > >There is no R keyboard control

Re: [R] Replace NAs in split lists

2018-01-08 Thread PIKAL Petr
Hi Yes, that is why I mentioned "the example". Of course if there are missing values in other columns or data layout is different, na.locf could give undesired result. However it is simple and works with data similar to the example. Cheers Petr > -Original Message- > From: Jeff Newmil

[R] No keyboard control in the R terminal

2018-01-08 Thread Olson Roman
Dear R Users, There is no R keyboard control in my R terminal. Specifically, I can not use the up and down arrows, use autocomplete, or “backspace” to delete. I am using R 3.3.3 on Linux 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux Is this an R bug? Best,

Re: [R] Replace NAs in split lists

2018-01-08 Thread Ek Esawi
Thank you all. Now everything works. Happy 2018 and beyond EK On Sun, Jan 7, 2018 at 10:13 PM, Ek Esawi wrote: > Hi all-- > > I stumbled on this problem online. I did not like the solution given > there which was a long UDF. I thought why cannot split and l/s apply > work here. My aim is to split

Re: [R] Replace NAs in split lists

2018-01-08 Thread ruipbarradas
Because you need to separate the instructions with a ; (semi-colon). Hope this helps Rui Barradas Enviado a partir do meu smartphone Samsung Galaxy. Mensagem original De: Ek Esawi Data: 08/01/2018 16:03 (GMT+00:00) Para: Jeff Newmiller , r-help@r-project.org Assunto: Re: [R]

Re: [R] Replace NAs in split lists

2018-01-08 Thread William Dunlap via R-help
I don't get exactly that error message, > ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) Error: unexpected symbol in "ifelse(is.na(z$Value),z$Value[!is.na (z$Value)][1],z$Value)z" The 'symbol' in "unexpected symbol" refers to a "name" ('z' in this case). The problem is usually at

Re: [R] Replace NAs in split lists

2018-01-08 Thread Ek Esawi
OPS! Sorry i did indeed posted the code in HTML; should have known better. ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) error. unexpected symbol in sdf2 On Mon, Jan 8, 2018 at 11:44 AM, Jeff Newmiller wrote: > I don't know. You seem to be posting in HTML so your code is mangled

Re: [R] Replace NAs in split lists

2018-01-08 Thread Jeff Newmiller
I don't know. You seem to be posting in HTML so your code is mangled. Can you post plain text and use the reprex package to make sure it produces the errorin a clean R session? -- Sent from my phone. Please excuse my brevity. On January 8, 2018 8:03:45 AM PST, Ek Esawi wrote: >Thank you Jeff.

Re: [R] Replace NAs in split lists

2018-01-08 Thread Ek Esawi
Thank you Jeff. Your code works, as usual , perfectly. I am just wondering why if i put the whole code in one line, i get an error message. sdf2 <- lapply( sdf, function(z){z$Value <-ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) error. unexpected symbol in sdf2 Thanks again EK O

Re: [R] Replace NAs in split lists

2018-01-08 Thread Jeff Newmiller
"Enforce" is overstating it... results will differ if there are no non-NA values for a given ID, and there is a potential further discrepancy if there are multiple non-NA values. But these issues were not identified by the OP, so may not be relevant in their case. -- Sent from my phone. Please

Re: [R] Replace NAs in split lists

2018-01-08 Thread Eric Berger
You can enforce these assumptions by sorting on multiple columns, which leads to na.locf(df1[ order(df1$ID,df1$Value), ]) On Mon, Jan 8, 2018 at 4:19 PM, Jeff Newmiller wrote: > Yes, you are right if the IDs are always sequentially-adjacent and the > first non-NA value appears in the first re

Re: [R] Replace NAs in split lists

2018-01-08 Thread Jeff Newmiller
Yes, you are right if the IDs are always sequentially-adjacent and the first non-NA value appears in the first record for each ID. -- Sent from my phone. Please excuse my brevity. On January 8, 2018 2:29:40 AM PST, PIKAL Petr wrote: >Hi > >With the example, na.locf seems to be the easiest way.

[R] Error occurring in "emmeans" package for the two data sets I used. Please help.

2018-01-08 Thread Akhilesh Singh
I am a Professor of Statistics at Indira Gandhi Krishi Vishwavidyalaya, Raipur, India. While teaching in class about analysis of variance using R, I was doing a one-way analysis for the two data-sets given below in the R-class. I got a typical error in "emmeans" package, please help: Data-set-1: -

Re: [R] Replace NAs in split lists

2018-01-08 Thread PIKAL Petr
Hi With the example, na.locf seems to be the easiest way. > library(zoo) > na.locf(df1) ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE 2 3 a ac FALSE 2 4 b aa TRUE 5 5 b ab FALSE 5 Cheers Petr > -Original Message- > From: R-help [mailto:r-hel

Re: [R] foverlaps data.table error

2018-01-08 Thread Jeff Newmiller
Disclaimer: I am not a user of this package. 1) This is a plain text mailing list... your email was mangled in transit. Send in plain text format to the R mailing lists to avoid confusing potential respondents. 2) It is bad form to post here and not point out that you have already asked else

Re: [R] Replace NAs in split lists

2018-01-08 Thread Jeff Newmiller
Upon closer examination I see that you are not using the split version of df1 as I usually would, so here is a reproducible example: # df1 <- read.table( text= "ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSENA 3 a ac FALSENA 4 b aa TRUE 5 5 b ab FALSE