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 to have with any 
guidance regarding how to use the other columns in you data set (e.g., the 
event(0/1)).

Mark
R. Mark Sharp, Ph.D.
msh...@txbiomed.org





> On Jul 4, 2017, at 7:02 AM, Sunny Singha  
> wrote:
>
> 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 experience is to generate the 'start' and 'stop' in units
> of minutes/days from single column of 'Timestamp' which is
> the column from transactional/granular data based on condition tagged in
> separate column, 'event 0/1, (i.e event ).
>
> Please guide how to do such transformation in 'R'.
>
> Regards,
> Sandeep
>
>
>
> On Wed, Jun 28, 2017 at 2:51 PM, Boris Steipe 
> wrote:
>
>> In principle what you need to do is the following:
>>
>> - break down the time you wish to simulate into intervals.
>> - for each interval, and each failure mode, determine the probability of
>> an event.
>>   Determining the probability is the fun part, where you make your domain
>>   knowledge explicit and include all the factors into your model:
>> cumulative load,
>>   failure history, pressure, temperature, phase of the moon ...
>> - once you have a probability of failure, use the runif() function to
>> give you
>>   a uniformly distributed random number in [0, 1]. If the number is
>> smaller than
>>   your failure probability, accept the failure event, and record it.
>> - Repeat many times.
>>
>> Hope this helps.
>> B.
>>
>>
>>
>>
>>> On Jun 27, 2017, at 10:58 AM, sandeep Rana  wrote:
>>>
>>> Hi friends,
>>> I haven't done such a simulation before and any help would be greatly
>> appreciated. I need your guidance.
>>>
>>> I need to simulate end to end data for Reliability/survival analysis of
>> a Pump ,with correlation in place, that is at 'Transactional level' or at
>> the granularity of time-minutes, where each observation is a reading
>> captured via Pump's sensors each minute.
>>> Once transactional data is prepared I Then need to summarise above data
>> for reliability/ survival analysis.
>>>
>>> To begin with below is the transactional data format that i want prepare:
>>> Pump-id| Timestamp | temp | vibration | suction pressure| discharge
>> pressure | Flow
>>>
>>> Above transactional data has to be prepared with below failure modes
>>> Defects :
>>> (1)Cavitation – very high in frequency but low impact
>>> (2)Bearing Damage – very low in frequency but high impact
>>> (3)Worn Shaft – medium frequency but medium impact
>>>
>>> I have used survsim package but that's not what I need here.
>>> Please help and guide.
>>>
>>> Regards,
>>> Sandeep
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/
>> posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/
>> posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

CONFIDENTIALITY NOTICE: This e-mail and any files and/or attachments 
transmitted, may contain privileged and confidential information and is 
intended solely for the exclusive use of the individual or entity to whom it is 
addressed. If you are not the intended recipient, you are hereby notified that 
any review, dissemination, distribution or copying of this e-mail and/or 
attachments is strictly prohibited. If you have received this e-mail in error, 
please immediately notify the sender stating that this transmission was 
misdirected; return the e-mail to sender; destroy all paper copies and delete 
all electronic copies from your system without disclosing its contents.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[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 TRUE/FALSE needed

the enviroment in windows 7 xp1 x64

R-3.4.1 was just installed

R was started with –vanilla and --verbose

a complete console log and Sys.getenv() follwos:

|*


c:\Program Files\R\R-3.4.1\bin\x64>R.exe --vanilla --verbose

'verbose' and 'quietly' are both true; being verbose then ..

now dyn.load("c:/Program
Files/R/R-3.4.1/library/methods/libs/x64/methods.dll") ...

Garbage collection 1 = 0+0+1 (level 2) ...

5.8 Mbytes of cons cells used (31%)

1.6 Mbytes of vectors used (25%)


R version 3.4.1 (2017-06-30) -- "Single Candle"

Copyright (C) 2017 The R Foundation for Statistical Computing

Platform: x86_64-w64-mingw32/x64 (64-bit)


R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under certain conditions.

Type 'license()' or 'licence()' for distribution details.


Natural language support but running in an English locale


R is a collaborative project with many contributors.

Type 'contributors()' for more information and

'citation()' on how to cite R or R packages in publications.


Type 'demo()' for some demos, 'help()' for on-line help, or

'help.start()' for an HTML browser interface to help.

Type 'q()' to quit R.


'verbose' and 'quietly' are both true; being verbose then ..

'verbose' and 'quietly' are both true; being verbose then ..

Garbage collection 2 = 1+0+1 (level 0) ...

7.4 Mbytes of cons cells used (39%)

3.7 Mbytes of vectors used (61%)

now dyn.load("c:/Program Files/R/R-3.4.1/library/utils/libs/x64/utils.dll")
...

'verbose' and 'quietly' are both true; being verbose then ..

now dyn.load("c:/Program
Files/R/R-3.4.1/library/grDevices/libs/x64/grDevices.dll") ...

'verbose' and 'quietly' are both true; being verbose then ..

Garbage collection 3 = 2+0+1 (level 0) ...

11.9 Mbytes of cons cells used (63%)

4.7 Mbytes of vectors used (78%)

now dyn.load("c:/Program
Files/R/R-3.4.1/library/graphics/libs/x64/graphics.dll") ...

'verbose' and 'quietly' are both true; being verbose then ..

now dyn.load("c:/Program Files/R/R-3.4.1/library/stats/libs/x64/stats.dll")
...

Garbage collection 4 = 3+0+1 (level 0) ...

13.1 Mbytes of cons cells used (70%)

4.9 Mbytes of vectors used (82%)

ending setup_Rmainloop(): R_Interactive = 1 {main.c}

>R_ReplConsole(): before "for(;;)" {main.c}

> install.packages("ctv")

Garbage collection 5 = 3+1+1 (level 1) ...

13.2 Mbytes of cons cells used (70%)

3.8 Mbytes of vectors used (62%)

Installing package into 'C:/Users/anp/Documents/R/win-library/3.4'

(as 'lib' is unspecified)

--- Please select a CRAN mirror for use in this session ---

now dyn.load("c:/Program Files/R/R-3.4.1/library/tools/libs/x64/tools.dll")
...

Garbage collection 6 = 4+1+1 (level 0) ...

14.8 Mbytes of cons cells used (79%)

4.2 Mbytes of vectors used (69%)

Garbage collection 7 = 4+2+1 (level 1) ...

15.8 Mbytes of cons cells used (85%)

6.0 Mbytes of vectors used (99%)

Garbage collection 8 = 4+2+2 (level 2) ...

15.8 Mbytes of cons cells used (64%)

6.0 Mbytes of vectors used (65%)

Garbage collection 9 = 5+2+2 (level 0) ...

16.1 Mbytes of cons cells used (65%)

7.9 Mbytes of vectors used (85%)

Garbage collection 10 = 5+3+2 (level 1) ...

16.1 Mbytes of cons cells used (65%)

7.9 Mbytes of vectors used (85%)

Garbage collection 11 = 5+3+3 (level 2) ...

16.1 Mbytes of cons cells used (51%)

8.0 Mbytes of vectors used (60%)

Garbage collection 12 = 6+3+3 (level 0) ...

16.1 Mbytes of cons cells used (51%)

9.7 Mbytes of vectors used (73%)

Garbage collection 13 = 6+4+3 (level 1) ...

16.2 Mbytes of cons cells used (51%)

9.9 Mbytes of vectors used (74%)

Garbage collection 14 = 7+4+3 (level 0) ...

17.3 Mbytes of cons cells used (55%)

10.3 Mbytes of vectors used (77%)

Garbage collection 15 = 8+4+3 (level 0) ...

18.4 Mbytes of cons cells used (58%)

11.3 Mbytes of vectors used (85%)

Garbage collection 16 = 8+5+3 (level 1) ...

17.9 Mbytes of cons cells used (56%)

11.1 Mbytes of vectors used (83%)

Garbage collection 17 = 8+5+4 (level 2) ...

16.3 Mbytes of cons cells used (51%)

7.5 Mbytes of vectors used (56%)

Garbage collection 18 = 9+5+4 (level 0) ...

17.8 Mbytes of cons cells used (56%)

9.8 Mbytes of vectors used (74%)

Garbage collection 19 = 9+5+5 (level 2) ...

16.5 Mbytes of cons cells used (52%)

6.6 Mbytes of vectors used (49%)

Garbage collection 20 = 10+5+5 (level 0) ...

16.5 Mbytes of cons cells used (52%)

9.7 Mbytes of vectors used (73%)

Garbage collection 21 = 10+6+5 (level 1) ...

16.5 Mbytes of cons cells used (52%)

9.6 Mbytes of vectors used (72%)

Garbage collection 22 = 10+6+6 (level 2) ...

17.2 Mbytes of cons cells used 

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  wrote:
> 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  1 21972-01-02   5.5
> 1972  1 31972-01-03   6
> ...
> 1985 12   31   1985-12-31   6
>
>
> for(i in 1972:1985){
> if(DF$year==i & DF$month %in% 1:9){
>   DF$wyear <- i {
> }else{
>   DF$wyear < i-1
> }
>   }
> }
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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){
>   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 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  1 21972-01-02   5.5
>> 1972  1 31972-01-03   6
>> ...
>> 1985 12   31   1985-12-31   6
>>
>>
>> for(i in 1972:1985){
>>  if(DF$year==i & DF$month %in% 1:9){
>>DF$wyear <- i {
>>  }else{
>>DF$wyear < i-1
>>  }
>>}
>> }
>>
>>  [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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).  Download rstudio (32 or
64-bit version as required) from
https://www.rstudio.com/products/rstudio/download/.. Open in
software-centre and install.  You can keep rstudio up to date by
downloading the new version and repeating the process.

Verzani, Getting started with Rstudio, O'Reilly would be a good starting
point to learn RStudio.  PACKT Publishing have several other books on
Rstudio.  R an Rstudio are almost the same on windows and Linux.  I had an
earlier edition of ubuntu unleashed 2017.  You might have a look at the
material at https://itsfoss.com/5-free-ubuntu-books-for-beginners/.  You do
need to know how to manage files in linux.  Installing and updating
 software using apt-get is really simple.




John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:fra...@tcd.ie
mailto:fra...@gmail.com

On 4 July 2017 at 20:39, Duncan Murdoch  wrote:

> 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 (probably Rterm).
>>>
>>> Question 1. Is Rgui.exe available on linux?
>>>
>> No, but you will find things nicer than Rgui by switching to R Studio,
>> which you can use on all platforms.
>>
>>>
>>> In Windows doc folder I can find manuals, however I did not find doc
>>> folder in Ubuntu. I found somewhere that manuals need to be installed
>>> separately by make 
>>>
>>> Question 2. Is it necessary to install manuals or I made some mistake
>>> when installing from Ubuntu software repository.
>>>
>> Just a guess: did you try man R?
>> All R manuals should be installed by default,but I'm not sure where.
>>
>
> Running help.start() from within R should get you access to the HTML
> versions.  The pdf versions aren't always built; it depends on how you do
> the build.
>
> Duncan Murdoch
>
>
>
>>
>>> And question 3 is simple. Are there some kind of "Linux R for Windows
>>> dummies" available?
>>>
>>> Best regards
>>> Petr
>>>
>>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posti
>> ng-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posti
> ng-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 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  1 21972-01-02   5.5
1972  1 31972-01-03   6
...
1985 12   31   1985-12-31   6


for(i in 1972:1985){
 if(DF$year==i & DF$month %in% 1:9){
   DF$wyear <- i {
 }else{
   DF$wyear < i-1
 }
   }
}

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 has no problem.

On Tue, Jul 4, 2017 at 1:20 PM, Bert Gunter  wrote:

> 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 ifelse().
> Did you fail to show us your warning messages??
>
> 2. Revising your code and eliminating the extraneous brackets, one gets:
>
> for(i in 1972:1985){
>ifelse(DF$year==i & DF$month %in% 1:9, DF$wyear <- i,
>DF$wyear < i-1)
> }
>
> But that doesn't work either, giving only 1985. Why? -- because the
> assignment statement DF$wyear <- i  assigns the single value i to the
> whole column. So the whole column gets the last value of 1985, which
> is presumably what you saw but neglected to tell us.
>
> 3.  That can be fixed by ditching the loop and ising ifelse() properly:
>
> DF$wyear <-ifelse(DF$month %in% 1:9,DF$year ,DF$year-1)
>
> or even more succinctly, albeit with a trick (automatic coercion of
> logical to numeric)
>
>  DF$wyear <- DF$year - (DF$month %in% 10:12)
>
>
> This is an example of vectorization, a powerful feature of R that
> would be worthwhile for you to learn. Your initial use of a C like
> for() loop should be avoided when possible, as it could be here.
>
> If I have made an error in understanding what you are doing, please do
> let us all know. I get it wrong from time to time.
>
> 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 strip )
>
>
> On Tue, Jul 4, 2017 at 11:31 AM, lily li  wrote:
> > 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  1 21972-01-02   5.5
> > 1972  1 31972-01-03   6
> > ...
> > 1985 12   31   1985-12-31   6
> >
> >
> > for(i in 1972:1985){
> > if(DF$year==i & DF$month %in% 1:9){
> >   DF$wyear <- i {
> > }else{
> >   DF$wyear < i-1
> > }
> >   }
> > }
> >
> > [[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 (probably Rterm).

Question 1. Is Rgui.exe available on linux?

No, but you will find things nicer than Rgui by switching to R Studio,
which you can use on all platforms.


In Windows doc folder I can find manuals, however I did not find doc folder in 
Ubuntu. I found somewhere that manuals need to be installed separately by make 


Question 2. Is it necessary to install manuals or I made some mistake when 
installing from Ubuntu software repository.

Just a guess: did you try man R?
All R manuals should be installed by default,but I'm not sure where.


Running help.start() from within R should get you access to the HTML 
versions.  The pdf versions aren't always built; it depends on how you 
do the build.


Duncan Murdoch





And question 3 is simple. Are there some kind of "Linux R for Windows dummies" 
available?

Best regards
Petr



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 ifelse().
Did you fail to show us your warning messages??

2. Revising your code and eliminating the extraneous brackets, one gets:

for(i in 1972:1985){
   ifelse(DF$year==i & DF$month %in% 1:9, DF$wyear <- i,
   DF$wyear < i-1)
}

But that doesn't work either, giving only 1985. Why? -- because the
assignment statement DF$wyear <- i  assigns the single value i to the
whole column. So the whole column gets the last value of 1985, which
is presumably what you saw but neglected to tell us.

3.  That can be fixed by ditching the loop and ising ifelse() properly:

DF$wyear <-ifelse(DF$month %in% 1:9,DF$year ,DF$year-1)

or even more succinctly, albeit with a trick (automatic coercion of
logical to numeric)

 DF$wyear <- DF$year - (DF$month %in% 10:12)


This is an example of vectorization, a powerful feature of R that
would be worthwhile for you to learn. Your initial use of a C like
for() loop should be avoided when possible, as it could be here.

If I have made an error in understanding what you are doing, please do
let us all know. I get it wrong from time to time.

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


On Tue, Jul 4, 2017 at 11:31 AM, lily li  wrote:
> 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  1 21972-01-02   5.5
> 1972  1 31972-01-03   6
> ...
> 1985 12   31   1985-12-31   6
>
>
> for(i in 1972:1985){
> if(DF$year==i & DF$month %in% 1:9){
>   DF$wyear <- i {
> }else{
>   DF$wyear < i-1
> }
>   }
> }
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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  1 21972-01-02   5.5
1972  1 31972-01-03   6
...
1985 12   31   1985-12-31   6


for(i in 1972:1985){
if(DF$year==i & DF$month %in% 1:9){
  DF$wyear <- i {
}else{
  DF$wyear < i-1
}
  }
}

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 ; r-help > h...@r-project.org>
>> Subject: Re: [R] R and UBUNTU startup
>> 
>> 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
> 
> No. I installed from Ubuntu Software Center (by point and click method) as I 
> am not very familiar with sudo terminal issues and I thought that following a 
> way which is offered by Ubuntu is enough.

If you do that you get an outdated version of R. And I think you only get the 
base version although I'm not completely sure. I've gone through a similar 
transition myself recently although it was from OSX. I think you need to bite 
the bullet and use the method in the CRAN README. I decided to try RStudio. But 
rstudio will find whatever version is installed so that's a separate decision. 
>> 
>> 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 learn what X-Windows is.
> 
> Hm. I have some book about Linux from about 2005, which I think is quite old 
> and I am not sure if almost 15 years old recommendations are still valid.

The Ask.Ubuntu website is useful as are the r-sig-debian Archives. 
> 
>> But just as with Windows, googling your problem will usually lead to stepwise
> 
> I searched all questions and especially question 1 but was not able to find 
> such concise answer.
> 
> Anyway, thank you for all answers. I will need to find my way through Linux. 
> Probably the most problematic will be to get rid of Windows habits and 
> shortcuts.
> 
> Best regards
> Petr
> 
>> solutions. Note that most issues with R should not require entering your
>> password, though some supporting system features may require that you use
>> the package manager to install Ubuntu packages.
>> 
>> [1] https://cran.r-project.org/bin/linux/ubuntu/
>> --
>> Sent from my phone. Please excuse my brevity.
>> 
>>> On July 4, 2017 2:15:19 AM PDT, 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 linux?
>>> 
>>> In Windows doc folder I can find manuals, however I did not find doc
>>> folder in Ubuntu. I found somewhere that manuals need to be installed
>>> separately by make 
>>> 
>>> Question 2. Is it necessary to install manuals or I made some mis

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 linux?
No, but you will find things nicer than Rgui by switching to R Studio, 
which you can use on all platforms.


In Windows doc folder I can find manuals, however I did not find doc folder in 
Ubuntu. I found somewhere that manuals need to be installed separately by make 


Question 2. Is it necessary to install manuals or I made some mistake when 
installing from Ubuntu software repository.

Just a guess: did you try man R?
All R manuals should be installed by default,but I'm not sure where.



And question 3 is simple. Are there some kind of "Linux R for Windows dummies" 
available?

Best regards
Petr



__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


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 experience is to generate the 'start' and 'stop' in units
of minutes/days from single column of 'Timestamp' which is
the column from transactional/granular data based on condition tagged in
separate column, 'event 0/1, (i.e event ).

Please guide how to do such transformation in 'R'.

Regards,
Sandeep



On Wed, Jun 28, 2017 at 2:51 PM, Boris Steipe 
wrote:

> In principle what you need to do is the following:
>
>  - break down the time you wish to simulate into intervals.
>  - for each interval, and each failure mode, determine the probability of
> an event.
>Determining the probability is the fun part, where you make your domain
>knowledge explicit and include all the factors into your model:
> cumulative load,
>failure history, pressure, temperature, phase of the moon ...
>  - once you have a probability of failure, use the runif() function to
> give you
>a uniformly distributed random number in [0, 1]. If the number is
> smaller than
>your failure probability, accept the failure event, and record it.
>  - Repeat many times.
>
> Hope this helps.
> B.
>
>
>
>
> > On Jun 27, 2017, at 10:58 AM, sandeep Rana  wrote:
> >
> > Hi friends,
> > I haven't done such a simulation before and any help would be greatly
> appreciated. I need your guidance.
> >
> > I need to simulate end to end data for Reliability/survival analysis of
> a Pump ,with correlation in place, that is at 'Transactional level' or at
> the granularity of time-minutes, where each observation is a reading
> captured via Pump's sensors each minute.
> > Once transactional data is prepared I Then need to summarise above data
> for reliability/ survival analysis.
> >
> > To begin with below is the transactional data format that i want prepare:
> > Pump-id| Timestamp | temp | vibration | suction pressure| discharge
> pressure | Flow
> >
> > Above transactional data has to be prepared with below failure modes
> > Defects :
> > (1)Cavitation – very high in frequency but low impact
> > (2)Bearing Damage – very low in frequency but high impact
> > (3)Worn Shaft – medium frequency but medium impact
> >
> > I have used survsim package but that's not what I need here.
> > Please help and guide.
> >
> > Regards,
> > Sandeep
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

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 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, Marine Studies Section, King Fahd
> University of Petroleum and Minerals, KFUPM Box 1927, Dhahran 31261, Saudi
> Arabia
>
> Phone : 966-3-860-7850
>
>
> 
> From: R-help  on behalf of PIKAL Petr
> 
> Sent: Tuesday, July 4, 2017 12:15 PM
> To: r-help
> Subject: [R] R and UBUNTU startup
>
> 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 manuals, however I did not find doc folder in
> Ubuntu. I found somewhere that manuals need to be installed separately by
> make 
>
> Question 2. Is it necessary to install manuals or I made some mistake when
> installing from Ubuntu software repository.
>
> And question 3 is simple. Are there some kind of "Linux R for Windows
> dummies" available?
>
> Best regards
> Petr
>
>
> 
> Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> určeny pouze jeho adresátům.
> Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně
> jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze
> svého systému.
> Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email
> jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či
> zpožděním přenosu e-mailu.
>
> V případě, že je tento e-mail součástí obchodního jednání:
> - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, 
> a to
> z jakéhokoliv důvodu i bez uvedení důvodu.
> - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout;
> Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany 
> příjemce s
> dodatkem či odchylkou.
> - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným
> dosažením shody na všech jejích náležitostech.
> - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost
> žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo
> písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto
> emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich
> existence je adresátovi či osobě jím zastoupené známá.
>
> This e-mail and any documents attached to it may be confidential and are
> intended only for its intended recipients.
> If you received this e-mail by mistake, please immediately inform its sender.
> Delete the contents of this e-mail with all attachments and its copies from 
> your
> system.
> If you are not the intended recipient of this e-mail, you are not authorized 
> to
> use, disseminate, copy or disclose this e-mail in any manner.
> The sender of this e-mail shall not be liable for any possible damage caused 
> by
> modifications of the e-mail or by delay with transfer of the email.
>
> In case that this e-mail forms part of business dealings:
> - the sender reserves the right to end negotiations about entering into a
> contract in any time, for any reason, and without stating any reasoning.
> - if the e-mail contains an offer, the recipient is entitled to immediately 
> accept
> such offer; The sender of this e-mail (offer) excludes any acceptance of the
> offer on the part of the recipient containing any amendment or variation.
> - the sender insists on that the respective contract is concluded only upon an
> express mutual agreement on all its aspects.
> - the sender of this e-mail informs that he/she is not authorized to enter 
> into
> any contracts on behalf of the company except for cases in which he/she is
> expressly authorized to do so in writing, and such authorization or power of
> attorney is submitted to the recipient or the person represented by the
> recipient, or the existence of such authorization is known to the recipient 
> of the
> person represented by the recipient.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, 

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? 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

No. I installed from Ubuntu Software Center (by point and click method) as I am 
not very familiar with sudo terminal issues and I thought that following a way 
which is offered by Ubuntu is enough.

>
> 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 learn what X-Windows is.

Hm. I have some book about Linux from about 2005, which I think is quite old 
and I am not sure if almost 15 years old recommendations are still valid.

> But just as with Windows, googling your problem will usually lead to stepwise

I searched all questions and especially question 1 but was not able to find 
such concise answer.

Anyway, thank you for all answers. I will need to find my way through Linux. 
Probably the most problematic will be to get rid of Windows habits and 
shortcuts.

Best regards
Petr

> solutions. Note that most issues with R should not require entering your
> password, though some supporting system features may require that you use
> the package manager to install Ubuntu packages.
>
> [1] https://cran.r-project.org/bin/linux/ubuntu/
> --
> Sent from my phone. Please excuse my brevity.
>
> On July 4, 2017 2:15:19 AM PDT, 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 linux?
> >
> >In Windows doc folder I can find manuals, however I did not find doc
> >folder in Ubuntu. I found somewhere that manuals need to be installed
> >separately by make 
> >
> >Question 2. Is it necessary to install manuals or I made some mistake
> >when installing from Ubuntu software repository.
> >
> >And question 3 is simple. Are there some kind of "Linux R for Windows
> >dummies" available?
> >
> >Best regards
> >Petr
> >
> >
> >
> >Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
> >určeny pouze jeho adresátům.
> >Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
> >neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho
> >kopie vymažte ze svého systému.
> >Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento
> >email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
> >Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou
> >modifikacemi či zpožděním přenosu e-mailu.
> >
> >V případě, že je tento e-mail součástí obchodního jednání:
> >- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
> >smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
> >- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně
> >přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky
> >ze strany příjemce s dodatkem či odchylkou.
> >- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
> >výslovným dosažením shody na všech jejích náležitostech.
> >- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
> >společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně
> >zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly
> >adresátovi tohoto emailu případně osobě, kterou adresát zastupuje,
> >předloženy nebo jejich existence je adresátovi či osobě jím zastoupené
> >známá.
> >
> >This e-mail and any documents attached to it may be confidential and
> >are intended only for its intended recipients.
> >If you received this e-mail by mistake, please immediately inform its
> >sender. Delete the contents of this e-mail with all attachments and its
> >copies from your system.
> >If you are not the intended recipient of this e-mail, you are not
> >authorized to use, disseminate, copy or disclose this e-mail in any
> >manner.
> >The sender of this e-mail shall not be liable for any possible damage
> >caused by modifications of the e-mail or by delay with transfer of the
> >email.
> >
> >In case that this e-mail forms part of business dealings:
> >- the sender reserves the right to end negotiations about entering into
> >a contract in any time, for any reason, and without stating any
> >reasoning.
> >- if the e-mail contains an offer, the recipient is entitled to
> >immediately accept such offer; The sender of this e-mail (offer)
> >excludes any acceptance of the offer on the part of the recipient
> >containing any amendment or variation.
> >- the sender insists on that the respective 

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 learn what X-Windows is. 
But just as with Windows, googling your problem will usually lead to stepwise 
solutions. Note that most issues with R should not require entering your 
password, though some supporting system features may require that you use the 
package manager to install Ubuntu packages. 

[1] https://cran.r-project.org/bin/linux/ubuntu/
-- 
Sent from my phone. Please excuse my brevity.

On July 4, 2017 2:15:19 AM PDT, 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 linux?
>
>In Windows doc folder I can find manuals, however I did not find doc
>folder in Ubuntu. I found somewhere that manuals need to be installed
>separately by make 
>
>Question 2. Is it necessary to install manuals or I made some mistake
>when installing from Ubuntu software repository.
>
>And question 3 is simple. Are there some kind of "Linux R for Windows
>dummies" available?
>
>Best regards
>Petr
>
>
>
>Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou
>určeny pouze jeho adresátům.
>Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě
>neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho
>kopie vymažte ze svého systému.
>Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento
>email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
>Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou
>modifikacemi či zpožděním přenosu e-mailu.
>
>V případě, že je tento e-mail součástí obchodního jednání:
>- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření
>smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
>- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně
>přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky
>ze strany příjemce s dodatkem či odchylkou.
>- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve
>výslovným dosažením shody na všech jejích náležitostech.
>- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za
>společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně
>zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly
>adresátovi tohoto emailu případně osobě, kterou adresát zastupuje,
>předloženy nebo jejich existence je adresátovi či osobě jím zastoupené
>známá.
>
>This e-mail and any documents attached to it may be confidential and
>are intended only for its intended recipients.
>If you received this e-mail by mistake, please immediately inform its
>sender. Delete the contents of this e-mail with all attachments and its
>copies from your system.
>If you are not the intended recipient of this e-mail, you are not
>authorized to use, disseminate, copy or disclose this e-mail in any
>manner.
>The sender of this e-mail shall not be liable for any possible damage
>caused by modifications of the e-mail or by delay with transfer of the
>email.
>
>In case that this e-mail forms part of business dealings:
>- the sender reserves the right to end negotiations about entering into
>a contract in any time, for any reason, and without stating any
>reasoning.
>- if the e-mail contains an offer, the recipient is entitled to
>immediately accept such offer; The sender of this e-mail (offer)
>excludes any acceptance of the offer on the part of the recipient
>containing any amendment or variation.
>- the sender insists on that the respective contract is concluded only
>upon an express mutual agreement on all its aspects.
>- the sender of this e-mail informs that he/she is not authorized to
>enter into any contracts on behalf of the company except for cases in
>which he/she is expressly authorized to do so in writing, and such
>authorization or power of attorney is submitted to the recipient or the
>person represented by the recipient, or the existence of such
>authorization is known to the recipient of the person represented by
>the recipient.
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
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, Marine Studies Section,
King Fahd University of Petroleum and Minerals,
KFUPM Box 1927, Dhahran 31261,
Saudi Arabia

Phone : 966-3-860-7850



From: R-help  on behalf of PIKAL Petr 

Sent: Tuesday, July 4, 2017 12:15 PM
To: r-help
Subject: [R] R and UBUNTU startup

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 manuals, however I did not find doc folder in 
Ubuntu. I found somewhere that manuals need to be installed separately by make 


Question 2. Is it necessary to install manuals or I made some mistake when 
installing from Ubuntu software repository.

And question 3 is simple. Are there some kind of "Linux R for Windows dummies" 
available?

Best regards
Petr



Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 manuals, however I did not find doc folder in 
Ubuntu. I found somewhere that manuals need to be installed separately by make 


Question 2. Is it necessary to install manuals or I made some mistake when 
installing from Ubuntu software repository.

And question 3 is simple. Are there some kind of "Linux R for Windows dummies" 
available?

Best regards
Petr



Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny 
pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně 
jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze 
svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email 
jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či 
zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a 
to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; 
Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce 
s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným 
dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost 
žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně 
pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně 
osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi 
či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are 
intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. 
Delete the contents of this e-mail with all attachments and its copies from 
your system.
If you are not the intended recipient of this e-mail, you are not authorized to 
use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by 
modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a 
contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately 
accept such offer; The sender of this e-mail (offer) excludes any acceptance of 
the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an 
express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into 
any contracts on behalf of the company except for cases in which he/she is 
expressly authorized to do so in writing, and such authorization or power of 
attorney is submitted to the recipient or the person represented by the 
recipient, or the existence of such authorization is known to the recipient of 
the person represented by the recipient.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[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. Several friends tried the same on their machines, another 
Debian machine has the same problem. On MacOSX the output was not 
pixelated, but it wasn't italic either. Ubuntu 16.04.2 xenial works 
fine. My impression is that R somehow can't find the proper font to use 
and falls back to something weird. Ideas?


Note that I'm not subscribed to the list, so please CC me in replies.

Cheers, Ilia

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.