[R] RWinEdt difficulties
Hello Everyone I have just upgraded my PC to Windows 7 (64 bit) and I have installed R 2.12.2. R seems to be working fine. I am having problems getting RWinEdt working with it though. I have tried installing WinEdt 6.0 and WinEdt 5.5. But both fail with the same error using R as 64 bit or 32 bit. I install the package using Administrator rights. > library(RWinEdt) Warning message: In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" -E=", : '""C:\Program Files (x86)\WinEdt Team\WinEdt 6\WinEdt.exe" -C="R-WinEdt" -E="C:\Program Files (x86)\WinEdt Team\WinEdt 6\R.ini""' execution failed with error code 1 > Does it matter if you are using 64 bit R and the 32 bit WinEdt? (I have tried 32 bit R). Does RWinEdt work with WinEdt 6.0? Can anybody suggest a solution? Thanks for any help. Regards John Seers ** ** [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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] RWinEdt difficulties
Thanks Robert. I will have a look at it. John Seers ** ** On Wed, Mar 2, 2011 at 3:10 PM, Robert Kinley wrote: > > try RStudio instead:o) > > > http://www.rstudio.org/ > > Robert Kinley > > > > > > > > > *Uwe Ligges * > Sent by: r-help-boun...@r-project.org > > 02/03/2011 15:00 > To > John Seers > cc > r-help@r-project.org > Subject > Re: [R] RWinEdt difficulties > > > > > > > On 01.03.2011 11:01, John Seers wrote: > > Hello Everyone > > > > I have just upgraded my PC to Windows 7 (64 bit) and I have installed R > > 2.12.2. R seems to be working fine. > > > > I am having problems getting RWinEdt working with it though. > > > > I have tried installing WinEdt 6.0 and WinEdt 5.5. But both fail with the > > same error using R as 64 bit or 32 bit. I install the package using > > Administrator rights. > > > > > >> library(RWinEdt) > > Warning message: > > In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" > > -E=", : > >'""C:\Program Files (x86)\WinEdt Team\WinEdt 6\WinEdt.exe" > -C="R-WinEdt" > > -E="C:\Program Files (x86)\WinEdt Team\WinEdt 6\R.ini""' execution failed > > with error code 1 > >> > > One installing RWinEdt the first time, please run R with Administrator > privileges (right click to do so). Then installation should work > smoothly with WinEdt < 6.0. > > > Does it matter if you are using 64 bit R and the 32 bit WinEdt? (I have > > tried 32 bit R). > > > > Does RWinEdt work with WinEdt 6.0? > > > No, not yet, unfortunately. But some free time is scheduled for this in > April. > > Uwe Ligges > > > > Can anybody suggest a solution? > > > > > > Thanks for any help. > > > > Regards > > > > John Seers > > > > > > > ** > > > ** > > > > [[alternative HTML version deleted]] > > > > __ > > R-help@r-project.org mailing list > > 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 > 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 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] RWinEdt difficulties
** ** 2011/3/2 Uwe Ligges > > > On 01.03.2011 11:01, John Seers wrote: > >> Hello Everyone >> >> I have just upgraded my PC to Windows 7 (64 bit) and I have installed R >> 2.12.2. R seems to be working fine. >> >> I am having problems getting RWinEdt working with it though. >> >> I have tried installing WinEdt 6.0 and WinEdt 5.5. But both fail with the >> same error using R as 64 bit or 32 bit. I install the package using >> Administrator rights. >> >> >> library(RWinEdt) >>> >> Warning message: >> In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" >> -E=", : >> '""C:\Program Files (x86)\WinEdt Team\WinEdt 6\WinEdt.exe" -C="R-WinEdt" >> -E="C:\Program Files (x86)\WinEdt Team\WinEdt 6\R.ini""' execution failed >> with error code 1 >> >>> >>> > One installing RWinEdt the first time, please run R with Administrator > privileges (right click to do so). Then installation should work smoothly > with WinEdt < 6.0. > > > Does it matter if you are using 64 bit R and the 32 bit WinEdt? (I have >> tried 32 bit R). >> >> Does RWinEdt work with WinEdt 6.0? >> > > > No, not yet, unfortunately. But some free time is scheduled for this in > April. > > Uwe Ligges > > > > Can anybody suggest a solution? >> > > > > > Thanks for any help. >> >> Regards >> >> John Seers >> >> >> >> ** >> >> ** >> >> Hello Uwe Thank you for your reply. >One installing RWinEdt the first time, please run R with Administrator privileges (right click to do so). Then installation should work >smoothly with WinEdt < 6.0. Hmmm. I think I did the first time. But I have tried again. Removed WinEdt 6.0 and installed 5.5. Uninstalled R and reinstalled only 64 bit version this time. Ensured all traces of RWinEdt were removed. Started R with admin privileges. Installed RWinEdt. Loaded RWinEdt. Same problem. > library(RWinEdt) Warning message: In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" -E=", : '""C:\Program Files (x86)\WinEdt Team\WinEdt\WinEdt.exe" -C="R-WinEdt" -E="C:\Program Files (x86)\WinEdt Team\WinEdt\R.ini""' execution failed with error code 1 > Any other suggestions? Regards John Seers >[[alternative HTML version deleted]] >> >> __ >> R-help@r-project.org mailing list >> 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 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] RWinEdt difficulties
>Well, use the manual setup as indicated in the readme cinatined in the package. No idea what went wrong in this case. OK, thanks. John Seers ** ** 2011/3/2 Uwe Ligges > > > On 02.03.2011 18:06, John Seers wrote: > >> >> ** >> >> ** >> >> >> 2011/3/2 Uwe Ligges >> >> >>> >>> On 01.03.2011 11:01, John Seers wrote: >>> >>> Hello Everyone >>>> >>>> I have just upgraded my PC to Windows 7 (64 bit) and I have installed R >>>> 2.12.2. R seems to be working fine. >>>> >>>> I am having problems getting RWinEdt working with it though. >>>> >>>> I have tried installing WinEdt 6.0 and WinEdt 5.5. But both fail with >>>> the >>>> same error using R as 64 bit or 32 bit. I install the package using >>>> Administrator rights. >>>> >>>> >>>> library(RWinEdt) >>>> >>>>> >>>>> Warning message: >>>> In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" >>>> -E=", : >>>> '""C:\Program Files (x86)\WinEdt Team\WinEdt 6\WinEdt.exe" >>>> -C="R-WinEdt" >>>> -E="C:\Program Files (x86)\WinEdt Team\WinEdt 6\R.ini""' execution >>>> failed >>>> with error code 1 >>>> >>>> >>>>> >>>>> One installing RWinEdt the first time, please run R with Administrator >>> privileges (right click to do so). Then installation should work smoothly >>> with WinEdt< 6.0. >>> >>> >>> Does it matter if you are using 64 bit R and the 32 bit WinEdt? (I have >>> >>>> tried 32 bit R). >>>> >>>> Does RWinEdt work with WinEdt 6.0? >>>> >>>> >>> >>> No, not yet, unfortunately. But some free time is scheduled for this in >>> April. >>> >>> Uwe Ligges >>> >>> >>> >>> Can anybody suggest a solution? >>> >>>> >>>> >>> >>> >>> >>> Thanks for any help. >>> >>>> >>>> Regards >>>> >>>> John Seers >>>> >>>> >>>> >>>> >>>> ** >>>> >>>> >>>> ** >>>> >>>> >>>> >> >> Hello Uwe >> >> Thank you for your reply. >> >> One installing RWinEdt the first time, please run R with Administrator >>> >> privileges (right click to do so). Then installation should work>smoothly >> with WinEdt< 6.0. >> >> Hmmm. I think I did the first time. But I have tried again. >> >> Removed WinEdt 6.0 and installed 5.5. Uninstalled R and reinstalled only >> 64 >> bit version this time. Ensured all traces of RWinEdt were removed. Started >> R >> with admin privileges. Installed RWinEdt. Loaded RWinEdt. Same problem. >> >> library(RWinEdt) >>> >> Warning message: >> In shell(paste("\"\"", .gW$InstallRoot, "\\WinEdt.exe\" -C=\"R-WinEdt\" >> -E=", : >> '""C:\Program Files (x86)\WinEdt Team\WinEdt\WinEdt.exe" -C="R-WinEdt" >> -E="C:\Program Files (x86)\WinEdt Team\WinEdt\R.ini""' execution failed >> with >> error code 1 >> >>> >>> >> Any other suggestions? >> > > > Well, use the manual setup as indicated in the readme cinatined in the > package. No idea what went wrong in this case. > > > Uwe > > > > Regards >> >> John Seers >> >> >> >> >> >> >> >> >> >> >> [[alternative HTML version deleted]] >>> >>>> >>>> __ >>>> R-help@r-project.org mailing list >>>> 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 >> 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 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] par() function does not work
Hi Fabio Works OK for me. > par(mfrow=c(2,2)) > par("mfrow") [1] 2 2 > But then I am using Windows ... > sessionInfo() R version 2.7.1 (2008-06-23) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 What are you using? Regards John --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fabio Sanchez Sent: 23 July 2008 10:56 To: [EMAIL PROTECTED] Subject: [R] par() function does not work Dear R-nautes, I installed the 2.7.1 version of R and found it is not possible to modify graphical parameters with par(). for example; > par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) > par$mfrow NULL Does any one know what is the cause of this problem? Regards, Fabio -- Fabio Sánchez, MD, MSc, PhD Unit of Dermatology and Venereology Department of Medicine Karolinska Institute SE-17176 Karolinska University Hospital Phone: +46 8 51772158 Fax: +46 8 51773620 [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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] par() function does not work
Hi Fabio Have you used the name "c" for something else? Try typing in "c" at the command line, you should see something like: > c function (..., recursive = FALSE) .Primitive("c") Regards John --- for example; > par(mfrow=c(2,2)) Error in c(2, 2) : unused argument(s) (2) > par$mfrow NULL Does any one know what is the cause of this problem? Regards, __ R-help@r-project.org mailing list 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] Simple... but...
This is definitely the best way: c(lapply(1:length(x), function(i, x, y) c(x[i], y[i]), x, y), recursive=TRUE) JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shubha Vishwanath Karanth Sent: 23 July 2008 13:55 To: [EMAIL PROTECTED] Subject: [R] Simple... but... Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way Thanks, Shubha This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.org mailing list 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 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] Is there an equivalent * operator?
Something like this might do what you want: dates<-paste(c("2008"), c("Jan", "Feb", "Sep", "Sep", "Dec"), 1:3, sep="") temp<-rnorm(length(dates))*30 data1<-data.frame(Dates=dates, Temp=temp) data.s1<-data1[grep("Sep", data1[["Dates"]]),] > data.s1 Dates Temp 3 2008Sep3 22.263627 4 2008Sep1 9.854643 Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Williams, Robin Sent: 24 July 2008 11:31 To: r-help@r-project.org Subject: [R] Is there an equivalent * operator? Hi all, Is there an equivalent to the general * operator in R, where * can represent any character? I have a dataset, one column being date, date ranging between April-September, 97-06. I would like to be able to acquire the data for a specific month, say September, so that I can take average temperatures for the month, etc. I thought I would be able to do something like data.s1 <- subset(data,date=="**-Sep-**") data.s1 but when I do data.s1 I get "0 rows or 0-length row.names". Any idea of a simple way I can perform this task? All dates are in the form xx-xxx-xx, EG 30-Sep-06. Thanks for any assistance. Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] Just 2 more questions - for now!
Q1: Have a look at: ?save ?save.image ?load Q2: I am not sure this is right: model<-lm(data$admissions~data$maxitemp) Try and code a line that looks more like this with the variables the names of the columns in your data: model<-lm(admissions ~ maxitemp + minitemp, data=data) Have a read of ?formula for more information. (I usually try and avoid using the name "data" for my data because data is a function in R.) Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Williams, Robin Sent: 24 July 2008 12:02 To: r-help@r-project.org Subject: [R] Just 2 more questions - for now! Hi all, Thanks for the help with my previous post. I have just two more questions for the minute. I think I said in a previous post that I like to use the terminal, i.e. run rterm.exe. On exiting the terminal, I am asked if I want to save the workspace. If I hit y (yes), the workspace is just saved as .rdata in my working directory, does anyone know how I can name it directly from the terminal? More importantly, I can't then open this file from the terminal. Obviously loading the file from windows explorer brings up the GUI. Anyone know the command I need? All I can think of doing is adding rterm.exe to my path and running it from the command prompt (adding the file as an argument to my command), but surely there is an easy way to do this from R? Of course I would like to have the terminal open and open and close various workspaces in one session, without wanting to restart R all the time. Finally, I rather embarrasingly can't get lm to work despite reading the help. I can get it to work with a single explanatory variable, EG model <- lm(data$admissions~data$maxitemp) but how to include a second explanatory variable (minitemp)? I keep getting errors. Surely I don't need to use c(data$maxitemp,data$minitemp) etc? All help greatly appreciated - I am getting there slowly! Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] add string
Is this what you want: paste("Mystring", frequency, sep="") --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alfredo Alessandrini Sent: 31 July 2008 10:11 To: r-help@r-project.org Subject: [R] add string Hi, How can I join two string? frequency = 15 I want join the number frequency with a string. Alfredo __ R-help@r-project.org mailing list 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 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] qqline function doesn't plot
Hi qqline does not do the plot. It adds a line to an existing plot. So you have to do something else first, like: qqnorm(x) qqline(x) JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scotty Nelson Sent: 05 August 2008 09:58 To: r-help@r-project.org Subject: [R] qqline function doesn't plot I have a data vector x. When I try qqline(x) I get the following error: Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet And a blank plot appears. Can anybody help? What am I doing wrong? Thanks, Scotty _ Contest [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] how to use substring match as condition?
Something like this may be close to what you want: subset(input, field1=="blah1" & !is.na(charmatch("blah3",input$field3))) --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Albert Vilella Sent: 29 May 2008 11:38 To: r-help@r-project.org Subject: [R] how to use substring match as condition? Hi, How can I use a substring match as a condition in a subset command? Sth like this: subset(input, field1=="blah1" & field2=="blah2") # but now with substring match in field2 subset(input, field1=="blah1" & field3 *substringmatch* "blah3") I've tried with gsub, but it won't work: subset(input, field1=="blah1" & gsub("blah3","",input$field3)) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] removing blanks from a string
There is also the "trim" command in the gdata package. Removes blanks from the front of the string as well which may not be what you want. Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jim holtman Sent: 27 June 2008 10:27 To: juli pausas Cc: R-help Subject: Re: [R] removing blanks from a string Is this what you want: > x <- c("hola", "Yes ", "hello ") > gsub(" *$", "", x) [1] "hola" "Yes" "hello" > > On Fri, Jun 27, 2008 at 4:34 AM, juli pausas <[EMAIL PROTECTED]> wrote: > Hi > Is there a way to remove blank characters from the end of strings in a > vector? Something like the =TRIM functions of the OpenOffice > spreadsheet. E.g., > a <- c("hola", "Yes ", "hello ")# I'd like to get: > c("hola", "Yes", "hello") > > Thanks > > Juli > > > -- > http://www.ceam.es/pausas > > __ > R-help@r-project.org mailing list > 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. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@r-project.org mailing list 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 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] removing blanks from a string
Hello Yes, I am sure you are right. I guessed the intended question was not so specific. I have always thought of spaces and blanks as the same thing. And use "white space" for a more general catch all description for tabs etc. Is "white space" and "spaces" the same thing? Regards JS --- -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 27 June 2008 11:10 To: john seers (IFR) Cc: jim holtman; juli pausas; R-help Subject: Re: [R] removing blanks from a string There are well-informed answers given as examples on the sub() help page. Hint 1: there is no need to globally substitute patterns anchored at the end: they can only match in one place. There is also no need to substitute "" for "". Hint 2: 'blank characters' and 'spaces' are not the same thing. [:blank:] seems the relevant character class, so sub("[[:blank:]]+$", "", x) seems an accurate answer to the question asked (which might not be the question intended). On Fri, 27 Jun 2008, john seers (IFR) wrote: > There is also the "trim" command in the gdata package. Removes blanks > from the front of the string as well which may not be what you want. But that removes *spaces* and not *blanks*, according to the help page (and the actual code -- in fact it removes only ASCII space characters and not others such as nbspace). > Regards > > JS > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On Behalf Of jim holtman > Sent: 27 June 2008 10:27 > To: juli pausas > Cc: R-help > Subject: Re: [R] removing blanks from a string > > Is this what you want: > >> x <- c("hola", "Yes ", "hello ") >> gsub(" *$", "", x) > [1] "hola" "Yes" "hello" >> >> > > > On Fri, Jun 27, 2008 at 4:34 AM, juli pausas <[EMAIL PROTECTED]> wrote: >> Hi >> Is there a way to remove blank characters from the end of strings in a > >> vector? Something like the =TRIM functions of the OpenOffice >> spreadsheet. E.g., >> a <- c("hola", "Yes ", "hello ")# I'd like to get: >> c("hola", "Yes", "hello") >> >> Thanks >> >> Juli -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list 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] false discovery rate !
Hi Are all your input p values the same? If so your output FDR values would be the same. Or are all your p-values relatively large? Then (nearly) all your FDR values might be 1. Why don't you put a small example up of what you did? Then we could see what method you used etc. Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of A Ezhil Sent: 10 July 2008 15:41 To: r-help@r-project.org Subject: [R] false discovery rate ! Dear All, It is not a typical R question (though I use R for this) but I thought someone will help me. For the list of P values, I have calculated FDR using p.adjust() in R (bioconductor). But my FDR values are same for all the P values. When do we get same FDR values? Does the smallest P values should less than 1/N? (where N is the number of P values) Thanks in advance. Kind regards, Ezhil __ R-help@r-project.org mailing list 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 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] false discovery rate !
Hi Ezhil Quite possibly. Look at this simple example based on what you describe: > p.adjust(c(0.0002, 0.41, 0.4, 0.42,0.43)) [1] 0.001 1.000 1.000 1.000 1.000 Does this fit what you are seeing? Regards JS --- Web sites: www.ifr.ac.uk www.foodandhealthnetwork.com -Original Message- From: A Ezhil [mailto:[EMAIL PROTECTED] Sent: 10 July 2008 16:23 To: r-help@r-project.org; john seers (IFR) Subject: RE: [R] false discovery rate ! Dear John, My P values are not same and the smallest P value = 0.0002. My P value distribution is not that great (see the attached file), most of them are > 0.4. Do you think this is the reason for getting same FDR vlaues? Thanks again, Ezhil --- On Thu, 7/10/08, john seers (IFR) <[EMAIL PROTECTED]> wrote: > From: john seers (IFR) <[EMAIL PROTECTED]> > Subject: RE: [R] false discovery rate ! > To: [EMAIL PROTECTED], r-help@r-project.org > Date: Thursday, July 10, 2008, 8:27 PM Hi > > Are all your input p values the same? If so your output FDR values > would be the same. > > Or are all your p-values relatively large? Then (nearly) all your FDR > values might be 1. > > Why don't you put a small example up of what you did? > Then we could see > what method you used etc. > > Regards > > > JS > > > > > --- > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of A Ezhil > Sent: 10 July 2008 15:41 > To: r-help@r-project.org > Subject: [R] false discovery rate ! > > Dear All, > > It is not a typical R question (though I use R for this) but I thought > someone will help me. For the list of P values, I have calculated FDR > using p.adjust() in R (bioconductor). But my FDR values are same for > all the P values. When do we get same FDR values? Does the smallest P > values should less than 1/N? (where N is the number of P values) > > Thanks in advance. > > Kind regards, > Ezhil > > __ > R-help@r-project.org mailing list > 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 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] download.file error
Hi Chib >>whether there is a way of handling the error you get in the download.file() function I think the function "try" will do this for you. That is, handle the error. Have a look at ?try. Regards John Seers --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of CHIB CO Sent: 01 April 2008 15:28 To: jim holtman Cc: r-help@r-project.org Subject: Re: [R] download.file error Hi Jim, I just wanted to know if there is a function in R that can tell you whether a file on the internet exists before you attempt to download it or whether there is a way of handling the error you get in the download.file() function without having it break a for loop with the download error when it is part of that loop. Kind Regards Chib __ R-help@r-project.org mailing list 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] Getting JRI/rJava to work
Hello All I am trying to get the JRI examples from rJava to work on Windows XP and failing. (And as a more general and connected question is there any review/summary of front-end software for R?) I have installed rJava from the Windows binary supplied. I compile and run the example supplied (rtest.java) and get the results below. I do not think the notes about a deprecated API are a problem. But I do not know what causes the unsupported conversion messages. Versions used etc below. Any ideas please? Thanks for any help. Regards John Seers C:\temp\JRI\examples>javac -cp "C:/Program Files/R/mylibrary/rJava/jri/JRI.jar" rtest.java Note: rtest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. C:\temp\JRI\examples>java -Djava.library.path="C:/Program Files/R/mylibrary/rJava/jri" -cp .;"C:/Program Files/R/mylibrary/rJava/jri/JRI.jar" rtest Creating Rengine (with arguments) Error in structure(.Internal(Sys.getenv(as.character(x), as.character(unset))), : unsupported conversion R version 2.7.0 (2008-04-22) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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. Error in file.info(lib.loc) : unsupported conversion in 'filenameToWchar' Error in file.exists(name) : unsupported conversion in 'filenameToWchar' rShowMessage "Fatal error: unable to restore saved data in .RData " C:\temp\JRI\examples> ## C:\temp\JRI\examples>which java /cygdrive/c/Program Files/Java/jdk1.6.0_06/bin/java C:\temp\JRI\examples>which javac /cygdrive/c/Program Files/Java/jdk1.6.0_06/bin/javac C:\temp\JRI\examples> > sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] rJava_0.5-1 RWinEdt_1.8-0 > --- __ R-help@r-project.org mailing list 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] Getting JRI/rJava to work
Hello >Trying to run R in a non-existent locale (or at least in a charset iconv() does not understand). >However, your example (with suitably modified paths) does work for me in apparently the same locale, so > I cannot debug it for you. Thank you for trying. I do not understand the non-existent locale and iconv() you mention. JRI calls R and I do not know how it does it. Perhaps that is the problem and a clue for where I should look. >I do think the R posting guide clearly indicates this as off-topic for R-help -- it is a non-R >programming issue involving a contributed package. Sorry if it is off topic. I was not sure, so I took the middle road of posting to R-help and the package owner. Regards John Seers __ R-help@r-project.org mailing list 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] Sort matrix with duplicate row names alphabetically by rowname
Try: mat <- mat[order(rownames(mat)), ] --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Geeleher Sent: 19 May 2008 12:07 To: r-help@r-project.org Subject: [R] Sort matrix with duplicate row names alphabetically by rowname Hi, I've a matrix that contains 4 replicates of each rowname. (4 a's, 4 b's, 4 c's in no particular order) Like this: # c 32 a 1 b 4 c 87 c 34 b 54 a 23 a 12 b 9 a 3 b 87 c 43 There are a couple of more columns but I'm using the above as an example I need to sort it so that the same rownames appear together in alpahbetical order. Like this: # a 1 a 23 a 12 a 3 b 4 b 54 b 9 b 87 c 87 c 34 c 43 c 32 The code I came up with is something like this: mat <- mat[sort(rownames(mat)), ] This doesn't work though, it returns the same value for each row each time, something like this: # a 1 a 1 a 1 a 1 b 4 b 4 b 4 b 4 c 32 c 32 c 32 c 32 Any ideas how I could get my code to distinguish between the different rows and get the output I'm looking for? Thanks, -Paul __ R-help@r-project.org mailing list 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 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] Scaling a column in groups
Ah, that is neat. Thanks. JS -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: 16 November 2007 15:12 To: john seers (IFR) Cc: r-help@r-project.org Subject: Re: [R] Scaling a column in groups Try this: c(apply(matrix(testdata, 25), 2, scale)) On Nov 16, 2007 9:20 AM, john seers (IFR) <[EMAIL PROTECTED]> wrote: > > Hello R people > > I have a column of numeric values that are grouped in blocks of 25 and > to be centered and scaled within each block. (That is subtract the > mean and divide by the standard deviation.) > > Is there a neater way to do this? i.e not using a loop? > > Example looped code: > > testdata<-1:100 > csvalues<-NULL > for (i in 1:(length(testdata)/25)) { >st<-(i-1) * 25 + 1 >sel<-st:(st+24) >selvals<-testdata[sel] >csvalues<-c(csvalues, scale(selvals, scale=sd(selvals))) } > > Thanks for any help. > > > John Seers > > > > > --- > > John Seers > Institute of Food Research > Norwich Research Park > Colney > Norwich > NR4 7UA > > > tel +44 (0)1603 251497 > fax +44 (0)1603 507723 > e-mail [EMAIL PROTECTED] > e-disclaimer at http://www.ifr.ac.uk/edisclaimer/ > > Web sites: > > www.ifr.ac.uk > www.foodandhealthnetwork.com > > __ > R-help@r-project.org mailing list > 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 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] Scaling a column in groups
Hello R people I have a column of numeric values that are grouped in blocks of 25 and to be centered and scaled within each block. (That is subtract the mean and divide by the standard deviation.) Is there a neater way to do this? i.e not using a loop? Example looped code: testdata<-1:100 csvalues<-NULL for (i in 1:(length(testdata)/25)) { st<-(i-1) * 25 + 1 sel<-st:(st+24) selvals<-testdata[sel] csvalues<-c(csvalues, scale(selvals, scale=sd(selvals))) } Thanks for any help. John Seers --- John Seers Institute of Food Research Norwich Research Park Colney Norwich NR4 7UA tel +44 (0)1603 251497 fax +44 (0)1603 507723 e-mail [EMAIL PROTECTED] e-disclaimer at http://www.ifr.ac.uk/edisclaimer/ Web sites: www.ifr.ac.uk www.foodandhealthnetwork.com __ R-help@r-project.org mailing list 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] Problem with scan() from UTF-8 encoded URL
Hello Works fine for me: > data <-scan(file='http://en.wikipedia.org/wiki/Special:Recentchanges',what='c haracter') Read 3581 items > So I don't think it is the Wikipedia end. Regards John Seers --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of EUROPOL Sent: 03 December 2007 16:51 To: [EMAIL PROTECTED] Subject: [R] Problem with scan() from UTF-8 encoded URL Hallo, I am trying to import a website and structure it from within R: The following code: data <- scan(file='http://en.wikipedia.org/wiki/Special:Recentchanges',what='cha racter') results in the error: Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open: HTTP status was '403 Forbidden' in: file(file, "r") It seems that the error is connected to the UTF-8-format of wikipedia, since the following line works: data <- scan(file='http://www.google.de',what='character') I am looking forward to your answers. Greetings Marc Schwenzer __ R-help@r-project.org mailing list 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 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] Rprofile.site not executed?
Hi I am running under Windows XP using R2.6.1. I pasted your code in my Rprofile.site in the etc directory and it worked for me. All I can suugest is: 1. Check you really put it in the etc directory. (Do you have an old version of R somewhere ...?) 2. Is it really called Rprofile.site. (Not .RProfile.site?) 3. Is your Rprofile.site protected against read? Or the etc directory? Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fernando Saldanha Sent: 16 January 2008 14:00 To: R-help@r-project.org Subject: [R] Rprofile.site not executed? It seems that my Rprofile.site file is not executed when I start R. To test this I included the following code in that file: .First <- function(){ cat("\nWelcome at", date(), "\n") flush.console() } When I start R the message above is not displayed. I am running R 2.6.1 (rgui.exe) under Vista Home Premium. The Rprofile.site is in the etc folder and the R_PROFILE variable has the value "". I looked in the help (?Startup) but could not figure out what is wrong. Any suggestions? Thanks. FS __ R-help@r-project.org mailing list 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 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] How to assign names in a list
Hi All How can you associate names with a list when names have not been assigned? For example if you have a list like this: list2<-list(1,2,3) list2 [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 How do you make it look like this with names? : f1<-1 f2<-2 f3<-3 list1<-list(name1=f1, name2=f2, name3=f3) list1 $name1 [1] 1 $name2 [1] 2 $name3 [1] 3 Thanks for any help. I expect there is a simple answer but I cannot find it ... Regards John --- __ R-help@r-project.org mailing list 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] How to assign names in a list
Thanks Henrique and Nathalie for your answers. Very strange - I thought I had tried that and it had not worked so I came to the conclusion that names did not work on lists. Now it does work, so I must have had some finger trouble. Regards John --- From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: 19 January 2009 12:30 To: john seers (IFR) Cc: r-help@r-project.org Subject: Re: [R] How to assign names in a list If I understand correctly: names(list2) <- paste("name", 1:3, sep = "") On Mon, Jan 19, 2009 at 10:23 AM, john seers (IFR) wrote: Hi All How can you associate names with a list when names have not been assigned? For example if you have a list like this: list2<-list(1,2,3) list2 [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 How do you make it look like this with names? : f1<-1 f2<-2 f3<-3 list1<-list(name1=f1, name2=f2, name3=f3) list1 $name1 [1] 1 $name2 [1] 2 $name3 [1] 3 Thanks for any help. I expect there is a simple answer but I cannot find it ... Regards John --- __ R-help@r-project.org mailing list 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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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] save a plot from R graphics window (in Windows)
Hi Are you sure this is an R problem? The "Choose" dialog can be very slow if you have networked directories that cannot be connected to. Windows tries to connect repeatedly and each time waits for a timeout. Suggest you check your mapped network drives. Regards JS --- Dear R users since R 2.6.0 when I try to save a graph from the Rgraphic device I find that the system becomes so slow that I'm forced to kill the process. This usually does not happen at the beginning of the session. The problem seems to arise when the system opens the dialog window to choose the directory and file name. (R version 2.6.1 under Windows XP) Thank you all Giovanni __ R-help@r-project.org mailing list 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] Building a formula using paste
Hi All I have looked but cannot find an answer to this. I want to build a formula dynamically (in a function), using for example paste, and using it in a model: fr<-"F1" f1<-formula(paste(fr, "~ SensoryTerm")) m1<-aov(f1, data=vdata) So this is the equivalent of m1<-aov(F1 ~ SensoryTerm, data=vdata) This works fine but the problem is the formula appears as "f1" in the summary(m1) of the model and not "F1 ~ SensoryTerm". With many models this can be a bit confusing Is there a way to code this so the formula appears in the model summary? Regards John Seers > sessionInfo() R version 2.6.1 (2007-11-26) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] pixmap_0.4-7 gplots_2.3.2 gdata_2.3.1 gtools_2.4.0 rcom_1.5-2.2 [6] nnet_7.2-38 e1071_1.5-17 class_7.2-38 tree_1.0-26 mgcv_1.3-29 [11] MASS_7.2-38 car_1.2-7 RODBC_1.2-2 RWinEdt_1.7-9 > --- __ R-help@r-project.org mailing list 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] Building a formula using paste
Thank you very much. That problem has been niggling me for some time. I slotted in your code and it worked. I just need to spend a bit of time understanding it ... Thanks again. John Seers --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 01 February 2008 09:57 To: [EMAIL PROTECTED]; john seers (IFR); [EMAIL PROTECTED] Subject: RE: [R] Building a formula using paste Please disregard my previous reply. Now that I have read your question, all becomes clear. To do what you want to do is a bit tricky. Here is one way f1 <- as.name("F1") fm <- eval(bquote(aov(.(f1) ~ sensoryTerm, data = vdata))) Them fm is the fitted model object, suitably formed. E&OE, of course! Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 4402 Home Phone: +61 7 3286 7700 mailto:[EMAIL PROTECTED] http://www.cmis.csiro.au/bill.venables/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Venables, Bill (CMIS, Cleveland) Sent: Friday, 1 February 2008 7:45 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] Building a formula using paste use as.formula() rather than just formula(). Bill Venables CSIRO Laboratories PO Box 120, Cleveland, 4163 AUSTRALIA Office Phone (email preferred): +61 7 3826 7251 Fax (if absolutely necessary): +61 7 3826 7304 Mobile: +61 4 8819 4402 Home Phone: +61 7 3286 7700 mailto:[EMAIL PROTECTED] http://www.cmis.csiro.au/bill.venables/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of john seers (IFR) Sent: Friday, 1 February 2008 7:31 PM To: [EMAIL PROTECTED] Subject: [R] Building a formula using paste Hi All I have looked but cannot find an answer to this. I want to build a formula dynamically (in a function), using for example paste, and using it in a model: fr<-"F1" f1<-formula(paste(fr, "~ SensoryTerm")) m1<-aov(f1, data=vdata) So this is the equivalent of m1<-aov(F1 ~ SensoryTerm, data=vdata) This works fine but the problem is the formula appears as "f1" in the summary(m1) of the model and not "F1 ~ SensoryTerm". With many models this can be a bit confusing Is there a way to code this so the formula appears in the model summary? Regards John Seers > sessionInfo() R version 2.6.1 (2007-11-26) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] pixmap_0.4-7 gplots_2.3.2 gdata_2.3.1 gtools_2.4.0 rcom_1.5-2.2 [6] nnet_7.2-38 e1071_1.5-17 class_7.2-38 tree_1.0-26 mgcv_1.3-29 [11] MASS_7.2-38 car_1.2-7 RODBC_1.2-2 RWinEdt_1.7-9 > --- __ R-help@r-project.org mailing list 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 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 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] Building a formula using paste
Thanks for the help. Regards John Seers --- -Original Message- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: 01 February 2008 10:04 To: [EMAIL PROTECTED] Cc: john seers (IFR); [EMAIL PROTECTED] Subject: Re: [R] Building a formula using paste [EMAIL PROTECTED] wrote: > use as.formula() rather than just formula(). > > > Hm? That doesn't seem to cut it for me: > f <- as.formula(y~x) > lm(f) Call: lm(formula = f) Coefficients: (Intercept)x 0.06437 -0.09714 > summary(lm(f)) Call: lm(formula = f) Residuals: Min 1Q Median 3Q Max -1.2780 -0.4229 -0.3208 0.7534 1.3073 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.064370.61961 0.1040.920 x -0.097140.09986 -0.9730.359 Residual standard error: 0.907 on 8 degrees of freedom Multiple R-Squared: 0.1058, Adjusted R-squared: -0.005995 F-statistic: 0.9464 on 1 and 8 DF, p-value: 0.3591 The problem is that we get the call and not the formula, and this appears to be the case whether you use formula or as.formula. Also > identical(as.formula(y~x), formula(y~x)) [1] TRUE I see two workarounds: (a) Extract the formula explicitly and print it along with the output > formula(m) y ~ x > m Call: lm(formula = f) Coefficients: (Intercept)x 0.06437 -0.09714 (b) substitution tricks, e.g. > eval(bquote(lm(.(f Call: lm(formula = y ~ x) Coefficients: (Intercept)x 0.06437 -0.09714 > > Hi All > > I have looked but cannot find an answer to this. > > I want to build a formula dynamically (in a function), using for > example paste, and using it in a model: > > fr<-"F1" > f1<-formula(paste(fr, "~ SensoryTerm")) > m1<-aov(f1, data=vdata) > > So this is the equivalent of m1<-aov(F1 ~ SensoryTerm, data=vdata) > > This works fine but the problem is the formula appears as "f1" in the > summary(m1) of the model and not "F1 ~ SensoryTerm". With many models > this can be a bit confusing > > Is there a way to code this so the formula appears in the model summary? > > > -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@r-project.org mailing list 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] How to make reference to R in the method section in ascientific article?
When you start R you get this information: 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. That should help answer your question. Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Falco tinnunculus Sent: 04 February 2008 11:40 To: r-help@r-project.org Subject: [R] How to make reference to R in the method section in ascientific article? Dear all, How do I make reference to R in the method section in a scientific article? Should I state the web aderess? And, is this the proper way to report the lme test? "The relationships were assumed to be linear. The response, handling time and the explanatory variable, prey mass, were log transformed to obtain normal error distributions. The lme function of the nlme package for R was used to fit linear mixed-effects (LME) models, using restricted maximum likelihood (REML). Model selection were computed by using the Akaike Information Criteria (AIC). The overall test of the model was conducted with ANOVA." Regards Kes [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] How to search for packages
Hi I think this is a good suggestion. And I would like to add the associated problem of deciding between packages that do the same function which one is "better". Or similarly packages are often superceded. I find I have to spend a lot of time learning how to use packages to decide which one is most suitable; or I spend time with a package to eventually find out it was superceded some time ago or has been incorporated in another package. It is also difficult to know how packages fit together (or not). Functionality often overlaps or is duplicated. I have had some difficulty with microarray packages - not being sure if they complement each other or are exclusive to each other. (I know that is more Bioconductor but the same principle applies in pure R packages, though perhaps not as pronounced a problem). Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Monica Pisica Sent: 04 February 2008 14:34 To: r-help@r-project.org Subject: [R] How to search for packages Hi everybody, I know this might be very off topic and it took me quite a while to up my courage to post this But I remember a thread some time ago about how we can find the packages we need to do specific tasks in R if we don't know before hand which ones actually do it. Now all the packages are listed alphabetically on the web site. Since I am not very advanced in writing my own functions I relay heavily on work already done and only when I have no other choice I modify existing functions. Usually my modifications are only cosmetic. But sometimes I use lots of time to just read the descriptions of packages until I decide that maybe one will do close to what I want. I wonder if there is any way to improve how these packages are displayed on the site and help with this decision. I wonder if the community as a whole can come up with some broader categories such as Bayesian, spatial statistics, bootstrap, vegetation analysis, circular statistics, robust statistics, etc., and the authors of the package can choose 1 or 2 or how many categories they think their package fits the most. On the web page we can have a list of those very broad categories and within each category we can have in alpha order the packages themselves with their description and such as it is now. So if I am interested in vegetation analysis or environmental analysis but I never did it before I go to that category and see which packages are more geared towards that particular subject. For example it was by chance alone and some GOOGLE search that I discovered that the package labdsv has anything to do with vegetation analysis since first of course I looked at any package which might have "veg" or "env" in the title. I also realize that this might mean a lot of work, but R develops so rapidly that soon I think it will be unmanageable to just peruse the list of packages and read descriptions in order to choose which package to install, when you are not familiar with all of them. I hope I didn't offend the community with this, I would be very sorry since actually I get lots of help here and I learnt a lot from you. I will remain forever greatful. Thanks, Monica _ [[elided Hotmail spam]] __ R-help@r-project.org mailing list 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 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] Using lapply and list names not available
Hello All Using lapply and ending up with lists of lists I often end up in the position of not having the names of the list passed by lapply. So, if I am doing something like a plot, and I would like the title to reflect which plot it is, I cannot easily do it. So I find myself doing some unstructured variable passing and counting to be able to keep track of my data. Then I think perhaps I should not use lapply and just use simple loops. Is there a better way to do this? Here is a simple example to illustrate what I am talking about. The list has the names of people and I need the names to use as the headings of the plots. # # Make some test data people<-list(Andrew=rnorm(10), Mary=rnorm(10), Jane=rnorm(10), Richard=rnorm(10)) # Function to plot each list entry with its title name doplot<-function(individual, peoplenames) { peoplecount<<-peoplecount + 1 plot(individual, main=peoplenames[peoplecount]) } # peoplecount<-0 jpeg(file="test.jpg") par(mfrow=c(2,2)) lapply(people, doplot, names(people)) dev.off() # Thank you for any suggestions. John Seers --- __ R-help@r-project.org mailing list 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] modifying arrays within functions
Hi KB I am not sure exactly what you want to do but perhaps this is this closer to what you need: addition<-function(X, a){Xnew<-X + a} X<-array(1,dim=c(2,2)) a<-2 Xa<-addition(X,a) Xa Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Konrad BLOCHER Sent: 05 February 2008 15:52 To: r-help@r-project.org Subject: [R] modifying arrays within functions Hi, I'm pretty new to R and seem to be having difficulties with writing a function that would change an array and keep the change after the function finishes its work. in other words I have an array of 1'sX<-array(1,dim=c(2,2)) I want to add a number to X[1,1] by means of a function called addition. What I am writing is: addition<-function(a){X[1,1]=X[1,1}+a} but it doesn't seem to work Any ideas? Please? :) Thanks KB __ R-help@r-project.org mailing list 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 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] Using lapply and list names not available
Hi Gabor Thanks for the suggestion but I am not sure it actually addresses my problem. I will ponder the idea of my data needing to be in a different form but I am not sure how to get there easily with what I have got. The example I gave was just a simplified example to demonstrate how you cannot access the names of the list once it has been passed by lapply. My real world problem is data coming from 4 spreadsheets for thirteen volunteers and 250 variables with various models being calculated and values extracted from the models. lapply seems to be the way to do these repetitive processes on the data, volunteers etc but then I end up with a load of lists of lists. I guess I could extract the data from the lists into a more suitable format for plotting but as lapply has already done all the work it seems a lot of extra effort. I would like to be able to do one more lapply to plot the data (or whatever) and be able to slap a label on it so I can keep track of what I am doing. Regards John Seers -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: 05 February 2008 16:17 To: john seers (IFR) Cc: R Help Subject: Re: [R] Using lapply and list names not available The problem is your data is in wide format and you want it in long format. See ?reshape and also see the reshape package. In your example, ?stack is sufficient: library(lattice) xyplot(values ~ seq_along(values) | ind, data = stack(people)) On Feb 5, 2008 11:05 AM, john seers (IFR) <[EMAIL PROTECTED]> wrote: > > Hello All > > Using lapply and ending up with lists of lists I often end up in the > position of not having the names of the list passed by lapply. So, if > I am doing something like a plot, and I would like the title to > reflect which plot it is, I cannot easily do it. So I find myself > doing some unstructured variable passing and counting to be able to > keep track of my data. Then I think perhaps I should not use lapply > and just use simple loops. > > Is there a better way to do this? > > Here is a simple example to illustrate what I am talking about. The > list has the names of people and I need the names to use as the > headings of the plots. > > > > ## > ## > # > > # Make some test data > people<-list(Andrew=rnorm(10), Mary=rnorm(10), Jane=rnorm(10), > Richard=rnorm(10)) > > > # Function to plot each list entry with its title name > doplot<-function(individual, peoplenames) { >peoplecount<<-peoplecount + 1 >plot(individual, main=peoplenames[peoplecount]) } > > # > peoplecount<-0 > jpeg(file="test.jpg") > par(mfrow=c(2,2)) > lapply(people, doplot, names(people)) > dev.off() > > ## > ## > # > > > Thank you for any suggestions. > > > John Seers > > --- > > __ > R-help@r-project.org mailing list > 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 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] Using lapply and list names not available
OK, that looks a good suggestion. Though it is a bit of a step towards loops and counting ... Thanks a lot. Regards JS -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tue 2/5/2008 4:51 PM To: john seers (IFR) Cc: R Help Subject: Re: [R] Using lapply and list names not available If you must use lapply then do it over the names rather than the data: lapply(names(people), function(nm) plot(1:10, people[[nm]], main = nm)) On Feb 5, 2008 11:47 AM, john seers (IFR) <[EMAIL PROTECTED]> wrote: > > > Hi Gabor > > Thanks for the suggestion but I am not sure it actually addresses my > problem. I will ponder the idea of my data needing to be in a different > form but I am not sure how to get there easily with what I have got. > > The example I gave was just a simplified example to demonstrate how you > cannot access the names of the list once it has been passed by lapply. > My real world problem is data coming from 4 spreadsheets for thirteen > volunteers and 250 variables with various models being calculated and > values extracted from the models. > > lapply seems to be the way to do these repetitive processes on the data, > volunteers etc but then I end up with a load of lists of lists. I guess > I could extract the data from the lists into a more suitable format for > plotting but as lapply has already done all the work it seems a lot of > extra effort. I would like to be able to do one more lapply to plot the > data (or whatever) and be able to slap a label on it so I can keep track > of what I am doing. > > Regards > > John Seers > > > > > -Original Message- > From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] > Sent: 05 February 2008 16:17 > To: john seers (IFR) > Cc: R Help > Subject: Re: [R] Using lapply and list names not available > > The problem is your data is in wide format and you want it in long > format. > See ?reshape and also see the reshape package. In your example, ?stack > is sufficient: > > library(lattice) > xyplot(values ~ seq_along(values) | ind, data = stack(people)) > > > On Feb 5, 2008 11:05 AM, john seers (IFR) <[EMAIL PROTECTED]> > wrote: > > > > Hello All > > > > Using lapply and ending up with lists of lists I often end up in the > > position of not having the names of the list passed by lapply. So, if > > I am doing something like a plot, and I would like the title to > > reflect which plot it is, I cannot easily do it. So I find myself > > doing some unstructured variable passing and counting to be able to > > keep track of my data. Then I think perhaps I should not use lapply > > and just use simple loops. > > > > Is there a better way to do this? > > > > Here is a simple example to illustrate what I am talking about. The > > list has the names of people and I need the names to use as the > > headings of the plots. > > > > > > > > ## > > ## > > # > > > > # Make some test data > > people<-list(Andrew=rnorm(10), Mary=rnorm(10), Jane=rnorm(10), > > Richard=rnorm(10)) > > > > > > # Function to plot each list entry with its title name > > doplot<-function(individual, peoplenames) { > >peoplecount<<-peoplecount + 1 > >plot(individual, main=peoplenames[peoplecount]) } > > > > # > > peoplecount<-0 > > jpeg(file="test.jpg") > > par(mfrow=c(2,2)) > > lapply(people, doplot, names(people)) > > dev.off() > > > > ## > > ## > > # > > > > > > Thank you for any suggestions. > > > > > > John Seers > > > > --- > > > > __ > > R-help@r-project.org mailing list > > 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 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] Difference between P.Value and adj.P.Value
Hi Corinna The p.adjusted value is the the p-value adjusted for Multiple Comparisons. Enter ?p.adjust to get more of an explanation. Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Schmitt, Corinna Sent: 11 February 2008 16:02 To: r-help@r-project.org Subject: [R] Difference between P.Value and adj.P.Value Hallo, > fit12<-lmFit(qrg[,1:2]) > t12<-toptable(fit12,adjust="fdr",number=25,genelist=qrg$genes[,1]) > t12 ID logFC t P.Value adj.P.ValB 522PLAU_OP -6.836144 -8.420414 5.589416e-05 0.01212520 2.054965 1555 CD44_WIZ -6.569622 -8.227938 6.510169e-05 0.01212520 1.944046 Can anyone tell me what the difference is between P.Value and adj.P.Value? I need to analyse microarrays and should say if there exist differential expressed genes. Which P.Value should I use? Thanks, Corinna __ R-help@r-project.org mailing list 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 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] Building a package and Depends search
Hello R experts I am just learning how to build a package so this is probably a basic question. I have read the manual( well, to be more truthful, am reading) the manual, and I have searched the archives to the best of my ability. I am on Windows. When running the command "R CMD check packagename" I get this type of error: * checking package dependencies ... ERROR Packages required but not available: chron I think this is because I install my packages in "mylibrary" and use "R_LIBS=C:/PROGRA~1/R/mylibrary" in my Renviron.site file. If I move the package to the R main library it fixes the problem. But rather defeats the intention behind having a separate mylibrary. Can anybody tell me how to solve this? That is keep my installed packages in mylibrary but get the package check/build to work? I guess Depends: has a search path but I cannot find it or how to alter it. Can anybody point me to some documentation? Thanks very much for any help. Regards John Seers > sessionInfo() R version 2.6.2 (2008-02-08) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] chron_2.3-20 limma_2.12.0 RWinEdt_1.7-9 > --- __ R-help@r-project.org mailing list 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] Building a package and Depends search
Thank you very much for your help - that fixed it. Sorry I did not see it in the manual. Regards JS --- -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: 19 February 2008 14:14 To: john seers (IFR) Cc: r-help@r-project.org Subject: Re: [R] Building a package and Depends search On Tue, 19 Feb 2008, john seers (IFR) wrote: > > > Hello R experts > > I am just learning how to build a package so this is probably a basic > question. I have read the manual( well, to be more truthful, am > reading) the manual, and I have searched the archives to the best of my ability. You could have searched for R_LIBS in the manual (see below). > I am on Windows. > > When running the command "R CMD check packagename" I get this type of > error: > > * checking package dependencies ... ERROR Packages required but not > available: > chron > > I think this is because I install my packages in "mylibrary" and use > "R_LIBS=C:/PROGRA~1/R/mylibrary" in my Renviron.site file. If I move > the package to the R main library it fixes the problem. But rather > defeats the intention behind having a separate mylibrary. > > Can anybody tell me how to solve this? That is keep my installed > packages in mylibrary but get the package check/build to work? I guess > Depends: has a search path but I cannot find it or how to alter it. > Can anybody point me to some documentation? Set the environment variable R_LIBS in your commands windows/shell. As the manual says: @quotation Note @code{R CMD check} and @code{R CMD build} run @R{} with @option{--vanilla}, so none of the user's startup files are read. If you need @env{R_LIBS} set (to find packages in a non-standard library) you will need to set it in the environment. @end quotation > > Thanks very much for any help. > > > Regards > > > John Seers > > > > > > >> sessionInfo() > R version 2.6.2 (2008-02-08) > i386-pc-mingw32 > > locale: > LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United > Kingdom.1252;LC_MONETARY=English_United > Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 > > attached base packages: > [1] stats graphics grDevices datasets utils methods base > > > other attached packages: > [1] chron_2.3-20 limma_2.12.0 RWinEdt_1.7-9 >> > > > > > > > --- > > __ > R-help@r-project.org mailing list > 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. > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list 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] fitted values are different from manually calculating
Hi A simple example of a linear model: x<-1:10 y<-3*x+1 m1<-lm(y~x) y # [1] 4 7 10 13 16 19 22 25 28 31 fitted(m1) # 1 2 3 4 5 6 7 8 9 10 # 4 7 10 13 16 19 22 25 28 31 The fitted and calculated values look identical to me. Can you give an example of how your calculated values do not match? Or have I misunderstood your question? Regards JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 19 February 2008 14:41 To: [EMAIL PROTECTED] Subject: [R] fitted values are different from manually calculating Hello, on a simple linear model the values produced from the fitted(model) function are difference from manually calculating on calc. Will anyone have a clue... or any insights on how fitted function calculates the values? Thank you. -- -- Yianni [[alternative HTML version deleted]] __ R-help@r-project.org mailing list 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 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] how can I attach a variable stored in
Hi Peter Perhaps "get" is what you need? foo.bar <- list( "a"= "a", "b"=1 ) save( file="foo.bar.RData", foo.bar ) rm( foo.bar ) my.fn <- function( fname ) { load( fname ) attach( get(ls( pat="foo" )) ) # works #attach( foo.bar ) # works } Regards JS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Waltman Sent: 20 September 2007 20:24 To: Leeds, Mark (IED) Cc: r-help@r-project.org Subject: Re: [R] how can I attach a variable stored in Hi Mark - Thanks for the reply. Sorry I didn't really clarify too well what I'm trying to do. The issue is not that I can't see the variable that gets loaded. The issue is that the variable is a list variable, and I'd like to write a function that will take the .RData filename and attach the variable it contains so that I can more easily access its contents, i.e. foo.bar <- list( "a"= "a", "b"=1 ) save( file="foo.bar.RData", foo.bar ) rm( foo.bar ) my.fn <- function( fname ) { load( fname ) attach( ls( pat="foo" ) ) # I want to attach( foo.bar ), but this doesn't work } ls() # prints out "foo.bar" attach( ls( ) ) # still doesn't work attach( foo.bar ) # works So, basically, the question is how can I attach the variable that's stored in a file if I don't already know it's name? Thanks again! Peter __ R-help@r-project.org mailing list 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] Aligning gel data
Hello R I have some data from a number of gels showing the distance of bands in each gel and lane. My problem is to align these values by some method. It has been suggested to me (by a Matlab expert) that I could use Spectral methods such as COW (correlation-optimised warping) or PAGA (peak alignment using GA). I have searched but cannot find if there are equivalent packages that do this in R. Any suggestions from anybody on where to look? The idea is, I think, to create a matrix of all the possible values, mark them as present or not, and then perform an alignment. i.e a matrix something like: lane1 lane2 lane3 ... .0011 0 0 etc .0020 0 0 etc .003 ... Is there a more direct method than using spectral methods? Has anybody done something equivalent? Thank you in advance for any help. Regards John Seers __ R-help@r-project.org mailing list 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] problem with png()
Hi Ingo Your code worked for me and I did not lose the title. Not much help I know but my session details are below to compare. Windows XP ... Regards JS > sessionInfo() R version 2.6.0 (2007-10-03) i386-pc-mingw32 locale: LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United Kingdom.1252;LC_MONETARY=English_United Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices datasets utils methods base other attached packages: [1] lattice_0.17-1 RWinEdt_1.7-8 loaded via a namespace (and not attached): [1] grid_2.6.0 > --- John Seers Institute of Food Research Norwich Research Park Colney Norwich NR4 7UA tel +44 (0)1603 251497 fax +44 (0)1603 507723 e-mail [EMAIL PROTECTED] e-disclaimer at http://www.ifr.ac.uk/edisclaimer/ Web sites: www.ifr.ac.uk www.foodandhealthnetwork.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ingo Holz Sent: 15 November 2007 11:34 To: r-help@r-project.org Subject: Re: [R] problem with png() Dear Brian, sorry, library(lattice) is loaded, when I start R, so I forgot to add this. I get "Ingo's title" if I plot directly to the screen. However, I do not get it if I use png() or I lose it if I save from the plot (screen). Ingo On 15 Nov 2007 at 10:30, Prof Brian Ripley wrote: > Works for me when I add the library(lattice) you omitted > > Since effectively all png() is doing is copying the screen, the > problem is unlikely to be in png(). Most such problems are when there > is not enough space to include labels, and you need to adjust margins or pointsize. > > On Thu, 15 Nov 2007, Ingo Holz wrote: > > > Hi, > > > > I am runing R2.6.0 (2007-10-03) on WindowsXP. > > > > If I use png() to save a plot I lose the main title. > > > > An example: > > > > ## > > outfile <- "outfile.png" > > > > p11 <- histogram( ~ height | voice.part, data = singer, > > xlab="Height", main="Ingo's title") > > p2 <- histogram( ~ height, data = singer, xlab = "Height") > > > > png(outfile, width=800, height=800) > > print(p11, split=c(1,1,1,2), more=TRUE) print(p2, split=c(1,2,1,2)) > > dev.off() > > > > > > > > In my "outfile.png" I do not see "Ingo's title". > > I know that it is not possible to reproduce this "error" on LINUX. > > It seems not possible on Windows, either. > > > Thank you for your help. > > Ingo > > > > __ > > R-help@r-project.org mailing list > > 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. > > > > -- > Brian D. Ripley, [EMAIL PROTECTED] > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ > University of Oxford, Tel: +44 1865 272861 (self) > 1 South Parks Road, +44 1865 272866 (PA) > Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@r-project.org mailing list 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 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] install packages automatically
Hi I use the following method which works well for me. I create a directory to hold the installed packages e.g. C:\Program Files\R\mylibrary Then in my C:\Program Files\R\R-2.5.1\.Renviron file I have a line as follows: R_LIBS=C:/PROGRA~1/R/mylibrary (I think you have to use Windows short names in this file.) Thus whenever I install a new package it is installed in this directory. If I install a new version of R just update the .Renviron file and run Packages->Update packages ... This keeps the R base packages separate from the optional packages. JS --- -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wensui Liu Sent: 11 September 2007 02:45 To: [EMAIL PROTECTED] Subject: [R] install packages automatically Dear Listers, I am a little tired of installing all packages I want every time when I instill a new version of R. Say, if I have a list of packages I need to use, is it possible to tell R to install them all for me automatically rather than I install them one by one? Thx. __ [EMAIL PROTECTED] mailing list 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 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] install packages automatically
Hi Vladimir You may well be right and it is better, or at least better practice. But I have a feeling I tried it and it was not as successful, but I cannot remember why. Perhaps it was because when installing new packages they were not installed in that (USER) directory? JS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vladimir Eremeev Sent: 11 September 2007 10:10 To: [EMAIL PROTECTED] Subject: Re: [R] install packages automatically I think using R_LIBS_USER is better. >From ?.libPaths: The library search path is initialized at startup from the environment variable R_LIBS (which should be a semicolon-separated list of directories at which R library trees are rooted) followed by those in environment variable R_LIBS_USER. john seers (IFR) wrote: > > I use the following method which works well for me. > > I create a directory to hold the installed packages e.g. C:\Program > Files\R\mylibrary > > Then in my C:\Program Files\R\R-2.5.1\.Renviron file I have a line as > follows: > > R_LIBS=C:/PROGRA~1/R/mylibrary > > (I think you have to use Windows short names in this file.) > > Thus whenever I install a new package it is installed in this directory. > If I install a new version of R just update the .Renviron file and run > Packages->Update packages ... > > This keeps the R base packages separate from the optional packages. > JS > -Original Message- > From: [EMAIL PROTECTED] > Subject: [R] install packages automatically > > Dear Listers, > I am a little tired of installing all packages I want every time when I > instill a new version of R. > Say, if I have a list of packages I need to use, is it possible to tell > R to install them all for me automatically rather than I install them > one by one? > Thx. > > -- View this message in context: http://www.nabble.com/install-packages-automatically-tf4419780.html#a126 10798 Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list 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 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.