Re: [R] Please help(urgent) - How to simulate transactional data for reliability/survival analysis

2017-07-04 Thread Mark Sharp
A small example data set that illustrates your question will be of great value to those trying to help. This appears to be a transformation that you are wanting to do (timestamp to units of time) so a data representing what you have (dput() is handy for this) and one representing what you want

[R] Unable to install packages in R: Error in if (any(diff)) { : missing .....

2017-07-04 Thread Agustin Navarro
Unable to install packages in R: Error in if (any(diff)) { : missing value where TRUE/FALSE needed Sorry for my bad english I need help in solving the following problem with R When I try to install a package it end with the following error msg: Error in if (any(diff)) { : missing value where

Re: [R] about adding a column for water year

2017-07-04 Thread Jim Lemon
Hi lily, It might be easier doing it like this: DF<-data.frame(year=rep(1972:1985,each=12), month=rep(1:12,14),day=rep(1,168)) DF$time<-paste(DF$year,DF$month,DF$day,sep="-") DF$flow<-runif(168,4,7) DF$wyear<-DF$year + (DF$month > 9) Jim On Wed, Jul 5, 2017 at 4:31 AM, lily li

Re: [R] about adding a column for water year

2017-07-04 Thread Jeff Newmiller
Hardly. DF$wyear is a vector, but it is being treated as though it is a scalar. Read Bert's response. -- Sent from my phone. Please excuse my brevity. On July 4, 2017 11:17:24 AM PDT, Rui Barradas wrote: >Hello, > >You have a '{' too many. > >for(i in 1972:1985){ >

Re: [R] R and UBUNTU startup

2017-07-04 Thread John C Frain
If you want to keep your R installation up to date use the installation instructions available for ubuntu at https://cran.r-project.org/bin/linux/ubuntu/. Follow the instructions there and you will be able to use standard Ubuntu update procedures afterwards. (Delete your old version first).

Re: [R] about adding a column for water year

2017-07-04 Thread Rui Barradas
Hello, You have a '{' too many. for(i in 1972:1985){ if(DF$year==i & DF$month %in% 1:9){ DF$wyear <- i }else{ DF$wyear < i-1 } } } I believe this is it. Hope this helps, Rui Barradas Em 04-07-2017 19:31, lily li escreveu: Hi R users, I have a question

Re: [R] about adding a column for water year

2017-07-04 Thread lily li
Thanks, it works. Yes, I got the same error message when tried my original code and Rui's code: In if (DF$year == i & DF$month %in% 1:9) { ... : the condition has length > 1 and only the first element will be used Also, I think I made a mistake, it should be i+1 rather than i-1. Otherwise, it

Re: [R] R and UBUNTU startup

2017-07-04 Thread Duncan Murdoch
On 04/07/2017 12:46 PM, Michael Friendly wrote: On 7/04/17 11:15 AM, PIKAL Petr wrote: Dear all I have 3 questions. Due to some reason I switched from Vista to Ubuntu on home PC. I was used to start with Rgui.exe. However I am not able to find it under Ubuntu and R starts as terminal

Re: [R] about adding a column for water year

2017-07-04 Thread Bert Gunter
Well, let's see: 1) You do not appear to understand basic flow control statements in R. Note that (from ?if): if(cond) expr if(cond) cons.expr else alt.expr where "cond A length-one logical vector that is not NA." Your cond is a vector of length nrow(DF), so you don't want if, you want

[R] about adding a column for water year

2017-07-04 Thread lily li
Hi R users, I have a question about adding a column for water year. The dataframe has the structure below. But the wyear column just shows one year. Could anyone help me with this problem? Thanks. DF year month day timeflow 1972 1 11972-01-01 5 1972

Re: [R] R and UBUNTU startup

2017-07-04 Thread David Winsemius
Sent from my iPhone > On Jul 4, 2017, at 4:58 AM, PIKAL Petr wrote: > > Hi > >> -Original Message- >> From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] >> Sent: Tuesday, July 4, 2017 1:02 PM >> To: r-help@r-project.org; PIKAL Petr

Re: [R] R and UBUNTU startup

2017-07-04 Thread Michael Friendly
On 7/04/17 11:15 AM, PIKAL Petr wrote: Dear all I have 3 questions. Due to some reason I switched from Vista to Ubuntu on home PC. I was used to start with Rgui.exe. However I am not able to find it under Ubuntu and R starts as terminal (probably Rterm). Question 1. Is Rgui.exe available on

Re: [R] Please help(urgent) - How to simulate transactional data for reliability/survival analysis

2017-07-04 Thread Sunny Singha
Thanks Boris and Bret, I was successful in simulating granular/transactional data. Now I need some guidance to transform the same data in format acceptable for survival analysis i.e below format: pump_id | event_episode_no. | event(0/1) | start | stop | time_to_dropout The challenge I'm

Re: [R] R and UBUNTU startup

2017-07-04 Thread PIKAL Petr
Thanks, I will try. Best regards. Petr > -Original Message- > From: Ruben Hernan Roa Ureta [mailto:ru...@kfupm.edu.sa] > Sent: Tuesday, July 4, 2017 11:49 AM > To: PIKAL Petr ; r-help > Subject: Re: R and UBUNTU startup > > I did the same

Re: [R] R and UBUNTU startup

2017-07-04 Thread PIKAL Petr
Hi > -Original Message- > From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] > Sent: Tuesday, July 4, 2017 1:02 PM > To: r-help@r-project.org; PIKAL Petr ; r-help h...@r-project.org> > Subject: Re: [R] R and UBUNTU startup > > Q1. No. > > Q2. What do you do?

Re: [R] R and UBUNTU startup

2017-07-04 Thread Jeff Newmiller
Q1. No. Q2. What do you do? Did you follow the instructions at [1]? If you go to the top level of the R help system you should be able to open the manuals. ?help Q3. Not that I know of. If you have difficulty with R on Linux then you should focus on learning how to use Linux in general... and

Re: [R] R and UBUNTU startup

2017-07-04 Thread Ruben Hernan Roa Ureta
I did the same transition, facing the same issues, so I settled for installation of RKWard. This pretty much reproduces my previous experience with Tinn-R and the Rgui. HTH Ruben Ruben H. Roa-Ureta, Ph. D. Senior Scientist, Center for Environment and Water,

[R] R and UBUNTU startup

2017-07-04 Thread PIKAL Petr
Dear all I have 3 questions. Due to some reason I switched from Vista to Ubuntu on home PC. I was used to start with Rgui.exe. However I am not able to find it under Ubuntu and R starts as terminal (probably Rterm). Question 1. Is Rgui.exe available on linux? In Windows doc folder I can find

[R] italic font on cairo devices in R 3.4

2017-07-04 Thread Ilia Kats
Hi all, I have the following problem: Since R 3.4.0, italic fonts rendered on Cairo devices appear pixelated. Here's a minimal example: cairo_pdf('test.pdf') plot(1:10, ylab=expression(italic(test))) dev.off() The same problem occurs with bolditalic, but not bold. I am using Debian Stretch.