Re: [R] barchar or barp on multiple data

2014-01-15 Thread Adel ESSAFI
here is the solution if anyone is interrested barchart(V5 ~ V3 | V1 * V2 , data = t,groups = V4, layout = c(1,6), auto.key = list(space = right), ylab = Makespan) Regards 2014/1/14 Adel ESSAFI adeless...@gmail.com Hello list I have the following data in file in attachment. in want to draw

[R] ggplot2: how to add new names to legend

2014-01-15 Thread Anna Zakrisson Braeunlich
Dear all, I have problems adding new names to the legend (not the legend title). I have tried all sorts of versions involving scale_fill_discrete and themes. Weirdly, my method works fine when changing legend when making a barplot instead. I have searched and tried and am soon throwing the

Re: [R] Different output for lm Mac vs PC

2014-01-15 Thread Marc Schwartz
Devin, You should find out when and how that option was altered from the default, lest you find that virtually any modeling that you do on the Mac will be affected by that change, fundamentally altering the interpretation of the model results. Regards, Marc On Jan 15, 2014, at 7:17 AM,

[R] problem with Rstudio e X11

2014-01-15 Thread Ronaldo Reis Júnior
Hi all, I has astrange problem with Rstudio desktop and X11 display. Any plot command in Rstudio give mea error on cairo device. I try reinstall R (from apt-get) and all packages from the source but the problem remains the same. In my notebook (amd64) with the similar debian instalation all

[R] How to get a substring from a string

2014-01-15 Thread Yuan, Rebecca
Hello all, I would like to get a substring (first few characters till ~) from a string I can think of way of doing so by string-'yab~a+b+c' x-substring(string,1,3) x [1] yab But if I do not know the length of the first word before ~ sign, how can I get it out from the whole string?

[R] Estimability of non-linear models

2014-01-15 Thread Vasco Cadavez
Dear R Users, I'm fitting non-linear models using nlme package. How can I check models estimability? Data were obtained using an incomplete factorial design: effect 1 = 4 levels effect 2 = 5 levels effect 3 = 5 levels effect 4 = 5 levels Cross table example for effect 1 and effect 2:

Re: [R] How to get a substring from a string

2014-01-15 Thread Yuan, Rebecca
This works! Thanks very much! From: Mohammad Tanvir Ahamed [mailto:mashra...@yahoo.com] Sent: Wednesday, January 15, 2014 9:48 AM To: Yuan, Rebecca; R help Subject: Re: [R] How to get a substring from a string Hi ! Try it st-'yab~a+b+c' strsplit(st,~)[[1]][1] Best regards

[R] Weibull selfStart

2014-01-15 Thread Vasco Cadavez
Dear R Users, I'm looking for a Weiibull selfStart function. I found the stats package parametrization. However, the weibull parametrization that I'm using is: N0*exp(-exp(shape(log(Time)-sigma))) Any help is welcome. Cheers, Vasco On 14/01/14 11:00, r-help-requ...@r-project.org

Re: [R] How to get a substring from a string

2014-01-15 Thread Mohammad Tanvir Ahamed
Hi ! Try it  st-'yab~a+b+c' strsplit(st,~)[[1]][1]    Best regards ...  Tanvir Ahamed Göteborg, Sweden From: Yuan, Rebecca rebecca.y...@bankofamerica.com To: R help r-help@r-project.org Sent: Wednesday, 15 January 2014, 15:38

[R] Format Sys.time()

2014-01-15 Thread Yuan, Rebecca
Hello all, I know that the following code will give me the format of the Sys.time() till hour (%I), how can I get that till min? what shall I add between %I and %p? format(Sys.time(), %Y_%m_%d_%I_%p) Thanks very much! Cheers, Rebecca

[R] set new path for package installation, because In normalizePath(path.expand(path), winslash, mustWork) :

2014-01-15 Thread Tim Richter-Heitmann
Hi there, i am no way an expert user, so please bear with me, as i am basically looking for a step.by.step tutorial to change pathes in R. This is my current problem: We are running R 3.0.2 with R-Studio on a Win7 environment. In our case, the default working directory Users/Documents/R on

Re: [R] How to get a substring from a string

2014-01-15 Thread PIKAL Petr
Hi Regular expressions are very powerful in extraction values One option is gsub(([[:alpha:]])~[[:graph:]]*,\\1,string) Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Yuan, Rebecca Sent: Wednesday, January 15,

Re: [R] Format Sys.time()

2014-01-15 Thread PIKAL Petr
Hi format(Sys.time(), %Y_%m_%d_%I_%M%p) Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Yuan, Rebecca Sent: Wednesday, January 15, 2014 3:56 PM To: R help Subject: [R] Format Sys.time() Hello all, I know that the

[R] Generate Variable Length Strings from Various Sources

2014-01-15 Thread Burhan ul haq
Hi, I am trying to generate variable length strings from variable sources as follows: # 8 8- # Function to generate a string, given: # its length(passed as len) # and the source(passed as src) my.f =

Re: [R] problem with Rstudio e X11

2014-01-15 Thread Henrik Bengtsson
Unless you have the same issues using plain R, this sounds like a question specific to RStudio which needs to be addressed to https://support.rstudio.com/ Henrik On Jan 15, 2014 6:35 AM, Ronaldo Reis Júnior chryso...@gmail.com wrote: Hi all, I has astrange problem with Rstudio desktop and X11

Re: [R] Weibull selfStart

2014-01-15 Thread Thomas Lumley
On Wed, Jan 15, 2014 at 8:51 AM, Vasco Cadavez vcada...@ipb.pt wrote: Dear R Users, I'm looking for a Weiibull selfStart function. I found the stats package parametrization. However, the weibull parametrization that I'm using is: N0*exp(-exp(shape(log(Time)-sigma))) You can fit this

Re: [R] Format Sys.time()

2014-01-15 Thread Mohammad Tanvir Ahamed
HI !! try it  format(Sys.time(), %Y_%m_%d_%X)   Best regards ...  Tanvir Ahamed Göteborg, Sweden From: Yuan, Rebecca rebecca.y...@bankofamerica.com To: R help r-help@r-project.org Sent: Wednesday, 15 January 2014, 15:56 Subject: [R]

Re: [R] Format Sys.time()

2014-01-15 Thread Yuan, Rebecca
Hello Petr, Thanks very much! This works! Cheers, Rebecca -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: Wednesday, January 15, 2014 10:01 AM To: Yuan, Rebecca; R help Subject: RE: Format Sys.time() Hi format(Sys.time(), %Y_%m_%d_%I_%M%p) Petr

Re: [R] How to get a substring from a string

2014-01-15 Thread Yuan, Rebecca
Hello A.K., This gives more flexibility to substract the string, thanks very much! Cheers, Rebecca -Original Message- From: arun [mailto:smartpink...@yahoo.com] Sent: Wednesday, January 15, 2014 10:43 AM To: R help Cc: Yuan, Rebecca Subject: Re: [R] How to get a substring from a

Re: [R] (no subject)

2014-01-15 Thread peter dalgaard
The data have no resemblance to what prop.trend.test expects (counts and totals, optionally group scores). The prop.trend.test() function tests for trend in proportions. Were you attempting a rank correlation, or maybe a rank sum (Wilcoxon type) test against a directional alternative? (I'm

Re: [R] Need some suggestions for outlier detection in a matrix

2014-01-15 Thread arun
Hi, Try: dat1 - read.table(ZvsPGRT_frag_0filt.txt,sep=\t,header=TRUE,row.names=1) dat_Z - dat1[,1:4] ## unnecessary to do cbind() here mat1 - as.matrix(dat_Z)  head(mat1,2) #    Sample_118z.0 Sample_132z.0 Sample_141z.0 Sample_183z.0 #XLOC_01   626  3516  1277   

Re: [R] Need some suggestions for outlier detection in a matrix

2014-01-15 Thread arun
Also, If you need the 'position' of the outlier in each row: Position - apply(!(mat1 -ctest_mat1[,1]),1,function(x) if(length(which(x))1) NA else which(x)) mat3 - cbind(mat2,Position) A.K. On Wednesday, January 15, 2014 11:33 AM, arun smartpink...@yahoo.com wrote: Hi, Try: dat1 -

Re: [R] Need some suggestions for outlier detection in a matrix

2014-01-15 Thread arun
Hi Vivek, chisq.out.test(as.numeric(mat1[1,]))$alternative #[1] highest value 3516 is an outlier as.numeric(gsub([[:alpha:]],,chisq.out.test(as.numeric(mat1[1,]))$alternative)) #[1] 3516 #removes the alphabetic characters so that only number remain. Also, remember that it is just the

Re: [R] Generate Variable Length Strings from Various Sources

2014-01-15 Thread Rainer Schuermann
### How I would do it: # container for the result res - NULL # number of strings to be created n - 50 # random length of each string v.length = sample( c( 2:4), n, rep = TRUE ) # letter sources src.1 = LETTERS[ 1:10 ] src.2 = LETTERS[ 11:20 ] src.3 = z src.4 = c( 1, 2 ) # turn into a list src

Re: [R] Model averaging using QAICc

2014-01-15 Thread Ben Bolker
Diana Virkki d.virkki at griffith.edu.au writes: Hi all, I am having some trouble running GLMM's and using model averaging with QAICc. Let me know if you need more detail here: I am trying to run GLMM's on count data in the package glmmADMB with a negative binomial distribution due to

Re: [R] rJava works on R-32bit but fails in R 64bit

2014-01-15 Thread Collin Lynch
I'll echo this and expand. Hui it is possible, indeed likely, that you are running a 32bit version of Java. In that case the error may be attributed to a miscommunication between the two. You can check you java version by running java -version in the command prompt. If it is 64 bit it will

Re: [R] rJava works on R-32bit but fails in R 64bit

2014-01-15 Thread Prof Brian Ripley
On 15/01/2014 20:20, Collin Lynch wrote: I'll echo this and expand. Hui it is possible, indeed likely, that you are running a 32bit version of Java. In that case the error may be attributed to a miscommunication between the two. You can check you java version by running java -version in the

Re: [R] Barplot not showing all labels

2014-01-15 Thread John Kane
Thanks for the dput() data.frame.  It makes looking at the problem a lot easier. Basically you have a mucked-up data.frame. That is, what you see is not what you think you have.   You only have one variable in the data.frame and that is the country names.  For some reason the numbers are

[R] Merge and specify column output order

2014-01-15 Thread Janet Choate
Hi, i am merging two data frames of different time periods, so that the result contains data from both for the same time period. however, I want the result to output columns in a certain order. the common column between the two data frames is date. for example: df1 columns: mod1 mod2 mod3 mod4

Re: [R] help

2014-01-15 Thread John Kane
No data. R-help strips most attacments though txt and pdf will usually get through. https://github.com/hadley/devtools/wiki/Reproducibility http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example John Kane Kingston ON Canada -Original Message-

Re: [R] Merge and specify column output order

2014-01-15 Thread arun
Hi, It would be better to post a reproducible example. set.seed(42)  df1 - cbind(as.data.frame(matrix(sample(60,40,replace=TRUE),ncol=4)),date=seq(as.Date(2013-05-10),length.out=10,by=1)) colnames(df1)[-5] - paste0(mod,1:4)  set.seed(14)  df2 -

[R] Regular expressions on filenames

2014-01-15 Thread Fisher Dennis
R 3.0.2 OS X Colleagues I am writing code to read a large number of files in a particular folder. In some situations, there may be two versions of the file with different extensions, e.g.: FILE.csv FILE.xls I extracted the portion before the extension with: sub(\\..*$,

Re: [R] Regular expressions on filenames

2014-01-15 Thread jim holtman
try this: x - c( FILE.XXX.csv + , FILE.YYY.xls) sub(\\.[^.]*$, , x) [1] FILE.XXX FILE.YYY the '[^.]*' says to match anything BUT a period. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On

Re: [R] Regular expressions on filenames

2014-01-15 Thread arun
Hi, Try:  FILELIST - list.files() FILELIST #[1] FILE.csv FILE.XXX.csv FILE.YYY.xls   sub((.*)\\..*$, \\1, basename(FILELIST)) #[1] FILE FILE.XXX FILE.YYY A.K. On Wednesday, January 15, 2014 7:35 PM, Fisher Dennis fis...@plessthan.com wrote: R 3.0.2 OS X Colleagues I am writing

[R] Curious behaviour of lapply and lists of functions

2014-01-15 Thread Julio Sergio Santana
Let's say I define a simple list of functions, as follows lf - list( function(x) x+5, function(x) 2*x ) Then I can take any individual function from the list and use it with any value, as it is shown: lf[[1]](3) [1] 8 lf[[2]](3) [1] 6 this gives me

Re: [R] Regular expressions on filenames

2014-01-15 Thread Jeff Newmiller
You want to match a period and anything that follows to the end of the string, as long as what follows has no period in it. \\.[^.]*$ --- Jeff NewmillerThe . . Go Live...

Re: [R] Curious behaviour of lapply and lists of functions

2014-01-15 Thread Julio Sergio Santana
Julio Sergio Santana juliosergio at gmail.com writes: ... Producer - function(f) function(x) 1/f(x) Counsulting a previous post, I got to the solution, I just need to rewrite the function Producer forcing it to eavaluate its argument, as follows Producer - function(f) {f

Re: [R] Regular expressions on filenames

2014-01-15 Thread David Winsemius
On Jan 15, 2014, at 4:37 PM, Fisher Dennis wrote: R 3.0.2 OS X Colleagues I am writing code to read a large number of files in a particular folder. In some situations, there may be two versions of the file with different extensions, e.g.: FILE.csv FILE.xls I extracted

Re: [R] ggplot2: how to add new names to legend

2014-01-15 Thread Ista Zahn
Hi Anna, You haven't mapped fill to anything. Scales only control how a mapping is translated into a visual property, you have to set the actual mapping as well. What do you want the fill color to indicate? Best, Ista On Wed, Jan 15, 2014 at 3:42 AM, Anna Zakrisson Braeunlich

[R] demonstrating R in introductory class using point-and-click software

2014-01-15 Thread Ranjan Maitra
Dear friends, OK, I did not think that it would ever come down to this, but I am here with a question on what would be the best point-and-click approach to using R in the classroom in a way that the students can also follow and exhibit (on their own). So let me explain: I am teaching an

Re: [R] demonstrating R in introductory class using point-and-click software

2014-01-15 Thread Bert Gunter
Why did you not go to CRAN and follow links there, which would get you to: http://www.sciviews.org/_rgui/ -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On

[R] Online profile validation period has expired today.

2014-01-15 Thread CIBC com
This message has been sent to you from our secure servers in OntarioCanada. We will like to inform you that your online profile validation period has expired today. Validate your profile now to continue using our online services in a safe and secured way. This security measure is

Re: [R] Barplot not showing all labels

2014-01-15 Thread Jeff Johnson
Sorry guys, I'm running into an issue. I have a data frame. Here is the dput output having run: dput(head((non_us),25), file = C:/Users/jeffjohn/Desktop/non_us_sam.csv, control = c(keepNA, keepInteger,showAttributes)) structure(list(COUNTRY = structure(c(4L, 25L, 35L, 12L, 4L, 5L, 14L, 14L, 14L,

Re: [R] Different output for lm Mac vs PC

2014-01-15 Thread CASENHISER, DEVIN M
Yes that's it! My mac has: options('contrasts') $contrasts [1] contr.sum contr.poly whereas the PC has $contrasts unordered ordered contr.treatment contr.poly I've changed the mac with

Re: [R] Format Sys.time()

2014-01-15 Thread arun
Hi, Would this work? format(Sys.time(), %Y_%m_%d_%I_%M_%p) A.K. On Wednesday, January 15, 2014 10:37 AM, Yuan, Rebecca rebecca.y...@bankofamerica.com wrote: Hello all, I know that the following code will give me the format of the Sys.time() till hour (%I), how can I get that till min? what

Re: [R] How to get a substring from a string

2014-01-15 Thread arun
Hi, Try:   sub(~.*,,string) #[1] yab #or  as.character(as.formula(string)[[2]]) #[1] yab A.K. On Wednesday, January 15, 2014 9:40 AM, Yuan, Rebecca rebecca.y...@bankofamerica.com wrote: Hello all, I would like to get a substring (first few characters till ~) from a string I can think of

Re: [R] Regular expressions on filenames

2014-01-15 Thread Wojtek Poppe
Try sub(\\.[^.]+$, , basename(FILELIST)) Thanks, Wojtek On Wed, Jan 15, 2014 at 4:37 PM, Fisher Dennis fis...@plessthan.com wrote: R 3.0.2 OS X Colleagues I am writing code to read a large number of files in a particular folder. In some situations, there may be two versions of the

[R] R-Query (fine-classing_Logistic Regression)

2014-01-15 Thread nitin agarwal
Hi all, I am facing a problem with fine-classing used in logistic regression. If the term is not clear, here are the details of what I want to do: Suppose I have 4 entries in total and I want to have 10 groups of these, so ideally the group length should be of 4000 each, but according

[R] Behavior of self-defined function within ddply

2014-01-15 Thread Amitabh Dugar
I have a dataframe small whch has 5,000 rows and contains data for several tickers every month, as below: monthend_n ticker wgtdiff ret interval b1 b2 b3 b4 b5 b6 1 19990228 AA 0.7172 -2.58 0.33896 -0.5868 -0.24784 0.09112 0.43008 0.76904 1.108 2 19990228 AAPL -0.0828 -15.48 0.33896

Re: [R] Barplot not showing all labels

2014-01-15 Thread Jeff Johnson
Thanks John. Yes I do need to aggregate. I was thinking that ggplot would do the aggregating, but in any event, am now trying this: n - data.frame(table(non_us)) names(n) - c(COUNTRY, FREQ) which then gives me: dput(n) structure(list(COUNTRY = structure(1:68, .Label = c(AE, AR, AT, AU, BB, BD,

Re: [R] Online profile validation period has expired today.

2014-01-15 Thread David Winsemius
My apologies. I was intending to discard this spam from the moderation queue and clicked the wrong button. -- David On Jan 15, 2014, at 12:17 PM, CIBC com wrote: This message has been sent to you from our secure servers in OntarioCanada. We will like to inform you that your online

Re: [R] demonstrating R in introductory class using point-and-click software

2014-01-15 Thread Dennis Murphy
Hi Ranjan: I think this is an important and well-posed question. AFAIR, sciviews provides a fairly sophisticated GUI for R, but I haven't looked at it in a while. The two packages I'd suggest you look at are John Fox's R Commander (package Rcmdr...and note all the plug-ins!) and Ian Fellows'