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 v

[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 U

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 a

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 0.8304476

[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 forgott

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, B

[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. S

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) Jim