Re: [ESS] Indent for R's 'switch'

2018-06-23 Thread Vitalie Spinu via ESS-help
>> On Fri, Jun 22 2018 11:06, Marius Hofert via ESS-help wrote: > my_variable_value <- switch(...) You can always do: my_variable_value <- switch(...) Vitalie __ ESS-help@r-project.org mailing list

Re: [R] Issue with R write() function

2018-06-23 Thread Jeff Newmiller
1. This behavior is dictated by the file system (an operating system feature) that is in use. Chances of it changing in R are extremely small. 2. While not clearly documented, this behavior is consistent with the definition of what a "csv" file is. Headers located at other than line 1 are not

[R] Issue with R write() function

2018-06-23 Thread Hamed Ha
I am recently updated to R 3.5.0 and noticed some weird errors in write() function. Further, I noticed that write.csv, write.table and generally the functions that derive from write() are all weird. 1. write() function does not accept a path longer than 256 characters neither on Windows or

Re: [R] Deleting a specific value in a column of a data frame

2018-06-23 Thread ruipbarradas
Hello, Also possible is is.na (B) <- B >= A Hope this helps, Rui Barradas  Enviado a partir do meu smartphone Samsung Galaxy. Mensagem original De: Bert Gunter Data: 23/06/2018 15:26 (GMT+00:00) Para: javad bayat Cc: R-help Assunto: Re: [R] Deleting a specific value in

Re: [R] Deleting a specific value in a column of a data frame

2018-06-23 Thread David L Carlson
Bert's solution works if A and B are vectors, but not if they are columns in a data frame. First, let's make up some data: set.seed(42) Dat <- data.frame(A=runif(10), B=runif(1)) Dat #A B # 1 0.9148060 0.4577418 # 2 0.9370754 0.7191123 # 3 0.2861395 0.9346722 # 4

[R] as.Date and Legend in a plot: Fixed

2018-06-23 Thread Ogbos Okike
Dear List, I am happy to report that the problem is fixed. as.Date("1998-02-10") as suggested by David handled the problem with easy. Many thanks to everybody. as.Date(1998-02-10) really resulted in error. It is my oversight. I really tried many things the day I was working on that and have

Re: [R] Deleting a specific value in a column of a data frame

2018-06-23 Thread Bert Gunter
You understand, of course, that all columns in a data frame must be of the same length; and that "NA" is not the same as NA? This is pretty basic stuff and suggests you need to spend some time with an R tutorial or two. In any case, a construct of the form: B[B >= A] <- NA should do. Cheers,

Re: [R-es] loop con matriz que cambia de nombre

2018-06-23 Thread Javier Marcuzzi
Estimado Manuel Mendoza No sería lo ideal, pero de pronto podría ir guardando en json, que es una forma no estructurada, luego toma los datos recorriendo este y crea una estructura de dataframe para continuar. Javier Rubén Marcuzzi El sáb., 23 jun. 2018 a las 8:04, Manuel Mendoza () escribió:

[R] Deleting a specific value in a column of a data frame

2018-06-23 Thread javad bayat
Dear R users; I have two columns data frame (column names is A and B). I want to write a function in order to compare column of B with A and if the values of B are equal or greater than that of A, replace them with "NA" or delete them and if the values of B are less than values in A, do nothing.

Re: [R-es] loop con matriz que cambia de nombre

2018-06-23 Thread Manuel Mendoza
Bien, Carlos, lo de ir metiendo las dfs en una lista parece buena idea, y después puedo fusionarlas con un cbind, tal y como hago ahora mismo, después de crear cada una de ellas independientemente. Son 9 dfs, y obtener cada una de ellas toma bastante tiempo de computación. Lo que quiero

Re: [R] Help with transpose please.

2018-06-23 Thread Daniel Nordlund
On 6/22/2018 4:43 AM, Bill Poling wrote: Good morning. I have data in the form: head(Edit041IA, n=25) ClaimServiceID ClaimID DiagnosisCode 1 183056004 78044473 C562 2 183056004 78044473 C778 3 183056004 78044473 C784 4 183056004 78044473

Re: [R] tapply and error bars

2018-06-23 Thread Jim Lemon
Hi Ogbos, This may help: # assume your data frame is named "oodf" oomean<-as.vector(by(oodf$B,oodf$A,mean)) oose<-as.vector(by(oodf$B,oodf$A,std.error)) plot(-5:10,oomean,type="b",ylim=c(5,11), xlab="days (epoch is the day of Fd)",ylab="strikes/km2/day") dispersion(-5:10,oomean,oose)

[R] tapply and error bars

2018-06-23 Thread Ogbos Okike
Dear workers, I have a data of length 1136. Below is the code I use to get the means B. It worked fine and I had the mean calculated and plotted. I wish to plot the error bars as well. I already plotted such means with error bars before. Please see attached for example. I tried to redo the same