[R] Difficulties with setting working directory

2016-10-14 Thread Anže Dejak
Greetings, Firstly, I'd hope this is the correct e-mail address to ask about specific problems refering to problems with R. If it isn't, I kindly ask of you to re-direct me to the correct contact person. So, the thing with my version of R (I'm using RStudio for R x64 3.3.0 in, currently, Windows

Re: [R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread David Winsemius
> On Oct 14, 2016, at 6:53 PM, Joe Ceradini wrote: > > Hopefully this looks better. I did not realize gmail default was html. > > I have a dataframe with a column that has many field smashed together. > I need to split the strings in the column into separate columns based > on patterns. > > Ex

Re: [R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
should be strsplit(ugly, attributes) not strplit(ugly, attributes) On Fri, Oct 14, 2016 at 7:53 PM, Joe Ceradini wrote: > Hopefully this looks better. I did not realize gmail default was html. > > I have a dataframe with a column that has many field smashed together. > I need to split the str

[R] Split strings based on multiple patterns (plain text)

2016-10-14 Thread Joe Ceradini
Hopefully this looks better. I did not realize gmail default was html. I have a dataframe with a column that has many field smashed together. I need to split the strings in the column into separate columns based on patterns. Example of a string that needs to be split: ugly <- c("Water temp:14: F

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard
On Fri, 14 Oct 2016, David Winsemius wrote: Notice that the formula has just the column names rather than using `$`. But need to give `rain$date` to functions in hte scales list. It always seemed to me that the evaluation of names inside the scales list should also be evaluated inside the `data`

Re: [R] Split strings based on multiple patterns

2016-10-14 Thread David Winsemius
> On Oct 14, 2016, at 4:16 PM, Joe Ceradini wrote: > > Afternoon, > > I unfortunately inherited a dataframe with a column that has many fields > smashed together. My goal is to split the strings in the column into > separate columns based on patterns. > > Example of what I'm working with: > >

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread David Winsemius
> On Oct 14, 2016, at 3:51 PM, Rich Shepard wrote: > > On Fri, 14 Oct 2016, David Winsemius wrote: > >>> rain <- source("~/raindata.dat") >>> str(rain) >> List of 2 >> $ value :'data.frame': 341 obs. of 3 variables: >> ..$ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1

[R] Split strings based on multiple patterns

2016-10-14 Thread Joe Ceradini
Afternoon, I unfortunately inherited a dataframe with a column that has many fields smashed together. My goal is to split the strings in the column into separate columns based on patterns. Example of what I'm working with: ugly <- c("Water temp:14: F Waterbody type:Permanent Lake/Pond: Water pH:

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard
On Fri, 14 Oct 2016, David Winsemius wrote: rain <- source("~/raindata.dat") str(rain) List of 2 $ value :'data.frame': 341 obs. of 3 variables: ..$ station: Factor w/ 6 levels "0.3E","0.6W",..: 1 1 1 1 1 1 1 1 1 1 ... ..$ date : Factor w/ 62 levels "2013-12-01","2013-12-02",..: 32 33 34

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread David Winsemius
> On Oct 14, 2016, at 12:03 PM, Rich Shepard wrote: > > I've read chapters 7 and 8 in the Lattice book and do not see how to thin > labels on the x and y axes of an xyplot(), and how to rotate the dates on > the x axis for easier reading (rot did not do the job for me.) > > The data (as raind

[R] pheatmap - clustering on some columns only

2016-10-14 Thread Adrian Johnson
Dear group, I have a matrix (300 rows X 475columns). The data is divided into many classes. For examples: 475 columns are split into 3 categories - A, B and C Is it possible to force clustering of columns in A followed by B and C. I do not want to cluster whole matrix. I want to cluster by 3 categ

Re: [R] Incremental

2016-10-14 Thread Rui Barradas
Hello, You have to convert y1 to class "Date" first, then do date arithmetic. The complete code would be dat<-read.table(text=" y1, flag 24-01-2016,S 24-02-2016,R 24-03-2016,X 24-04-2016,H 24-01-2016,S 24-11-2016,R 24-10-2016,R 24-02-2016,X 24-01-2016,H 24-11-2016,S 24-02-2016,R 24-10-2016,X

Re: [R] Incremental

2016-10-14 Thread Val
Thank you Rui, It Worked! How about if the first variable is date format? Like the following dat<-read.table(text=" y1, flag 24-01-2016,S 24-02-2016,R 24-03-2016,X 24-04-2016,H 24-01-2016,S 24-11-2016,R 24-10-2016,R 24-02-2016,X 24-01-2016,H 24-11-2016,S 24-02-2016,R 24-10-2016,X 24-03-2016,H 24-

Re: [R] Subset and sumerize

2016-10-14 Thread Mark Sharp
Ashta, ## I may have misunderstood your question and if so I apologize. ## I had to remove the extra line after "45" before ## the ",sep=" to use your code. ## You could have used dput(dat) to send a more reliable (robust) version. dat <- structure(list(ID = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L,

[R] Adjusting axis labels on lattice xyplot

2016-10-14 Thread Rich Shepard
I've read chapters 7 and 8 in the Lattice book and do not see how to thin labels on the x and y axes of an xyplot(), and how to rotate the dates on the x axis for easier reading (rot did not do the job for me.) The data (as raindata.dat) and the existing plot (as precip.pdf) are attached.

Re: [R] Subset and sumerize

2016-10-14 Thread Sarah Goslee
For the data you provide, it's simply: summary(subset(dat, x1 == "x" & x2 == "z")$y) Note that x1 and x2 are factors in your example. We also don't know what you want to do if there are more than one combination of that per ID, or if there ID values with no matching rows. Sarah On Fri, Oct 14,

[R] Subset and sumerize

2016-10-14 Thread Ashta
Hi all, I am trying to summarize big data set by selecting a row conditionally. and tried to do it in a loop Here is the sample of my data and my attempt dat<-read.table(text=" ID,x1,x2,y 1,a,b,15 1,x,z,21 1,x,b,16 1,x,k,25 2,d,z,31 2,x,z,28 2,g,t,41 3,h,e,32 3,x,z,38 3,x,g,45 ",sep=",",he

Re: [R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread Bob Rudis
Having worked in big pharma for over 10 years, I'm _fairly_ certain AstraZeneca can afford some paid R consulting. On Fri, Oct 14, 2016 at 2:14 PM, David Winsemius wrote: > >> On Oct 14, 2016, at 12:05 AM, Vijayakumar, Sowmya >> wrote: >> >> Hi R-Help team, >> >> >> Greeting from AstraZeneca In

Re: [R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread David Winsemius
> On Oct 14, 2016, at 12:05 AM, Vijayakumar, Sowmya > wrote: > > Hi R-Help team, > > > Greeting from AstraZeneca India!! > > > > We are currently using *R 3.1.1* in Windows machine for one of our > application. We have a plan to upgrade the application. Please let us know > the steps to

Re: [R] Is there a way to prevent Rscript from opening help page when given an error

2016-10-14 Thread David Winsemius
> On Oct 13, 2016, at 2:36 PM, Tan, Johnny wrote: > > I posted this on stackoverflow but there hasn't been any replies, does anyone > know a solution for this? > > > > > > I am running a script via command line using Rscript nameOfmyRscript. I > notice that when there is an error, my brow

[R] Return.clean () - PerformanceAnalytics package

2016-10-14 Thread T.Riedle
Dear all, I am trying to clean return data using the Return.clean() function in the PerformanceAnalytics package. Hence, my code looks as follows but I get an error message. cleantest <- read.csv("D:/Studie_vola_difference/cleantest.csv") data<-as.vector(cleantest) test<-Return.clean(data,met

Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Bob Rudis
Ugly idea/option, but you could base64 encode the R script (solely to avoid the need to do string quoting) and have that string in the source of the R.net code, then pass it in to the eval portion or write it out to a temp dir and pass that to the eval portion of the code. That way the script is em

Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Narendra Modi
Thanks Duncan. That's useful to know. On Fri, Oct 14, 2016 at 9:18 AM, Duncan Murdoch wrote: > On 14/10/2016 10:00 AM, Narendra Modi wrote: >> >> Hello Gurus, >> >> I have built a code snippet using R.net wherein I call couple of R >> scripts to run optimization packages and use the output in C#

Re: [R] Share R.net dll without having to share R script code?

2016-10-14 Thread Duncan Murdoch
On 14/10/2016 10:00 AM, Narendra Modi wrote: Hello Gurus, I have built a code snippet using R.net wherein I call couple of R scripts to run optimization packages and use the output in C# code. The way I call the R scripts is just by providing its location in the C# code. So, if I have to share

[R] Share R.net dll without having to share R script code?

2016-10-14 Thread Narendra Modi
Hello Gurus, I have built a code snippet using R.net wherein I call couple of R scripts to run optimization packages and use the output in C# code. The way I call the R scripts is just by providing its location in the C# code. So, if I have to share the .dll of the complete program, I will also h

[R] Getting cited references and times cited from DOI for analysis in R?

2016-10-14 Thread Rainer M Krug
Hi This sounds off topic, but as I want to analyse the data in R and the R community is extremely knowledgeable in many respects. So here I go: I have "inherited" a literature list for further analysis containing more than 5000 references. What I would like to do is construct citation trees (who

[R] Reg : R : How to capture cpu usage, memory usage and disks info using R language

2016-10-14 Thread Manohar Reddy
Hi, ​ Is there any possibility that we can capture cpu usage ,memory usage and disks info using R language on *windows family OS* ? I would like to see data that’s looks like ​a​ below Cpu usage : 70 % Memory usage : 80 % Disks: C drive – 40 % full,D dive – 60 %,full E

Re: [R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread PIKAL Petr
Hi Another option is to use ave 1*(data2$molecule>ave(data2$molecule, data2$fruit, FUN=function(x) 2*sd(x))) Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jim Lemon > Sent: Friday, October 14, 2016 10:51 AM > To: Andreas Nord > Cc:

Re: [R] Subclass Prediction

2016-10-14 Thread PIKAL Petr
Hi ?factor ?expand.grid something like ff<-factor(sample(1:3, 10, replace=T)) factor(ff, labels=c("male", "female", "mixed")) [1] male female mixed mixed female female female female mixed male Levels: male female mixed Cheers Petr > > -Original Message- > From: R-help [mailto:r-h

Re: [R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread Jim Lemon
Hi Andreas, Try this: fruit_2sds<-by(data2$molecule,data2$fruit,sd)*2 data2$newcol<-ifelse(data2$molecule>fruit_2sds[data2$fruit],1,0) or even just: data$newcol<-as.numeric(data2$molecule>fruit_2sds[data2$fruit]) Jim On Fri, Oct 14, 2016 at 5:17 PM, Andreas Nord wrote: > > Dear list, > > Apo

Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Marna Wagley
Thanks for everyone for your suggestions. I am trying to use the techniques that you suggested and I will update you its outcome so that it might be useful to other too. Thanks, On Thu, Oct 13, 2016 at 2:10 PM, Duncan Murdoch wrote: > On 13/10/2016 11:14 AM, Thomas Adams wrote: > >> Duncan, >>

Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Duncan Mackay
Hi Marna These are a few suggestions for EDA of your data Firstly check it – it is laborious work but it needs to be done – use a proper database if R is not suitable (memory,time) dat <- read.csv("G:/1/example_subsetdata.csv") dat <- subset(dat, !is.na(depth)) apply(dat,2,range,n

[R] Compatible version of R software for OEL v6.5 Linux OS

2016-10-14 Thread Vijayakumar, Sowmya
Hi R-Help team, Greeting from AstraZeneca India!! We are currently using *R 3.1.1* in Windows machine for one of our application. We have a plan to upgrade the application. Please let us know the steps to download the R which is compatible with *Oracle Enterprise Linux (OEL) v6.5.* Thanks,

Re: [R] can we visualize water flows with 3d in R?

2016-10-14 Thread Hutchinson, David (EC)
Karline, You may want to explore Green Kenue (http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/green_kenue_index.html). It is freely available (download through an email request) and supports 3D data visualization and I believe it now has a python API to allow some automation. Unfortunately

[R] Is there a way to prevent Rscript from opening help page when given an error

2016-10-14 Thread Tan, Johnny
I posted this on stackoverflow but there hasn't been any replies, does anyone know a solution for this? I am running a script via command line using Rscript nameOfmyRscript. I notice that when there is an error, my browser would open with the help page. Now my script contained repeated erro

[R] read.epiinfo() returns wrong data when reading epiinfo files with \032 at the end

2016-10-14 Thread Artur Neumann
Sorry to send this report by email, but I cannot see a way how to create a login on https://bugs.r-project.org Problem-Description: I'm using the foreign package to read EPIINFO 6 files. (.REC) All my .REC files end with a single character after the last line break. Octal: 032 / Hex: 1A The output

[R] ifelse for creating discriminating variable based on two conditions

2016-10-14 Thread Andreas Nord
Dear list, Apologies for a likely naive question. I am trying to create a discriminating dummy variable using 'ifelse' based on conditions in two variables. Specifically, I want to assign levels in a new factor as '0' or '1' based on a user-defined cut off. I.e. something similar to: >da