[R] xyplot key
Hi, I'm having trouble matching the symbols/color of the key to match those specifiec in the plot. Here is the code I used: xyplot(GCR+GCT ~ FRAC, data=RWF, type=c(g,p),cex=1.2,pch=c(22,21), xlab=expression(italic(f)),ylab=expression(italic(S)), key=list(points=list(pch=c(22,21),cex=1.2), text=list(c(Targeted Deletion,Random Deletion I'm, sorry if this is an apparently easy/obvious mistake on my part. With thanks Andrew http://www.nabble.com/file/p25681535/RWF.csv RWF.csv -- View this message in context: http://www.nabble.com/xyplot-key-tp25681535p25681535.html 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] Minimum and blanks
Hi all, I want to calculate the minimum of a column which contains blanks. R returns as the minimum, which is not I want. Is there a way to overcome it? Thanks in advance. Chris -- View this message in context: http://www.nabble.com/Minimum-and-blanks-tp25692189p25692189.html 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] Confidence intervals PLS prediction
I have switched from The Unscrambler to R for pls regression analysis and have been able to calculate scores, coefficients, RMSEP from a large number of PLS1 and PLS2 models. The ultimate goal is to use these models for predicting unknown samples, which again is straight-forward with the built-in predict() function. However, I’m struggling with prediction uncertainty (i.e. confidence intervals) on predicted values (as an estimate on the reliability of the predicted values). Has anyone looked into and/or developed an algorithm or function that calculates the prediction uncertainty? In order to report on the accuracy and reliability of the predicted values, we need to report on the yDeviation (as in http://www.camo.com/TheUnscrambler/Appendices/The%20Unscrambler%20Method%20References.pdf on page 31). I have extensively read and searched the available literature on plsr, mvr, predict, etc. as well as the Nabble forums but I couldn't find any reference to this kind of uncertainty values. I am considering writing my own function for this, but if this has already been addressed, it would be most helpful and would save me a lot of time. Thanks, Lieve Laurens, PhD National Renewable Energy Laboratory Golden, CO 80401 -- View this message in context: http://www.nabble.com/Confidence-intervals-PLS-prediction-tp25691532p25691532.html 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.
Re: [R] Calling R functions into C# or C++
Hi, It is possible to call R functions from .NET by using a .NET wrapper over the R (D)Com server. http://www.nabble.com/file/p25682136/RFromCsharp.zip Attached is a sample C# project that shows how to call R from C#. Best Regards, Fayssal El Moufatich http://www.nabble.com/file/p25682136/RFromCsharp.zip RFromCsharp.zip Shubha Vishwanath Karanth wrote: Hi R, I have a request... Can I call R functions/routines from C# or C++? If so, how do I do this? Do I need to have some knowledge on DLL to do this? Thanks a lot for your help, Shubha Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com 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. -- View this message in context: http://www.nabble.com/Calling-R-functions-into-C--or-C%2B%2B-tp17998762p25682136.html 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] re ading and analyzing a word document
file=(LUSDR/letter.doc) Howdy Y'all, So i am looking to read a word document in the following formats(.doc) or any type of accessible word processor software (e.g. text .txt, notepad, etc). Had the ability to search certain words, for instance banana, peacock,Weapons Mass Destruction. Then i could summarize and view the results. i looked and the only thing i could find was the below where i want to analyze letter.doc and look for the words mentioned in quotes above. Its aparently wrong but im wondering if this is even possible. Please advise. Thanks In Solidarity JR catbanana, peacock,Weapons Mass Destruction file=(letter.doc),sep=\n) readLines(file, n=-1) unlink(letter.doc) # tidy up ## difference in blocking cat(123\nabc, file = test1) readLines(test1) # line with a warning a=con - file(test1, r, blocking = FALSE) readLines(con) # empty cat( def\n, file = test1, append = TRUE) readLines(con) # gets both close(con) unlink(test1) # tidy up -- View this message in context: http://www.nabble.com/reading-and-analyzing-a-word-document-tp25691972p25691972.html 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] Input format for kcca in kernlab
Hi, I'm trying to use kcca function from the kernlab package, and it requires 2 input datasets, both of which need to be matrices containing data index by row. I have two data frame objects which I converted to matrices using data.frame(x). Their dimensions are 2264*10 and 2264*4. I then tried running kcca on the two data matrices, only to get this error: Error in kcca(xm, ym) : Number of colums in x, y matrixes is not equall Does anyone know why I'm encountering this error? Also, just to make the number of columns equal, I transposed my two data matrices, and reran kcca, on which I got a different error message: Error in VK[(n + 1):(2 * n), ] - Ky : number of items to replace is not a multiple of replacement length I'm not sure how to proceed further. Any help would be greatly appreciated. Thanks, Guru. -- View this message in context: http://www.nabble.com/Input-format-for-kcca-in-kernlab-tp25683222p25683222.html 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.
Re: [R] re ading and analyzing a word document
Considering your instructions: #Define words to find to.find - c( 'the', 'is', 'are' ,'dr') #Read in the file... file.text - readLines( 'data/letter.txt' ) #Count number of occurnces of deined word in text line.matches - unlist( lapply( to.find, grep, x = unlist(file.text[2]) ) ) Result: line.matches [1] 1 1 1 This is not right of course as there are actually four words and secondly becasue the searched words appear multiple times. I think the problem is that the file.text is coming in so that file.text[2] -\tHello sir, I write to you seeking your guidance organizing some data. I have a . So its reading the document its just putting them into this type of format. Im stuck, i tried doing it by saving the doc to a csv and searching strings, tried using a match process. It would also be useful to simply get a run down similar to a summary expressing the most common words. Ideas? cls59 wrote: PDXRugger wrote: Howdy Y'all, So i am looking to read a word document in the following formats(.doc) or any type of accessible word processor software (e.g. text .txt, notepad, etc). Had the ability to search certain words, for instance banana, peacock,Weapons Mass Destruction. Then i could summarize and view the results. i looked and the only thing i could find was the below where i want to analyze letter.doc and look for the words mentioned in quotes above. Its aparently wrong but im wondering if this is even possible. Please advise. Thanks In Solidarity JR Well... you could make a vector of the words you want to find: to.find - c( 'banana', 'peacock', 'Weapons' ) Read in the file... file.text - readLines( 'myFile.txt' ) And recursively apply the grep command in order to determine which lines contain matches for your words: line.matches - unlist( lapply( to.find, grep, x = file.text ) ) It may do what you want for plain text files, as for Microsoft Word files... well... Sometimes there is a price to pay for using a closed proprietary binary document format. Good luck! -Charlie -- View this message in context: http://www.nabble.com/reading-and-analyzing-a-word-document-tp25691972p25692751.html 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] aproximate a titration kurve to the measure data.
Halo i'm studying chemistry, today we made an experiment and i have to draw a titration kurve for my mess data. we can do it on a mm paper, or we can also use a programe. people from chemistry recomend R last year i studied civil eng. and we used Matlab, as I see, R ist very similar to it, but its got other comands. But i think R would be a good help for some exercises. so my main question is: i have some measurement data from my titration, and I want aproximate a kurve to this data. is it possible to do it with R? a titration kurve looks like this: http://www.nabble.com/file/p25685986/acetic-acid-titration-curve.png hope you can help me, and yes when its possible, if you know something like a tutorial then i would be glad if you could post it. with regards -- View this message in context: http://www.nabble.com/aproximate-a-titration-kurve-to-the-measure-data.-tp25685986p25685986.html 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.
Re: [R] Minimum and blanks
Chris, What is your definition of the minimum of a *character* vector? -Peter Ehlers Chris Li wrote: Hi all, I want to calculate the minimum of a column which contains blanks. R returns as the minimum, which is not I want. Is there a way to overcome it? Thanks in advance. Chris __ 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] Overview of error and warning messages for teaching + examples
It would best be there - I agree. But since I had no experience with the site - I didn't know the rules of use for it. Thanks for clarifying. Tal -- My contact information: Tal Galili E-mail: tal.gal...@gmail.com Phone number: 972-52-7275845 FaceBook: Tal Galili My Blogs: http://www.talgalili.com (Web and general, Hebrew) http://www.biostatistics.co.il (Statistics, Hebrew) http://www.r-statistics.com/ (Statistics,R, English) On Thu, Oct 1, 2009 at 4:14 AM, Ben Bolker bol...@ufl.edu wrote: Tal Galili tal.galili at gmail.com writes: Hi Joris, Good luck with your work. I know how to set up a wiki. But I wouldn't do it for just 1 page. And also, if you have little experience with it - I am not sure you would find it easy to jump into it. I'll have a look around to see what other collaborative tools there are out there. Remind me why this shouldn't just be done on the official R wiki, wiki.r-project.org ?? __ 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] Overview of error and warning messages for teaching + examples
Hi Ben, other members of the list also pointed me to this possibility. I'll certainly add the manual. Kind regards Joris On Thu, Oct 1, 2009 at 4:14 AM, Ben Bolker bol...@ufl.edu wrote: Tal Galili tal.galili at gmail.com writes: Hi Joris, Good luck with your work. I know how to set up a wiki. But I wouldn't do it for just 1 page. And also, if you have little experience with it - I am not sure you would find it easy to jump into it. I'll have a look around to see what other collaborative tools there are out there. Remind me why this shouldn't just be done on the official R wiki, wiki.r-project.org ?? __ 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] creating R roll in Centos OS
Hi I have Centos Operating System. I m installing R on it. For this I have to create roll of R. So, how to create the roll of R, regarding this what to be downloaded and from where? Plz help. By Sukhbir Singh Rattan. [[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] Minimum and blanks
The minimum of a character vector is returned according to the unicode or ascii code values, but I guess that's not what Chris is looking for. Chris, please always try to provide a minimal working example of code to see what is wrong. Something goes wrong with the input in your example. As Peter rightfully pointed out, your vector is considered a character vector. So you need to : 1) replace with NA e.g. x - ifelse(x=='',NA,x) Better to do something like that when reading in the code. 2) use the argument na.rm : min (x, na.rm=T) kind regards Joris On Thu, Oct 1, 2009 at 8:36 AM, Peter Ehlers ehl...@ucalgary.ca wrote: Chris, What is your definition of the minimum of a *character* vector? -Peter Ehlers Chris Li wrote: Hi all, I want to calculate the minimum of a column which contains blanks. R returns as the minimum, which is not I want. Is there a way to overcome it? Thanks in advance. Chris __ 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] Missing functions
Kenny Shen wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny Hi, Try psych:::theFunctionIWant, does this find the function? cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~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.
Re: [R] Missing functions
hi paul, i tried loading the package psych again and: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete typing library(psych) after that just brings me to an empty then with psych:::function, Error: package 'psych' does not have a name space is there a way to perhaps clean up and reinstall the packages? thanks, kenny On Thu, Oct 1, 2009 at 3:54 PM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: Kenny Shen wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny Hi, Try psych:::theFunctionIWant, does this find the function? cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul http://intamap.geo.uu.nl/%7Epaul -- - A mental model is good. I change mine all the time. [[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] Missing functions
Hi Kenny, what version of R are you using? To clean up, try remove.packages (http://stat.ethz.ch/R-manual/R-patched/library/utils/html/remove.packages.html) On Thu, Oct 1, 2009 at 10:43 AM, Kenny Shen little...@gmail.com wrote: hi joris, i installed them using install.packages('psych') from within R i tried loading and this is what i got: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete and also: psych:::describe(lvs_m1) Error: package 'psych' does not have a name space is there a way to clean up and reinstall the packages? thanks, Kenny On Thu, Oct 1, 2009 at 4:02 PM, joris meys jorism...@gmail.com wrote: Hi, It installed perfectly for me, both packages. the command library (help = psych) works too. What did you do exactly to install it? If you look in the list of loaded packages in the console, are they shown there? kind regards Joris On Thu, Oct 1, 2009 at 7:44 AM, Kenny Shen little...@gmail.com wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny -- - A mental model is good. I change mine all the time. [[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. -- - A mental model is good. I change mine all the time. __ 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] Missing functions
hi joris, I'm using: R version 2.8.1 (2008-12-22) I'll give the remove a try and then do another install. hope that'll resolve the issue. thanks for your advice! kenny On Thu, Oct 1, 2009 at 4:51 PM, joris meys jorism...@gmail.com wrote: Hi Kenny, what version of R are you using? To clean up, try remove.packages ( http://stat.ethz.ch/R-manual/R-patched/library/utils/html/remove.packages.html ) On Thu, Oct 1, 2009 at 10:43 AM, Kenny Shen little...@gmail.com wrote: hi joris, i installed them using install.packages('psych') from within R i tried loading and this is what i got: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete and also: psych:::describe(lvs_m1) Error: package 'psych' does not have a name space is there a way to clean up and reinstall the packages? thanks, Kenny On Thu, Oct 1, 2009 at 4:02 PM, joris meys jorism...@gmail.com wrote: Hi, It installed perfectly for me, both packages. the command library (help = psych) works too. What did you do exactly to install it? If you look in the list of loaded packages in the console, are they shown there? kind regards Joris On Thu, Oct 1, 2009 at 7:44 AM, Kenny Shen little...@gmail.com wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny -- - A mental model is good. I change mine all the time. [[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. -- - A mental model is good. I change mine all the time. -- - A mental model is good. I change mine all the time. [[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] Missing functions
Hi joris, following your link to the uninstall, then reinstall packages did the trick. thanks! kenny On Thu, Oct 1, 2009 at 4:55 PM, Kenny Shen little...@gmail.com wrote: hi joris, I'm using: R version 2.8.1 (2008-12-22) I'll give the remove a try and then do another install. hope that'll resolve the issue. thanks for your advice! kenny On Thu, Oct 1, 2009 at 4:51 PM, joris meys jorism...@gmail.com wrote: Hi Kenny, what version of R are you using? To clean up, try remove.packages ( http://stat.ethz.ch/R-manual/R-patched/library/utils/html/remove.packages.html ) On Thu, Oct 1, 2009 at 10:43 AM, Kenny Shen little...@gmail.com wrote: hi joris, i installed them using install.packages('psych') from within R i tried loading and this is what i got: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete and also: psych:::describe(lvs_m1) Error: package 'psych' does not have a name space is there a way to clean up and reinstall the packages? thanks, Kenny On Thu, Oct 1, 2009 at 4:02 PM, joris meys jorism...@gmail.com wrote: Hi, It installed perfectly for me, both packages. the command library (help = psych) works too. What did you do exactly to install it? If you look in the list of loaded packages in the console, are they shown there? kind regards Joris On Thu, Oct 1, 2009 at 7:44 AM, Kenny Shen little...@gmail.com wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny -- - A mental model is good. I change mine all the time. [[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. -- - A mental model is good. I change mine all the time. -- - A mental model is good. I change mine all the time. -- - A mental model is good. I change mine all the time. [[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] Missing functions
Hi, Look at remove.packages(). Paul Kenny Shen wrote: hi paul, i tried loading the package psych again and: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete typing library(psych) after that just brings me to an empty then with psych:::function, Error: package 'psych' does not have a name space is there a way to perhaps clean up and reinstall the packages? thanks, kenny On Thu, Oct 1, 2009 at 3:54 PM, Paul Hiemstra p.hiems...@geo.uu.nl mailto:p.hiems...@geo.uu.nl wrote: Kenny Shen wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny Hi, Try psych:::theFunctionIWant, does this find the function? cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul http://intamap.geo.uu.nl/%7Epaul -- - A mental model is good. I change mine all the time. -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~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.
Re: [R] Missing functions
Yes Paul, that resolved the issue for me. Thanks again! On Thu, Oct 1, 2009 at 5:19 PM, Paul Hiemstra p.hiems...@geo.uu.nl wrote: Hi, Look at remove.packages(). Paul Kenny Shen wrote: hi paul, i tried loading the package psych again and: library(psych) Warning messages: 1: Display list redraw incomplete 2: Display list redraw incomplete 3: Display list redraw incomplete typing library(psych) after that just brings me to an empty then with psych:::function, Error: package 'psych' does not have a name space is there a way to perhaps clean up and reinstall the packages? thanks, kenny On Thu, Oct 1, 2009 at 3:54 PM, Paul Hiemstra p.hiems...@geo.uu.nlmailto: p.hiems...@geo.uu.nl wrote: Kenny Shen wrote: Hi all, I'm new to R and have been working hard to get familiarized with it. A problem I'm facing now is that having installed some packages (psych, doBy), I can't seem to access the functions even through there was no error messages when I load them using library(). I get an error telling me the function doesn't exist. But when I ran e.g. library(help = psych), the function I want was missing. I did find that when I load other packages, there will be some initialisation messages, but loading psych and doBy just brings up the prompt again with no output. Any help is greatly appreciated. Thanks, Kenny Hi, Try psych:::theFunctionIWant, does this find the function? cheers, Paul --Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul http://intamap.geo.uu.nl/%7Epaul http://intamap.geo.uu.nl/%7Epaul -- - A mental model is good. I change mine all the time. -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul http://intamap.geo.uu.nl/%7Epaul -- - A mental model is good. I change mine all the time. [[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] aproximate a titration kurve to the measure data.
Hi, This should be possible, even with automatic EP detection. Can you give use some example titration data, or the used matlab code? If you want some introduction papers to R, take a look at the documents at CRAN (CRAN other) Bart awayguy wrote: Halo i'm studying chemistry, today we made an experiment and i have to draw a titration kurve for my mess data. we can do it on a mm paper, or we can also use a programe. people from chemistry recomend R last year i studied civil eng. and we used Matlab, as I see, R ist very similar to it, but its got other comands. But i think R would be a good help for some exercises. so my main question is: i have some measurement data from my titration, and I want aproximate a kurve to this data. is it possible to do it with R? a titration kurve looks like this: http://www.nabble.com/file/p25685986/acetic-acid-titration-curve.png hope you can help me, and yes when its possible, if you know something like a tutorial then i would be glad if you could post it. with regards -- View this message in context: http://www.nabble.com/aproximate-a-titration-kurve-to-the-measure-data.-tp25685986p25695773.html 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] pass ... to multiple sub-functions
Dear list, I know I have seen this discussed before but I haven't been successful in searching for ellipsis, dots, ... in the archives. I would like to filter ... arguments according to their name, and dispatch them to two sub-functions, say fun1 and fun2. I looked at lm() but it seemed more complicated than I need as it modifies the calling function among other things. What is the best approach for this? My current version presented below seems very awkward. Best regards, baptiste sessionInfo() R version 2.9.2 (2009-08-24) i386-apple-darwin8.11.1 fun1 - function(col, row){ print(col) print(row) } fun2 - function(x){ print(x) } foo - function(..., lty=1){ dots - list(...) cl - match.call() col - eval.parent(cl$col) row - eval.parent(cl$row) params.fun1 - c(col, row) removed - na.omit(match(names(cl), params.fun1)) # index whichever arguments were passed to fun1 fun1(col, row) fun2(dots[seq_along(dots)[-removed]]) } foo() foo(col=1) foo(col=1, row=1, g=2, test = abc) __ 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 Subpopulation data?
Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe str=strata(sampleframe,c(type),size=c(20,), method=srswor) sample.strat-getdata(sampleframe,str) sample.strat length(H) i get: length(H) [1] 100 Desire to get: length(H) [1] 20 Best Regards [[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] aproximate a titration kurve to the measure data.
On Wed, 2009-09-30 at 10:55 -0700, awayguy wrote: Halo i'm studying chemistry, today we made an experiment and i have to draw a titration kurve for my mess data. we can do it on a mm paper, or we can also use a programe. people from chemistry recomend R last year i studied civil eng. and we used Matlab, as I see, R ist very similar to it, but its got other comands. But i think R would be a good help for some exercises. so my main question is: i have some measurement data from my titration, and I want aproximate a kurve to this data. is it possible to do it with R? a titration kurve looks like this: http://www.nabble.com/file/p25685986/acetic-acid-titration-curve.png hope you can help me, and yes when its possible, if you know something like a tutorial then i would be glad if you could post it. with regards Hi, I think do you need use drc package: drc: Analysis of dose-response curves Analysis of one or multiple curves with focus on concentration-response, dose-response and time-response curves used, for example in biology, environmental sciences, medicine, pharmacology, toxicology. -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ 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 Subpopulation data?
On Thu, 2009-10-01 at 10:06 +, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe str=strata(sampleframe,c(type),size=c(20,), method=srswor) Try using str=strata(sampleframe,c(type),size=20, method=srswor) or better str - strata(sampleframe,c(type),size=20, method=srswor) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ 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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender
By now It seems nobody have idea. zz - gzfile(C:/gzpdftest.gz, wb) pdf(file = zz) plot(USArrests) dev.off() close(zz) produce a file named 3 without any extension in my working directory. Also I don't have any news on how to gzip the pdf afterward (without using an external executable). Daniele From: Rainer M Krug [mailto:r.m.k...@gmail.com] Sent: 30 September 2009 10:26 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender 2009/9/30 Daniele Amberti daniele.ambe...@ors.itmailto:daniele.ambe...@ors.it I have not found an easy way to compress a file on filesystem. Especially I'd like to compress a pdf from pdf() function/device. Is it possible to compress It on the flight? I'd like to do something like: pdf(gzipconnection()) dev.off() I guess this boils down to a question I asked some time ago concerning getting the filename of a pdf() device, as I wanted to create a compressed pdf from the uncompressed pdf created by R (not zipping the pdf). It does not seem to be possible, at least I did not get any response which I could use to implement my idea (create my dev.off(), which calls dev.off() and afterwards compresses the pdf by using the file name). If you find a solution, please let me know. Cheers, Rainer If It is not possible, how can I create a gzip with the pdf? Thanks Daniele A. ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site www.ors.it Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati ? vietato e potrebbe costituire reato. Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se provvedesse alla distruzione dello stesso e degli eventuali allegati. Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non siano relative alle attivit? e/o alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla societ? stessa, n? la impegnano in alcun modo. [[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] How to use Subpopulation data?
Thanks i know, i was just simplying since i have a bigger set, But the problem is not that.The problem is i have a sampled data and i need to use the results but when i only get the population results. How do i get the legnths,summary,etc of my sampled data not the population? --- On Thu, 1/10/09, Bernardo Rangel Tura t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r-project.org Date: Thursday, 1 October, 2009, 11:24 AM On Thu, 2009-10-01 at 10:06 +, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe str=strata(sampleframe,c(type),size=c(20,), method=srswor) Try using str=strata(sampleframe,c(type),size=20, method=srswor) or better str - strata(sampleframe,c(type),size=20, method=srswor) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil [[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] set package: more information about syntax
Dear All! I have a few question about proper syntax for fuzzy rules in sets package (there is only little help about it): 1) how to use negation (NOT) operator there is only OR (||) in example it is NOT, !!, !. I also assume that AND is 2) where it can be set. For example: area %is NOT% large area %is% NOT large area %is% !large etc... 3) how brackets works (as in typical logical operation, are allowed - some expert system do not allow use brackets) Is proper following syntax? (slope %is% flat elevation %is% is high) || area %is% large, form %is% plateau Where I can find more information about syntax rules used in that (fantastic!) package, except in Generalised and Customisable Sets in R where is nothing about rules. Maybe rules comes from other, more general rule syntax, if yes,I would be grateful for the source thanks and greetings Jarek __ 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] question
hi I am going to crazy.I want to use beadarray package in R, but I cant. when I want install it, I encounter to this message Loading required package: hwriter Loading required package: sma Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : 'sma' is not a valid installed package I cant find sma and hwriter packages, it seems that they are not anymore. could you help me plz? thanks in advance Paylakhi [[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] Nested Anova and type II sum of square
Dear R-users, Iâd like to make a nested anova on my data, and since Iâm discovering both R and statistic, Iâd like to be sure that Iâm not doing something stupid. Here is my data: Iâve measured some variable responses (Y, for example leaf size) for different plants grown on three differing conditions (A, B and C). These plants come from two different species (sp1 and sp2) and within each species, two to three varieties were tested (var1 and var2 within sp1 and var3 to var5 within sp2). Finally Iâve got of course three replicates for each condition*plant combinations and Iâve got another factor (month) that corresponds to the âblockâ effect. Thus, my data looks like that:  month-c(jun,aug,nov,mar,sep,dec,mar,apr,jul,feb,apr,aug,feb,jun,jul,mar,sep,dec,mar,aug,oct,may,aug,dec,feb,may,nov,feb,apr,oct,may,jul,oct,feb,jun,aug,mar,jun,sep,mar,jun,jul,may,sep,nov) condition-c(rep(A,15),rep(B,15),rep(C,15)) species-c(rep(sp1,6),rep(sp2,9),rep(sp1,6),rep(sp2,9),rep(sp1,6),rep(sp2,9)) variety-c(rep(var1,3),rep(var2,3),rep(var3,3),rep(var4,3),rep(var5,3),rep(var1,3),rep(var2,3),rep(var3,3),rep(var4,3),rep(var5,3),rep(var1,3),rep(var2,3),rep(var3,3),rep(var4,3),rep(var5,3)) leafsize-c(12.952971,14.183247,14.894708,12.623053,11.053027,14.062297,5.974159,5.273493,7.450258,6.030390,6.412735,6.867507,6.227527,7.153695,6.414014,19.856307,21.966194,21.445263,18.100480,17.887656,17.90,11.355896,12.246672,11.462910,12.484537,11.742058,11.937823,16.838480,15.412491,17.789735,11.660008,12.355745,12.963518,10.629601,11.781656,10.693390,5.637602,6.181518,6.853488,8.136201,9.224135,8.309939,10.938328,11.070514,10.965592) exple-data.frame(cbind(month,condition,species,variety,leafsize)) exple[,5]-leafsize exple  Iâd like to estimate the effects of these different factors (condition, species, variety within species, interaction between condition*species, interaction between condition*variety within species and finally month) on my variable response, that is to say : Y=condition + species + variety(species) + condition*species + condition* variety(species) + month + residual The anova I wrote is the following: anova(lm(leafsize~condition*(species/variety)+month,data=exple)) Iâve noticed that, depending on the order of my factors in my formula, the anova result varies, for example: anova(lm(leafsize~month+condition*(species/variety),data=exple)) gives slightly different results. If I understood well, this is because anova() calculate type 1 sum of square. Thus, I would like to calculate type II, and I tried Anova() within car package: library(car) Anova( lm(leafsize~month+condition*(species/variety),data=exple)) I get the following error : âOne or more terms aliased in modelâ. While if I remove the nested factor, the anova with type II works, for example: Anova( lm(leafsize~month+condition*variety,data=exple))  My questions are: 1-     Is my nested anova model pertinent (ie does it actually estimate the effect of the factors as I hope it does?) 2-     Why canât I realize my nested anova with type II sum of square?  I apologize if my knowledge of statistics is so weak that Iâve make or ask something stupid⦠Many thanks in advance for time and consideration. Olga [[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] debugging S4 methods
Hi all, Does anyone know how to debug S4 methods? In my case I want to find an error in the specc-function of the kernlab-package. As this seems to be a S4-method the normal S3 debugging can't be applied apparently (e.g. debug(s3function.someclass)). So in my case debug(specc:kernlab) seems only to debug the generic-function: specc:kernlab function (x, ...) standardGeneric(specc) environment: 0x9088080 which doesn't help me. Does anyone know how to debug the real-code? Thanks for your help! Sebastian __ 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] debugging S4 methods
On 01/10/2009 7:02 AM, sebastian mueller wrote: Hi all, Does anyone know how to debug S4 methods? In my case I want to find an error in the specc-function of the kernlab-package. As this seems to be a S4-method the normal S3 debugging can't be applied apparently (e.g. debug(s3function.someclass)). So in my case debug(specc:kernlab) seems only to debug the generic-function: specc:kernlab function (x, ...) standardGeneric(specc) environment: 0x9088080 which doesn't help me. Does anyone know how to debug the real-code? You can insert a call to browser() if you want to modify the source. If you'd rather not do that, you can use trace() to set a breakpoint in it. The new setBreakpoint() function in R 2.10.0 will also work, if you install the package from source with the R_KEEP_PKG_SOURCE=yes environment variable set. It allows you to set a breakpoint at a particular line number in the source code. Duncan Murdoch __ 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] Calculating estimates from a sample
Dear Helpers I have a simulated sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters.For example i need to get the summary,length,std.error,etc. this is just a simplified example. H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe str=strata(sampleframe,c(type),size=c(20,), method=srswor) sample.strat-getdata(sampleframe,str) sample.strat length(H) i get: length(H) [1] 100 Desire to get: length(H) [1] 20 Best Regards [[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] How to use Subpopulation data?
I assume that you are using package:sampling? (Perhaps it wouldn't be too much trouble to include that information with your query.) Read ?strata and pay attention to the 'Value' section. This will tell you that the function returns a variable ID_unit - the identifier of the selected units Use this to process your samples; e.g. idx - str$ID_unit mysample - sampleframe[idx,] etc. ps Another way to see what's in 'str' is to use the str() *function*. str(str) And, as someone will surely mention, would you call your dog 'dog'? I.e. bad choice of object name. -Peter Ehlers KABELI MEFANE wrote: Thanks i know, i was just simplying since i have a bigger set, But the problem is not that.The problem is i have a sampled data and i need to use the results but when i only get the population results. How do i get the legnths,summary,etc of my sampled data not the population? --- On Thu, 1/10/09, Bernardo Rangel Tura t...@centroin.com.br wrote: From: Bernardo Rangel Tura t...@centroin.com.br Subject: Re: [R] How to use Subpopulation data? To: KABELI MEFANE kabelimef...@yahoo.co.uk Cc: R-help@r-project.org Date: Thursday, 1 October, 2009, 11:24 AM On Thu, 2009-10-01 at 10:06 +, KABELI MEFANE wrote: Dear Helpers I have a sample frame and i have sampled from it using three methods and now i want to calculate the statistics but i only get the population parameters. H - matrix(rnorm(100, mean=5, sd=5000)) sampleframe=data.frame(type=c(rep(H,100)),value=c(H)) sampleframe str=strata(sampleframe,c(type),size=c(20,), method=srswor) Try using str=strata(sampleframe,c(type),size=20, method=srswor) or better str - strata(sampleframe,c(type),size=20, method=srswor) __ 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] Condition to factor (easy to remember)
Douglas Bates-2 wrote: On Wed, Sep 30, 2009 at 2:42 PM, Douglas Bates ba...@stat.wisc.edu wrote: And besides, Frank Harrell will soon be weighing in to tell you why you shouldn't dichotomize in the first place. Subjects in this study received a 20 ml infusion of Kirsch (40%, Swiss Brand) at t=10 minutes, therefore the second interval should read Prost instead of Post. Even Frank would admit this is a valid dichotomization. Dieter -- View this message in context: http://www.nabble.com/Condition-to-factor-%28easy-to-remember%29-tp25676411p25696647.html 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] Huge matrix: allocation works but assignment fails
Hello everyone, I am working with one big matrix: w=matrix(0,18000,18000) on a Linux computer with 16Go of RAM. I can actually create the matrix, and even access elements: w[10,10] 0 but if I try to change one element, it fails: w[10,10]=1 Erreur : impossible d'allouer un vecteur de taille 2531250 Ko (Failed to allocate a vector of size...) What can I do? And, maybe even more important, how can one explains such a behavior? Thank you for any help/advice Rémi Proville. __ 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] GAM question
Hello evyrone, I would be grateful if you could help me in (I hope) simple problem. I fit a gam model (from mgcv package) with several smooth functions . I don't know how to extract values of just one smooth function. Can you please help me in this? Kind regards, Daniel Rabczenko __ 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] creating R roll in Centos OS
On Oct 1, 2009, at 2:44 AM, Sukhbir Rattan wrote: Hi I have Centos Operating System. I m installing R on it. For this I have to create roll of R. So, how to create the roll of R, regarding this what to be downloaded and from where? Plz help. By Sukhbir Singh Rattan. If by roll, you are referring to an RPM, they are available via the EPEL, which is a repository that provides RPMs for RHEL and CentOS. More information is here: https://fedoraproject.org/wiki/EPEL There are instructions for configuring your system to use the EPEL (via 'yum') and how to download and install RPMs from it. Once you get the EPEL configured on your system, you can install R by using: sudo yum install R HTH, Marc Schwartz __ 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] re ading and analyzing a word document
On Oct 1, 2009, at 12:18 AM, cls59 wrote PDXRugger wrote: Considering your instructions: #Define words to find to.find - c( 'the', 'is', 'are' ,'dr') #Read in the file... file.text - readLines( 'data/letter.txt' ) #Count number of occurnces of deined word in text line.matches - unlist( lapply( to.find, grep, x = unlist(file.text[2]) ) ) Result: line.matches [1] 1 1 1 This is not right of course as there are actually four words and secondly becasue the searched words appear multiple times. The example I gave was only meant to identify those lines on which matches occurred. Using x = unlist(file.text[2]) only feeds one line of the file into the matching routine so the result indicates that all the matches were on line 1-- the only line present for searching. If you want to count the individual occurrences of the words on each line, you may need to look at using a function such as gregexpr. grep only indicates if a match or matches is present in a line of text-- gregexpr indicates at which positions those matches occur in the line. However, you may be getting to the point with this where R is no longer an appropriate tool for this job. R is amazingly flexible it is possible that it can give you what you want. However, R was not designed to perform text processing-- Perl comes to mind as being a language that was explicitly designed to perform these sorts of operations. Perhaps you should use the R-search facilities for such questions: http://finzi.psych.upenn.edu/R/library/tau/html/00Index.html http://finzi.psych.upenn.edu/views/NaturalLanguageProcessing.html http://www.jstatsoft.org/v25/i05/ R may not have been designed for text processing, but it is rather amazing how much has been done. -- David Winsemius, MD Heritage Laboratories West Hartford, CT __ 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] question
On Oct 1, 2009, at 4:33 AM, hassan paylakhi wrote: hi I am going to crazy.I want to use beadarray package in R, but I cant. when I want install it, I encounter to this message Loading required package: hwriter Loading required package: sma Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : 'sma' is not a valid installed package I cant find sma and hwriter packages, it seems that they are not anymore. could you help me plz? Binary versions of sma and hwriter can be found on your CRAN repository. How they get installed may depend to some extent on which repository you use and your OS (which you have not offered). ?install.packages -- David Winsemius, MD Heritage Laboratories West Hartford, CT __ 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] re ad.delim skips first column (why?)
I can't determine what is going on in you example, but my approach would be to read the text file into a text editor that will display hidden characters (tab, etc.) so you can see the pattern. It could be that there is an extra tab in some locations. You could then use the editor's replace function to remove the control characters that are causing the problem. Giovanni Dall'Olio wrote: Hi people, I have a text file like this one posted: When I use read.delim (or any read function) on it, R skips the first column, and I don' understand why. -- View this message in context: http://www.nabble.com/read.delim-skips-first-column-%28why-%29-tp24466023p25696875.html 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.
Re: [R] How to use Subpopulation data?
Thanks i was not aware of str, i have a very large code since i am new to r. I forgot to mention that the package is sampling. Actually i have this simulated code: n - c(100,400,1000,1500,2000) x - c(2,3,3,3,5) y - c(7,7,9,10,10) s - function(mn, mx, n) {sample(mn:mx, n, replace=TRUE)} rating=unlist(mapply(s, x, y, n)) Hypermarket - matrix(rnorm(100, mean=5, sd=5000)) Supermarket - matrix(rnorm(400, mean=34000, sd=3000)) Minimarket - matrix(rnorm(1000, mean=1,sd=2000)) Cornershop - matrix(rnorm(1500, mean=2500, sd=500)) Spazashop - matrix(rnorm(2000, mean=1000, sd=250)) dat=data.frame(type=c(rep(Hypermarket,100), rep(Supermarket,400), rep(Minimarket,1000),rep(Cornershop,1500), rep(Spazashop,2000)), value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop)) ##sample frame sampleframe=data.frame(type=c(rep(Hypermarket,100), rep(Supermarket,400), rep(Minimarket,1000),rep(Cornershop,1500), rep(Spazashop,2000)), value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop), ratings =cbind(rating)) ## package sampling stra=strata(sampleframe,c(type,value,rating),size=c(20,80,200,300,400), method=srswor) sample.strat-getdata(sampleframe,stra) sample.strat now i want to find different estimates from sample.strat Help appreciated. [[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 for 3D Plotting Data on 'Irregular' Grid
Dear All, Here is what I am trying to achieve: I would like to plot some data in 3D. Usually, one has a matrix of the kind y_1(x_1) , y_1(x_2).y_1(x_i) y_2(x_1) , y_2(x_2).y_2(x_i) ... y_n(x_1) , y_n(x_2)..y_n(x_i) where e.g. y_2(x_1) is the value of y at time 2 at point x_1 (see that the grid in x is the same for the y values at all times). Instead, in my case, the quantity y is observed at each time on a different grid in x; in other words not only do I have a different number of observations (y values) at each time, but I also have observations taken on a a different x grid each time. As a matter of fact, it is as if I had a set of independent observations, for each of which I can create effortlessly a 2D plot, that I want to stitch together into a 3D plot. I have no idea of how to achieve that. Examples I have found with lattice or scatterplot3D all assume a regular grid like the one I described above. Any help is really appreciated. Many thanks Lorenzo __ 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] Treating variables as symbols
Hey, I'm trying to find how to perform operations with a variable treated as a symbol. For, an extremely simple, example I want to integrate a*x with respect to x and I want to find the indefinite integral of this, (a*x^2/2), or the definite integral with some interval for x. Another example of such a use would be to create a function y-function(x) {a*x} and by typig y(2) I would get the result 2*a Is there a way to treat variables as merely symbols? Any help much appreciated -M [[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] Treating variables as symbols
Hi Zemajik, Try this: y - function(a) paste(a, '*x', sep=) y(2) [1] 2*x Also, take a look at the Ryacas package. HTH, Jorge On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik wrote: Hey, I'm trying to find how to perform operations with a variable treated as a symbol. For, an extremely simple, example I want to integrate a*x with respect to x and I want to find the indefinite integral of this, (a*x^2/2), or the definite integral with some interval for x. Another example of such a use would be to create a function y-function(x) {a*x} and by typig y(2) I would get the result 2*a Is there a way to treat variables as merely symbols? Any help much appreciated -M [[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] pass ... to multiple sub-functions
Dear Baptiste, I know I have seen this discussed before but I haven't been successful in searching for ellipsis, dots, ... in the archives. I would like to filter ... arguments according to their name, and dispatch them to two sub-functions, say fun1 and fun2. I looked at lm() but it seemed more complicated than I need as it modifies the calling function among other things. What is the best approach for this? My current version presented below seems very awkward. Best regards, baptiste sessionInfo() R version 2.9.2 (2009-08-24) i386-apple-darwin8.11.1 fun1 - function(col, row){ print(col) print(row) } fun2 - function(x){ print(x) } foo - function(..., lty=1){ dots - list(...) cl - match.call() col - eval.parent(cl$col) row - eval.parent(cl$row) params.fun1 - c(col, row) removed - na.omit(match(names(cl), params.fun1)) # index whichever arguments were passed to fun1 fun1(col, row) fun2(dots[seq_along(dots)[-removed]]) Instead of passing all remaining arguments stacked into one list (= 1 argument x to function fun2) you might want to be able to retain them as distinct arguments; so you might want to replace fun2 by fun2.a - function(...) print(list(...)) and the call to fun2 in foo by do.call(fun2.a, dots.remaining) where, sticking to your code, you could obtain dots.remaining as removed - na.omit(match(names(cl), params.fun1)) dots.remaining - dots[seq_along(dots)[-removed]] or by removed - c(lty,params.fun1) ## I assume you do not want to pass on argument lty... dots.remaining - cl[-1] ### remove the function name dots.remaining - dots.remaining[! names(dots.remaining) %in% removed] Best, 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.
Re: [R] Treating variables as symbols
Try this: y - function(a) substitute(a * x, list(a = a)) On Thu, Oct 1, 2009 at 10:46 AM, ZeMajik zema...@gmail.com wrote: Hey, I'm trying to find how to perform operations with a variable treated as a symbol. For, an extremely simple, example I want to integrate a*x with respect to x and I want to find the indefinite integral of this, (a*x^2/2), or the definite integral with some interval for x. Another example of such a use would be to create a function y-function(x) {a*x} and by typig y(2) I would get the result 2*a Is there a way to treat variables as merely symbols? Any help much appreciated -M [[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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O __ 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] set package: more information about syntax
Dear All! I have a few question about proper syntax for fuzzy rules in sets package (there is only little help about it): 1) how to use negation (NOT) operator there is only OR (||) in example it is NOT, !!, !. I also assume that AND is 2) where it can be set. For example: area %is NOT% large area %is% NOT large area %is% !large etc... 3) how brackets works (as in typical logical operation, are allowed - some expert system do not allow use brackets) Is proper following syntax? (slope %is% flat elevation %is% is high) || area %is% large, form %is% plateau Where I can find more information about syntax rules used in that (fantastic!) package, except in Generalised and Customisable Sets in R where is nothing about rules. Maybe rules comes from other, more general rule syntax, if yes,I would be grateful for the source thanks and greetings Jarek __ 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. I add this question because I cannot form any proper rule when I use ! (negation) or I use more complex rules rules with brackets I always receive: Error in gset_charfun(x) : Argument 'x' must be a generalized set. in fact function fuzzy_inferance works only if I use maximum two arguments rules without brackets. Jarek __ 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] typo in install manual
http://cran.r-project.org/doc/manuals/R-admin.pdf page 8 and page 13 testInstallPackages(recommended) - testInstalledPackages(recommended) same problem in .html -- CTM Clinical Trials Management GmbH Mariahilferstraße 47/III/3/5 1060 Vienna, Austria Phone: +43 (0) 1 / 585 80 63 Fax: +43 (0) 1 / 585 79 67 E-mail: d.de...@clinicaltrials.at Homepage: www.clinicaltrials.at __ 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] (no subject)
Hi, Does anyone know where the following package is available: Holleczek B, Gondos A, Brenner H. PeriodR - an R package to calculate long term survival estimates using period analysis. Methods of Information in Medicine 2009; 48: 123-128. Thanks Jens Oehlschlägel -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! __ 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 formatted character from call
Hi, I need to get a character vector from an object of class call. But using as.character() returns something based on the internal structure of the object, and not, as I would like, some akin to the output of show() on a call object. Any idea on how to obtain the same output returned by show? Thanks, Iago Mosqueira __ 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] question
hassan paylakhi wrote: hi I am going to crazy.I want to use beadarray package in R, but I cant. when I want install it, I encounter to this message Loading required package: hwriter Loading required package: sma Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : 'sma' is not a valid installed package I cant find sma and hwriter packages, it seems that they are not anymore. could you help me plz? Hi Hassan -- The sma author no longer wishes to maintain this package, and beadarray depends on sma. The workaround is to manually install sma from its archive: download http://cran.fhcrc.org/src/contrib/Archive/sma/sma_0.5.15.tar.gz and install.packages(sma_0.5.15.tar.gz, repos=NULL). beadarray is a Bioconductor packages, so please follow up on the Bioconductor mailing list http://bioconductor.org/docs/mailList.html Martin thanks in advance Paylakhi [[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. -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793 __ 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] The problem of readLines
Dear R-users, I use readLines to read data, but when processing the large data set, there are few files which can not be readed in: 48: In readLines(name_c[i]) ... : incomplete final line found on 'C:/Documents and Settings/lma/My Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt' ... Whats the problem about this? Regards, Tammy _ More than messagescheck out the rest of the Windows Live. http://www.microsoft.com/windows/windowslive/ [[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] Maintaining sort order when transpose
Hi all - I have a data frame and have sorted it by a particular column, with rownames set to a different variable. I wish to transpose this data frame, naming columns by the rowname variable but maintaining the sorted order through to the order of columns in my transposed table, however use of t(DF) results in a transposed table where the columns are ordered alphabetically by the original rownames. Any ideas how I can get around this? -- AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}} __ 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] Color of graph
I am trying to plot a line graph for 3 or more regression lines abline(m1) abline(m2) abline(m3) Can I change the color of each line? if so how? Thanks in advance Ashta [[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] Evaluating expresssions as parameter values
Let us walk through my problem step by step: 1. print(xyplot(yield ~ variety | site,groups=year,data=barley)) 2. print(xyplot(as.formula(yield ~ variety | site),groups=year,data=barley)) The above two statements work, the next one does not work 3. print(xyplot(as.formula(yield ~ variety | site),groups=parse (text=year),data=barley)) But the following one works 4. arglist-list(as.formula(yield ~ variety | site),groups=parse (text=year),data=barley) print(do.call(xyplot,arglist)) why does 3 not work and 4 work? Is there a way of coercing the string year into something which can directly be used in 3 as the argument used with groups= ??? The next one print(xyplot(as.formula(yield ~ variety | site),groups=eval(parse (text=year)),data=barley)) also works, but in this case the groups expression is evaluated before xyplot is applied, and I think this is bad style (at least, if not worse). On Sep 30, 2009, at 1:20 PM, Deepayan Sarkar wrote: xyplot(Sepal.Length ~ Petal.Length, iris, groups = ~Species) __ 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] The problem of readLines
From the help page for readLines: If the final line is incomplete (no final EOL marker) the behaviour depends on whether the connection is blocking or not. For a non-blocking text-mode connection the incomplete line is pushed back, silently. For all other connections the line will be accepted, with a warning. You can disable the warning with; readLines('your_file', warn = FALSE) On Thu, Oct 1, 2009 at 9:39 AM, Tammy Ma metal_lical...@live.com wrote: Dear R-users, I use readLines to read data, but when processing the large data set, there are few files which can not be readed in: 48: In readLines(name_c[i]) ... : incomplete final line found on 'C:/Documents and Settings/lma/My Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt' ... Whats the problem about this? Regards, Tammy _ More than messages–check out the rest of the Windows Live™. http://www.microsoft.com/windows/windowslive/ [[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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O __ 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] (no subject)
Hi Jens, Take a look at http://www.krebsregister.saarland.de/improve/periodR_en.html HTH, Jorge 2009/10/1 Jens Oehlschlägel Hi, Does anyone know where the following package is available: Holleczek B, Gondos A, Brenner H. PeriodR - an R package to calculate long term survival estimates using period analysis. Methods of Information in Medicine 2009; 48: 123-128. Thanks Jens Oehlschlägel -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! __ 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] Getting formatted character from call
Please read the last line to every message to r-help. There is no reproducible code in your post. Anyways, it works for me: class(call(round, 1.5)) [1] call as.character(call(round, 1.5)) [1] round 1.5 format(call(round, 1.5)) [1] round(1.5) On Thu, Oct 1, 2009 at 7:58 AM, Iago Mosqueira iago.mosque...@gmail.com wrote: Hi, I need to get a character vector from an object of class call. But using as.character() returns something based on the internal structure of the object, and not, as I would like, some akin to the output of show() on a call object. Any idea on how to obtain the same output returned by show? Thanks, Iago Mosqueira __ 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] (no subject)
Actually that is stated in paper abstract: http://www.krebsregister.saarland.de/improve/periodR_en.html Andris 2009/10/1 Jens Oehlschlägel oehl_l...@gmx.de: Hi, Does anyone know where the following package is available: Holleczek B, Gondos A, Brenner H. PeriodR - an R package to calculate long term survival estimates using period analysis. Methods of Information in Medicine 2009; 48: 123-128. Thanks Jens Oehlschlägel -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! __ 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] Color of graph
Try this: abline(m1, col = 'blue') abline(m1, col = 'red') abline(m1, col = 'green') On Thu, Oct 1, 2009 at 10:57 AM, Ashta sewa...@gmail.com wrote: I am trying to plot a line graph for 3 or more regression lines abline(m1) abline(m2) abline(m3) Can I change the color of each line? if so how? Thanks in advance Ashta [[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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O __ 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] Color of graph
abline(m1, col=red) regards, Stefan On Thu, Oct 01, 2009 at 09:57:11AM -0400, Ashta wrote: I am trying to plot a line graph for 3 or more regression lines abline(m1) abline(m2) abline(m3) Can I change the color of each line? if so how? Thanks in advance Ashta [[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] Color of graph
On Thu, Oct 1, 2009 at 6:57 AM, Ashta sewa...@gmail.com wrote: I am trying to plot a line graph for 3 or more regression lines abline(m1) abline(m2) abline(m3) Can I change the color of each line? if so how? Thanks in advance Ashta Try passing the 'col' parameter to abline: abline( m1, col = 'red' ) ablime( m1, col = 'blue' ) abline( m1, col = 'purple' ) See ?par for other plot parameters like col that can be set this way. ?rgb gives an example of setting color by RGB value. Other specifications such as HSV are possible. The colors() function will show a list of all built colors that may be specified using a string such as 'red' . ?rainbow will show information concerning built in functions for generating color palettes. The RColorBrewer package also contains some great palettes. Also, a help search such as: ??'colors' Will turn up all kinds of other functions that may deal with setting or creating colors. Hope this helps! -Charlie [[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] Color of graph
Hi Ashta, See the ... in ?abline. HTH, Jorge On Thu, Oct 1, 2009 at 9:57 AM, Ashta wrote: I am trying to plot a line graph for 3 or more regression lines abline(m1) abline(m2) abline(m3) Can I change the color of each line? if so how? Thanks in advance Ashta [[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] re ading and analyzing a word document
library(sos) tm - findFn('text mining') tm This produced 15 matches, which you could also find using RSiteSearch('text mining', 'function'). The difference is that findFn{sos} displays the results in a table sorted to place the package with the most matches first. In this case, there is actually a Text Mining Package called tm. summary(tm) says these 15 matches are in 11 packages. The first of the 11 is FactoMineR. Hope this helps. Spencer Graves David Winsemius wrote: On Oct 1, 2009, at 12:18 AM, cls59 wrote PDXRugger wrote: Considering your instructions: #Define words to find to.find - c( 'the', 'is', 'are' ,'dr') #Read in the file... file.text - readLines( 'data/letter.txt' ) #Count number of occurnces of deined word in text line.matches - unlist( lapply( to.find, grep, x = unlist(file.text[2]) ) ) Result: line.matches [1] 1 1 1 This is not right of course as there are actually four words and secondly becasue the searched words appear multiple times. The example I gave was only meant to identify those lines on which matches occurred. Using x = unlist(file.text[2]) only feeds one line of the file into the matching routine so the result indicates that all the matches were on line 1-- the only line present for searching. If you want to count the individual occurrences of the words on each line, you may need to look at using a function such as gregexpr. grep only indicates if a match or matches is present in a line of text-- gregexpr indicates at which positions those matches occur in the line. However, you may be getting to the point with this where R is no longer an appropriate tool for this job. R is amazingly flexible it is possible that it can give you what you want. However, R was not designed to perform text processing-- Perl comes to mind as being a language that was explicitly designed to perform these sorts of operations. Perhaps you should use the R-search facilities for such questions: http://finzi.psych.upenn.edu/R/library/tau/html/00Index.html http://finzi.psych.upenn.edu/views/NaturalLanguageProcessing.html http://www.jstatsoft.org/v25/i05/ R may not have been designed for text processing, but it is rather amazing how much has been done. -- Spencer Graves, PE, PhD President and Chief Operating Officer Structure Inspection and Monitoring, Inc. 751 Emerson Ct. San José, CA 95126 ph: 408-655-4567 __ 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] package:snow, timeOut for makeSOCKcluster()
Dear snow users, is there any way to specify a max time after which makeSOCKcluster() stops trying to create socket connections and gives up/returns ? In my current setup (MAC OSX 10.5.8, R version 2.9) I have to force quit R if the host specified in makeSOCKcluster() either does not exist or does not respond. On Linux, I can at least manually interrupt the function via Ctrl-C Any help would be greatly appreciated, Thanks, Markus [[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] GAM question
Hi Daniel, I presume you mean coefficients by values. Try ?gamObject and read the info in the help file. A GAM object (returned by the function gam() ) contains an element coefficients that is easily accessible. That one contains all estimated coefficients, including those for the smooth functions. On Thu, Oct 1, 2009 at 1:49 PM, Daniel Rabczenko dan...@medstat.waw.pl wrote: Hello evyrone, I would be grateful if you could help me in (I hope) simple problem. I fit a gam model (from mgcv package) with several smooth functions . I don't know how to extract values of just one smooth function. Can you please help me in this? Kind regards, Daniel Rabczenko __ 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] typo in install manual
On 10/1/2009 5:37 AM, Daniel Dekic wrote: http://cran.r-project.org/doc/manuals/R-admin.pdf page 8 and page 13 testInstallPackages(recommended) - testInstalledPackages(recommended) Thanks, will fix. Duncan Murdoch __ 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] cdplot????
I am having difficulties interpreting a cdplot, I have a binary variable y that I want to cdplot against a continuous variable x,below is the R command cdplot(y~x, data=mydata) you get a plot with a dark shaded area and a light shaded area. what do these areas mean? and how to interpret the plot? you help is greatly appreciated -- View this message in context: http://www.nabble.com/cdplot-tp25696905p25696905.html 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.
Re: [R] Maintaining sort order when transpose
An example would be helpful, but if I understand correctly, can't you do something like TDF=t(DF) TDF=TDF[,rownames(DF)] Kevin Wright On Thu, Oct 1, 2009 at 9:04 AM, Dry, Jonathan R jonathan@astrazeneca.com wrote: Hi all - I have a data frame and have sorted it by a particular column, with rownames set to a different variable. I wish to transpose this data frame, naming columns by the rowname variable but maintaining the sorted order through to the order of columns in my transposed table, however use of t(DF) results in a transposed table where the columns are ordered alphabetically by the original rownames. Any ideas how I can get around this? -- AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}} __ 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] Debug
From: metal_lical...@live.com To: r-help@r-project.org Subject: Debug Date: Thu, 1 Oct 2009 15:21:42 +0300 Hi, R-Users,' I have written a programe to process the bunch of files in one folder. But there is a error came out; How can I know which file returns error when being processed? I have tested the first 1-10th files, no any problem. But the problems is I have more than 500 files. How can I know which file has the problem? Thanks Tammy Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! Try it! _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us [[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] Treating variables as symbols
Thanks guys, Ryacas is pretty much what I'm looking for!However, I can't seem to get it to work properly. For example: yacas(Integrate(x) x) Error in parse(text = text, srcfile = NULL) : unexpected numeric constant in / (^ (x ,2 2 Same thing with expressions such as yacas(x*x) However yacas(2*2) expression(4) So it seems there is a successful connection between yacas and R. I didn't find any info on the problem by googling it unfortunately! Any ideas what it might be? Thanks again, M On Thu, Oct 1, 2009 at 3:50 PM, Jorge Ivan Velez jorgeivanve...@gmail.comwrote: Hi Zemajik, Try this: y - function(a) paste(a, '*x', sep=) y(2) [1] 2*x Also, take a look at the Ryacas package. HTH, Jorge On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik wrote: Hey, I'm trying to find how to perform operations with a variable treated as a symbol. For, an extremely simple, example I want to integrate a*x with respect to x and I want to find the indefinite integral of this, (a*x^2/2), or the definite integral with some interval for x. Another example of such a use would be to create a function y-function(x) {a*x} and by typig y(2) I would get the result 2*a Is there a way to treat variables as merely symbols? Any help much appreciated -M [[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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender
I guess I don't understand what your're trying to do. gzip-ing a file from within R is easy enough: pdf(file=CompressMe.pdf) plot(rnorm(100)) dev.off() system(gzip CompressMe.pdf) I think you want something more complicated, but I'm not sure what. -Ista On Thu, Oct 1, 2009 at 6:41 AM, Daniele Amberti daniele.ambe...@ors.it wrote: By now It seems nobody have idea. zz - gzfile(C:/gzpdftest.gz, wb) pdf(file = zz) plot(USArrests) dev.off() close(zz) produce a file named 3 without any extension in my working directory. Also I don't have any news on how to gzip the pdf afterward (without using an external executable). Daniele From: Rainer M Krug [mailto:r.m.k...@gmail.com] Sent: 30 September 2009 10:26 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender 2009/9/30 Daniele Amberti daniele.ambe...@ors.itmailto:daniele.ambe...@ors.it I have not found an easy way to compress a file on filesystem. Especially I'd like to compress a pdf from pdf() function/device. Is it possible to compress It on the flight? I'd like to do something like: pdf(gzipconnection()) dev.off() I guess this boils down to a question I asked some time ago concerning getting the filename of a pdf() device, as I wanted to create a compressed pdf from the uncompressed pdf created by R (not zipping the pdf). It does not seem to be possible, at least I did not get any response which I could use to implement my idea (create my dev.off(), which calls dev.off() and afterwards compresses the pdf by using the file name). If you find a solution, please let me know. Cheers, Rainer If It is not possible, how can I create a gzip with the pdf? Thanks Daniele A. ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site www.ors.it Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati ? vietato e potrebbe costituire reato. Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se provvedesse alla distruzione dello stesso e degli eventuali allegati. Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non siano relative alle attivit? e/o alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla societ? stessa, n? la impegnano in alcun modo. [[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. -- Ista Zahn Graduate student University of Rochester http://yourpsyche.org __ 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] Treating variables as symbols
Read the troubleshooting section on the home page: http://ryacas.googlecode.com Note, in particular, that it currently only works with an older version of the XML package. library(Ryacas) packageDescription(XML)$Version [1] 1.96-0 x - Sym(x) Integrate(x*x, x) [1] Starting Yacas! expression(x^3/3) On Thu, Oct 1, 2009 at 11:08 AM, ZeMajik zema...@gmail.com wrote: Thanks guys, Ryacas is pretty much what I'm looking for!However, I can't seem to get it to work properly. For example: yacas(Integrate(x) x) Error in parse(text = text, srcfile = NULL) : unexpected numeric constant in / (^ (x ,2 2 Same thing with expressions such as yacas(x*x) However yacas(2*2) expression(4) So it seems there is a successful connection between yacas and R. I didn't find any info on the problem by googling it unfortunately! Any ideas what it might be? Thanks again, M On Thu, Oct 1, 2009 at 3:50 PM, Jorge Ivan Velez jorgeivanve...@gmail.comwrote: Hi Zemajik, Try this: y - function(a) paste(a, '*x', sep=) y(2) [1] 2*x Also, take a look at the Ryacas package. HTH, Jorge On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik wrote: Hey, I'm trying to find how to perform operations with a variable treated as a symbol. For, an extremely simple, example I want to integrate a*x with respect to x and I want to find the indefinite integral of this, (a*x^2/2), or the definite integral with some interval for x. Another example of such a use would be to create a function y-function(x) {a*x} and by typig y(2) I would get the result 2*a Is there a way to treat variables as merely symbols? Any help much appreciated -M [[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. __ 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] Debug
Hi Tammy, On Oct 1, 2009, at 11:04 AM, Tammy Ma wrote: Hi, R-Users,' I have written a programe to process the bunch of files in one folder. But there is a error came out; How can I know which file returns error when being processed? I have tested the first 1-10th files, no any problem. But the problems is I have more than 500 files. How can I know which file has the problem? See ?tryCatch Here's some (untested) code that should give you an idea of what to do: which.files - dir(path=/directory/with/files, full.names=TRUE) for (file.name in which.files) { result - tryCatch(process.file(file.name), error=function(err) err) if (inherits(result, 'error')) { cat(File, file.name, is hosed\n) } } This assumes you have a function called 'process.file' that does what you want. If the function throws an error, it will be caught and stored in the result variable. In this case, the file.name will be written to your workspace. Instead of just printing to your workspace, you could consider storing the bad file names in a list and post-process later. Hope that helps, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender
system() invokes the OS command specified by command, in the example you gave it means that gzip is installed and (assuming Windows OS) it is in your search path. I'd like to have a solution that do not use external programs. Thanks Daniele -Original Message- From: Ista Zahn [mailto:istaz...@gmail.com] Sent: 01 October 2009 17:11 To: Daniele Amberti Cc: r-help@r-project.org; Rainer M Krug Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender I guess I don't understand what your're trying to do. gzip-ing a file from within R is easy enough: pdf(file=CompressMe.pdf) plot(rnorm(100)) dev.off() system(gzip CompressMe.pdf) I think you want something more complicated, but I'm not sure what. -Ista On Thu, Oct 1, 2009 at 6:41 AM, Daniele Amberti daniele.ambe...@ors.it wrote: By now It seems nobody have idea. zz - gzfile(C:/gzpdftest.gz, wb) pdf(file = zz) plot(USArrests) dev.off() close(zz) produce a file named 3 without any extension in my working directory. Also I don't have any news on how to gzip the pdf afterward (without using an external executable). Daniele From: Rainer M Krug [mailto:r.m.k...@gmail.com] Sent: 30 September 2009 10:26 To: Daniele Amberti Cc: r-help@r-project.org Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown sender 2009/9/30 Daniele Amberti daniele.ambe...@ors.itmailto:daniele.ambe...@ors.it I have not found an easy way to compress a file on filesystem. Especially I'd like to compress a pdf from pdf() function/device. Is it possible to compress It on the flight? I'd like to do something like: pdf(gzipconnection()) dev.off() I guess this boils down to a question I asked some time ago concerning getting the filename of a pdf() device, as I wanted to create a compressed pdf from the uncompressed pdf created by R (not zipping the pdf). It does not seem to be possible, at least I did not get any response which I could use to implement my idea (create my dev.off(), which calls dev.off() and afterwards compresses the pdf by using the file name). If you find a solution, please let me know. Cheers, Rainer If It is not possible, how can I create a gzip with the pdf? Thanks Daniele A. ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site www.ors.it Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati ? vietato e potrebbe costituire reato. Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se provvedesse alla distruzione dello stesso e degli eventuali allegati. Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non siano relative alle attivit? e/o alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla societ? stessa, n? la impegnano in alcun modo. [[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. -- Ista Zahn Graduate student University of Rochester http://yourpsyche.org ORS Srl Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy Tel. +39 0173 620211 Fax. +39 0173 620299 / +39 0173 433111 Web Site www.ors.it Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati è vietato e potrebbe costituire reato. Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se provvedesse alla distruzione dello stesso e degli eventuali allegati. Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non siano relative alle attività e/o alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla società stessa, né la impegnano in alcun modo. __ 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] Unable to install lme4
I am baffled by this as well. I'm having the same issue. Using suse linux, with 64 bit R2.8.1. Thanks, james Zege, Andrew wrote: I am unable to install package lme4, after several attempts to do so using various repository URLs. Just to make sure everything works fine with proxy, connection, etc, I installed ggplot2 and it worked fine. I am using command install.packages(lme4, lib=/myRlibs), optionally using contrib argument with different URLs. Error message the I get is Warning message; In install.packages(lme4, lib=/myRlibs) package 'lme4' is not available Some other details, not sure how relevant are: getOption(repos) returns http://lib.stat.cmu.edu/R/CRAN; I tried setting contrib to various other URL, such as http://cran.mtu.edu/src/contrib; or Berkeley URL, but with no success. Actually, when I did available.packages() on this repos, I didn't see lme4 in the package indices. My machine has x86_64bit RedHat Linux. Would appreciate any tips or directions, Thanks Andre __ 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. -- View this message in context: http://www.nabble.com/Unable-to-install--lme4-tp25514856p25697423.html 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.
Re: [R] cdplot????
On Thu, 1 Oct 2009, kayj wrote: I am having difficulties interpreting a cdplot, I have a binary variable y that I want to cdplot against a continuous variable x,below is the R command cdplot(y~x, data=mydata) you get a plot with a dark shaded area and a light shaded area. what do these areas mean? and how to interpret the plot? you help is greatly appreciated See ?cdplot. It's a display that graphs (an approximation of) P(y | x) against x. The areas above and below the line are simply shaded in different levels of gray. To obtain P(y | x), the idea is to use f(y | x) = f(x | y) * f(x)/f(y) where for f(x) and f(x | y) are obtained by (unconditional and conditional, respectively) kernel density smoothers from density(). f(y) is simply the unconditional proportion of the category y. hth, Z -- View this message in context: http://www.nabble.com/cdplot-tp25696905p25696905.html 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.
Re: [R] The problem of readLines
I have a more problem: Because there are few files which can't be read into R completely, so on the following subsequence programme, I use write.table, which creates the NA files for those incomplete files autimatically. I don't want those NA files. How can I do the following: whenever readLines can't completely read one file, then autimatically remove it from my dataset? Thanks. Tammy From: www...@gmail.com Date: Thu, 1 Oct 2009 11:06:35 -0300 Subject: Re: [R] The problem of readLines To: metal_lical...@live.com CC: r-help@r-project.org From the help page for readLines: If the final line is incomplete (no final EOL marker) the behaviour depends on whether the connection is blocking or not. For a non-blocking text-mode connection the incomplete line is pushed back, silently. For all other connections the line will be accepted, with a warning. You can disable the warning with; readLines('your_file', warn = FALSE) On Thu, Oct 1, 2009 at 9:39 AM, Tammy Ma metal_lical...@live.com wrote: Dear R-users, I use readLines to read data, but when processing the large data set, there are few files which can not be readed in: 48: In readLines(name_c[i]) ... : incomplete final line found on 'C:/Documents and Settings/lma/My Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt' ... Whats the problem about this? Regards, Tammy _ More than messagescheck out the rest of the Windows Live. http://www.microsoft.com/windows/windowslive/ [[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. -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40 S 49° 16' 22 O _ Drag n dropGet easy photo sharing with Windows Live Photos. http://www.microsoft.com/windows/windowslive/products/photos.aspx [[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] Can You Recommend Books for Linear Mixed Models in R
All I have been looking into the books on performing statistics in R, in particular I am interested in General Linear Mixed Models, for Randomized Complete Block Design Experiments The list I have come away with so far is: Mixed Effects Models in S and S-plus by Pinheiro (2002) http://www.amazon.com/Mixed-Effects-Models-S-S-Plus/dp/0387989579/ref=wl_itt_dp_o?ie=UTF8coliid=I1WXOBRXMHD30Vcolid=38N475HUK5VPJ Linear Models with R by Faraway (2004) http://www.amazon.com/Linear-Models-Texts-Statistical-Science/dp/1584884258/ref=sr_1_1?ie=UTF8s=booksqid=1254412763sr=1-1 Extending the Linear Model with R by Faraway (2005) http://www.amazon.com/Extending-Linear-Model-Generalized-Nonparametric/dp/158488424X/ref=pd_sim_b_7 Which of these would you as statisticians, researchers, scientists most recommend? Are there others in this realm of statistics that I have not discovered, that might be more effective? Thanks Pat -- Patrick Schmitz Graduate Student Plant Biology 1206 West Gregory Drive RM 1500 [[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] Using optimize with array variables
Hello, I am trying to figure out how to use optimize() with array variables as inputs. I have a for loop in the function definition: SS - function(int,slo,x,y){ for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2-squares[i] sum(squares)-sum_squares output_txt = c (The sum of squares is, sum_squares) print(output_txt, quote=FALSE)} Even assuming I make x and y single-integer variables, for example: optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1) I get the error: Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) : invalid function value in 'optimize' Not sure what that means. This also happens when x and y are defined as arrays. Does optimize require me to input values for all variables that are not being optimized (i.e. for n-1 of the inputs)? Why am I getting an error. I am new to R and under pressure to get some calculations done for my work. I'd appreciate an answer to the specific question - and I fully understand that I need to read up on R basics in more depth, which I am doing as best I can while trying to get this work done. Thanks! __ 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] pass ... to multiple sub-functions
2009/10/1 Peter Ruckdeschel peter.ruckdesc...@web.de: removed - c(lty,params.fun1) ## I assume you do not want to pass on argument lty... dots.remaining - cl[-1] ### remove the function name dots.remaining - dots.remaining[! names(dots.remaining) %in% removed] Best, Peter Thank you, that's very helpful. I vaguely remember there was also a package to deal with this problem (among other things). Have I dreamed that? Best, baptiste __ 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] Help me replace a for loop with an apply function
Will this work: x - read.table(textConnection( day user_id + 2008/11/012001 + 2008/11/012002 + 2008/11/012003 + 2008/11/012004 + 2008/11/012005 + 2008/11/022001 + 2008/11/022005 + 2008/11/032001 + 2008/11/032003 + 2008/11/032004 + 2008/11/032005 + 2008/11/042001 + 2008/11/042003 + 2008/11/042004 + 2008/11/042005), header=TRUE) closeAllConnections() # convert to Date x$day - as.Date(x$day, format=%Y/%m/%d) # split by user and then look for contiguous days contig - sapply(split(x$day, x$user_id), function(.days){ + .diff - cumsum(c(TRUE, diff(.days) != 1)) + max(table(.diff)) + }) contig 2001 2002 2003 2004 2005 41224 On Thu, Oct 1, 2009 at 11:29 AM, gd047 gd...@mineknowledge.com wrote: ...if that is possible My task is to find the longest streak of continuous days a user participated in a game. Instead of writing an sql function, I chose to use the R's rle function, to get the longest streaks and then update my db table with the results. The (attached) dataframe is something like this: day user_id 2008/11/01 2001 2008/11/01 2002 2008/11/01 2003 2008/11/01 2004 2008/11/01 2005 2008/11/02 2001 2008/11/02 2005 2008/11/03 2001 2008/11/03 2003 2008/11/03 2004 2008/11/03 2005 2008/11/04 2001 2008/11/04 2003 2008/11/04 2004 2008/11/04 2005 --- R code follows -- # turn it to a contingency table my_table - table(user_id, day) # get the streaks rle_table - apply(my_table,1,rle) # verify the longest streak of 1s for user 2001 # as.vector(tapply(rle_table$'2001'$lengths, rle_table$'2001'$values, max)[1]) # loop to get the results # initiate results matrix res-matrix(nrow=dim(my_table)[1], ncol=2) for (i in 1:dim(my_table)[1]) { string - paste(as.vector(tapply(rle_table$', rownames(my_table)[i], '$lengths, rle_table$', rownames(my_table)[i], '$values, max)['1']), sep=) res[i,]-c(as.integer(rownames(my_table)[i]) , eval(parse(text=string))) } --- end of R code Unfortunately this for loop takes too long and I' wondering if there is a way to produce the res matrix using a function from the apply family. Thank you in advance -- View this message in context: http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25696937.html 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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that 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] Normal distribution
Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. -- Noela Grupo de Recursos Marinos y Pesquerías Universidad de A Coruña [[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] .Rprofile file
Hi, I want to use the .RProfile to set defaults such as text editor. Is this a file I need to create? Also, where should I put it? I tend to create .RData files for different projects, putting each in a different Windows (Vista) folder. Is one .Rprofile file created that any instance of R can access (I would imagine so)? Thanks, Walt -- Walter R. Paczkowski, Ph.D. Data Analytics Corp. 44 Hamilton Lane Plainsboro, NJ 08536 (V) 609-936-8999 (F) 609-936-3733 w...@dataanalyticscorp.com www.dataanalyticscorp.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] Huge matrix: allocation works but assignment fails
Remi wrote: Hello everyone, I am working with one big matrix: w=matrix(0,18000,18000) on a Linux computer with 16Go of RAM. I can actually create the matrix, and even access elements: w[10,10] 0 but if I try to change one element, it fails: w[10,10]=1 In this case your object is copied and you need two times the space for your object. Best, Uwe Ligges Erreur : impossible d'allouer un vecteur de taille 2531250 Ko (Failed to allocate a vector of size...) What can I do? And, maybe even more important, how can one explains such a behavior? Thank you for any help/advice Rémi Proville. __ 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] Normal distribution
?shapiro.test -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noela Sánchez Sent: Thursday, October 01, 2009 12:47 PM To: r-help@r-project.org Subject: [R] Normal distribution Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. -- Noela Grupo de Recursos Marinos y Pesquerías Universidad de A Coruña [[alternative HTML version deleted]] This email message, including any attachments, is for th...{{dropped:6}} __ 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] Looking for a better way to document my packages
Hi all, Trying to do what my subject says. As I'm trying to be better about making packages out of my code, I'd like the packages themselves to be better, which means *.Rd- documenting my code. The thing is, from years of programming other languages prior to landing in the R pond, I've grown accustomed to documenting my functions inline. I'm not just used to it, but I like it more than having function documentation completely removed from my function, code. So, for example myNeatFunction - function(arg1, arg2, arg3=NULL, ...) { # One liner describing the neat thing this function does. # # More comments, probably very much what would be in the # \description section of the *Rd # # Parameters # -- # arg1 : some comments # arg2 : some comments # ... This is essentially the same exact stuff that would # be in the \arguments{} section of the *.Rd # # Returns # --- # A description of what's returned, let's say this is # what you'd find in the \value{} section. # # Notes # - # Maybe something like the \details{} section, though this # might as well be up in the description section, too. # etc. } There's essentially a 1-to-1 mapping of the comments I write here and what I would write in an *.Rd file, but I'd rather have it written in my function definition than an external document. Are there any tools that help facilitate this? Or are there better ways you folks have figured out to do something similar? I don't need the function comment block to be exactly what I showed here, but it's just an example of how I'm currently writing my stuff. I'm thinking something like sphinx (http://sphinx.pocoo.org/) from the python world would be cool. Perhaps there's a way to make a plugin for that to parse R-code. That's more work than I want to bit off right now, but if there isn't something useful in R-land already, it might be a fun side project. Just curious, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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] Revolutions blog: September roundup
I write about R every weekday at the Revolutions blog: http://blog.revolution-computing.com . In case you missed them, here are some articles from last month of particular interest to R users. http://bit.ly/WYAnM shows how to create a URL for a Google Spreadsheet so you can read the data directly from the cloud in R with read.csv. http://bit.ly/FuUNw reported on Google's use of R to predict economic statistics from search activity. http://bit.ly/10UbHc showed how to use the New York Times' API to mine articles for word frequency data. http://bit.ly/VKqSh discussed the similarities between Grand Central Dispatch for Snow Leopard and parallel processing with foreach. http://bit.ly/lRbAX announced a new R user group in Madison, Wisconsin. http://bit.ly/2Ms5nM noted the popular blog flowingdata.com uses R as the tool of choice for graphics (with touchups by Illustrator). http://bit.ly/BIU9V remarked on the Flash Mob which has populated stackoverflow.com with useful answers for many R questions. http://bit.ly/2cysLh reviews Jeroen Ooms' web-based financial plotting tool built on R. http://bit.ly/TcfD1 linked to a script in R for 7 common machine learning techniques. (And http://bit.ly/YInMs touched on the distinctions between machine learning and statistics.) http://bit.ly/XgBoR linked to an analysis done in R of the demographics of readers of Hacker News. http://bit.ly/Eec5z noted that TechCruch Trends is using R for its analysis of startup activity. http://bit.ly/akFNd gave tips for adding error bars to barplots with ggplot2. http://bit.ly/xxBNm showed how to present hierarchical clustering models as a circular cladogram. http://bit.ly/iteac gave some tips for getting started with bootstrapping in R. http://bit.ly/2no2C showed how R is used to analyze milk yields. http://bit.ly/VC7LE linked to a comprehensive reference to R for Matlab users. http://bit.ly/1CqP6n gave a practical demonstration of ggplot2's grammar of graphics concept. http://bit.ly/tP3Ci is a pictorial story of how one user converted a workflow based on Perl, Stata and Matlab to one solely based on R. http://bit.ly/OY2CR reviewed some of the airline performance posters from this year's Data Expo at the JSM. Other non-R-specific stories in the last month covered stochastic psychics (http://bit.ly/BIU9V), identifying individuals in anonymous data (http://bit.ly/ho0Df), an apology for Turing (http://bit.ly/QqW29), the Mythbusters' statistical philosophy (http://bit.ly/f8Nia), the Bulgarian lottery coincidence (http://bit.ly/Y1gaU), keyboards for pirates (http://bit.ly/t1C7a), the Netflix prize (http://bit.ly/eS1nb), and which line to choose at the supermarket (http://bit.ly/nHJkQ). (I've provided short URLs above because many mailers break the long direct URLs.) The R Community Calendar has also been updated at: http://blog.revolution-computing.com/calendar.html September was the highest-traffic month yet for the Revolutions blog. The Bulgarian Lottery article was quoted in the Wall Street Journal, and the machine learning post was very popular on Hacker News. As always, thanks for the comments and please keep sending suggestions to me at da...@revolution-computing.com . Don't forget you can also follow the blog using an RSS reader like Google Reader, or by following me on Twitter (I'm @revodavid). Cheers to all, # David Smith -- David M Smith da...@revolution-computing.com Director of Community, REvolution Computing www.revolution-computing.com Tel: +1 (206) 577-4778 x3203 (San Francisco, USA) Check out our upcoming events schedule at www.revolution-computing.com/events __ 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] Huge matrix: allocation works but assignment fails
Remi wrote: (Failed to allocate a vector of size...) What can I do? And, maybe even more important, how can one explains such a behavior? If your matrices are not sparse, get more memory. If they are, help(sparseMatrix,package=Matrix) ? __ 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 optimize with array variables
On Thu, 1 Oct 2009, Vik wrote: Hello, I am trying to figure out how to use optimize() with array variables as inputs. I have a for loop in the function definition: SS - function(int,slo,x,y){ for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2-squares[i] sum(squares)-sum_squares output_txt = c (The sum of squares is, sum_squares) print(output_txt, quote=FALSE)} Try running your code in a clean session. There is an error (and not the one you quote below). After you get rid of that error, try val - SS ( 0.1, 1, 1, 1 ) then print( val ) The difficulty optimize is having should be apparent. In spite of the pressure you are under, you will need to slow down, write readable code, and take the time to learn about writing functions in R before you can hope to get anywhere with a problem like this. Read the posting guide. For a problem like this one, the 'Some' mentioned below includes many of the people on this list who can provide useful, knowledgeable answers: Some consider it good manners to include a concise signature specifying affiliation HTH, Chuck p.s. do not use '-' or '-' until you really, really know what it does (which means you understand 'scoping')! Even assuming I make x and y single-integer variables, for example: optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1) I get the error: Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) : invalid function value in 'optimize' Not sure what that means. This also happens when x and y are defined as arrays. Does optimize require me to input values for all variables that are not being optimized (i.e. for n-1 of the inputs)? Why am I getting an error. I am new to R and under pressure to get some calculations done for my work. I'd appreciate an answer to the specific question - and I fully understand that I need to read up on R basics in more depth, which I am doing as best I can while trying to get this work done. Thanks! __ 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. Charles C. Berry(858) 534-2098 Dept of Family/Preventive Medicine E mailto:cbe...@tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901 __ 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] Looking for a better way to document my packages
Hi, I know of three options that resemble your query, - the roxygen package - a ruby script called weeder by Hadley Wikham - the inlinedocs package on r-forge I only ever used roxygen though, so i can't speak for the relative merits of the others. HTH, baptiste 2009/10/1 Steve Lianoglou mailinglist.honey...@gmail.com: Hi all, Trying to do what my subject says. As I'm trying to be better about making packages out of my code, I'd like the packages themselves to be better, which means *.Rd-documenting my code. The thing is, from years of programming other languages prior to landing in the R pond, I've grown accustomed to documenting my functions inline. I'm not just used to it, but I like it more than having function documentation completely removed from my function, code. So, for example myNeatFunction - function(arg1, arg2, arg3=NULL, ...) { # One liner describing the neat thing this function does. # # More comments, probably very much what would be in the # \description section of the *Rd # # Parameters # -- # arg1 : some comments # arg2 : some comments # ... This is essentially the same exact stuff that would # be in the \arguments{} section of the *.Rd # # Returns # --- # A description of what's returned, let's say this is # what you'd find in the \value{} section. # # Notes # - # Maybe something like the \details{} section, though this # might as well be up in the description section, too. # etc. } There's essentially a 1-to-1 mapping of the comments I write here and what I would write in an *.Rd file, but I'd rather have it written in my function definition than an external document. Are there any tools that help facilitate this? Or are there better ways you folks have figured out to do something similar? I don't need the function comment block to be exactly what I showed here, but it's just an example of how I'm currently writing my stuff. I'm thinking something like sphinx (http://sphinx.pocoo.org/) from the python world would be cool. Perhaps there's a way to make a plugin for that to parse R-code. That's more work than I want to bit off right now, but if there isn't something useful in R-land already, it might be a fun side project. Just curious, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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] Unable to install lme4
This is the first time I've encountered R having difficulty with package and R version compatibility. I cant believe no one has fixed generally so that your version of R can get the latest package appropriate to that version. How nice would that be? :) Anyway, I figured it out for my version (2.8.1). I needed to install Matrix package first, which was also outdated. R CMD INSTALL -l lib Matrix_0.999375-22.tar.gz R CMD INSTALL -l lib lme4_0.999375-28.tar.gz it loads now within R. I haven used it much yet. jamesmcc wrote: I am baffled by this as well. I'm having the same issue. Using suse linux, with 64 bit R2.8.1. Thanks, james Zege, Andrew wrote: I am unable to install package lme4, after several attempts to do so using various repository URLs. Just to make sure everything works fine with proxy, connection, etc, I installed ggplot2 and it worked fine. I am using command install.packages(lme4, lib=/myRlibs), optionally using contrib argument with different URLs. Error message the I get is Warning message; In install.packages(lme4, lib=/myRlibs) package 'lme4' is not available Some other details, not sure how relevant are: getOption(repos) returns http://lib.stat.cmu.edu/R/CRAN; I tried setting contrib to various other URL, such as http://cran.mtu.edu/src/contrib; or Berkeley URL, but with no success. Actually, when I did available.packages() on this repos, I didn't see lme4 in the package indices. My machine has x86_64bit RedHat Linux. Would appreciate any tips or directions, Thanks Andre __ 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. -- View this message in context: http://www.nabble.com/Unable-to-install--lme4-tp25514856p25703018.html 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.
Re: [R] Normal distribution
Hi, I think you can also use a qq-plot to do the same, no? You won't get a statistic score + p.value, but perhaps you're more of a visual person? :-) -steve On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick patrick.richard...@vai.org wrote: ?shapiro.test -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noela Sánchez Sent: Thursday, October 01, 2009 12:47 PM To: r-help@r-project.org Subject: [R] Normal distribution Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. -- Noela Grupo de Recursos Marinos y Pesquerías Universidad de A Coruña [[alternative HTML version deleted]] This email message, including any attachments, is for th...{{dropped:6}} __ 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. -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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] Normal distribution
I don't disagree. And to that end one could probably look at the skewness and kurtosis values as well. A combination of several techniques would probably be a good idea. Best regards, Patrick -Original Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: Thursday, October 01, 2009 1:18 PM To: Richardson, Patrick Cc: Noela Sánchez; r-help@r-project.org Subject: Re: [R] Normal distribution Hi, I think you can also use a qq-plot to do the same, no? You won't get a statistic score + p.value, but perhaps you're more of a visual person? :-) -steve On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick patrick.richard...@vai.org wrote: ?shapiro.test -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noela Sánchez Sent: Thursday, October 01, 2009 12:47 PM To: r-help@r-project.org Subject: [R] Normal distribution Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. -- Noela Grupo de Recursos Marinos y Pesquerías Universidad de A Coruña [[alternative HTML version deleted]] This email message, including any attachments, is for ...{{dropped:25}} __ 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] Looking for a better way to document my packages
Ah, great! Thanks for the refs, I'll look into them. -steve On Thu, Oct 1, 2009 at 1:12 PM, baptiste auguie baptiste.aug...@googlemail.com wrote: Hi, I know of three options that resemble your query, - the roxygen package - a ruby script called weeder by Hadley Wikham - the inlinedocs package on r-forge I only ever used roxygen though, so i can't speak for the relative merits of the others. HTH, baptiste 2009/10/1 Steve Lianoglou mailinglist.honey...@gmail.com: Hi all, Trying to do what my subject says. As I'm trying to be better about making packages out of my code, I'd like the packages themselves to be better, which means *.Rd-documenting my code. The thing is, from years of programming other languages prior to landing in the R pond, I've grown accustomed to documenting my functions inline. I'm not just used to it, but I like it more than having function documentation completely removed from my function, code. So, for example myNeatFunction - function(arg1, arg2, arg3=NULL, ...) { # One liner describing the neat thing this function does. # # More comments, probably very much what would be in the # \description section of the *Rd # # Parameters # -- # arg1 : some comments # arg2 : some comments # ... This is essentially the same exact stuff that would # be in the \arguments{} section of the *.Rd # # Returns # --- # A description of what's returned, let's say this is # what you'd find in the \value{} section. # # Notes # - # Maybe something like the \details{} section, though this # might as well be up in the description section, too. # etc. } There's essentially a 1-to-1 mapping of the comments I write here and what I would write in an *.Rd file, but I'd rather have it written in my function definition than an external document. Are there any tools that help facilitate this? Or are there better ways you folks have figured out to do something similar? I don't need the function comment block to be exactly what I showed here, but it's just an example of how I'm currently writing my stuff. I'm thinking something like sphinx (http://sphinx.pocoo.org/) from the python world would be cool. Perhaps there's a way to make a plugin for that to parse R-code. That's more work than I want to bit off right now, but if there isn't something useful in R-land already, it might be a fun side project. Just curious, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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. -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ 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] launching two RGUI computations from two different Excel workbooks
Please send questions like this to the rcom mailing list. You can subscribe at rcom.univie.ac.at. On Sep 28, 2009, at 1:34 PM, sowh...@o2.pl wrote: Hello, I have the following problem: I have excel workbooks connected with R through RExcel package. Data are being loaded from excel, then they are processed in R and then the results are being put in excel. Everything works fine, except the fact that I can't launch two or more excel workbooks (and two or more R servers in the background) at the same time. I have to wait until one computation is finished and then launch another one. It would be much easier and quicker for me to launch two or more computations at the same time. Is this possible to launch two different R servers from Excel? Regards, Wojciech Turski __ 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] Normal distribution
Noela, Package nortest has 5 tests of normality. A word of caution: the wording of your question suggests that you believe that, if the test you use does not reject the normality hypothesis, you then have proof that your data come from a Normal distribution. That's *NOT* true. Normality will still be an *assumption*, albeit perhaps a reasonable one. This is particularly important to realize if you have small samples. -Peter Ehlers Noela Sánchez wrote: Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. __ 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] Normal distribution
Another interesting visual technique is given by the qreference() function in pkg:DAAG. I've used this type of display effectively with non-stats people as well as in teaching intro courses in stats. (I would randomize the location of the actual-data panel and not use a different colour. The question then is, can you discern the actual data from the simulated data?) -Peter Ehlers Steve Lianoglou wrote: Hi, I think you can also use a qq-plot to do the same, no? You won't get a statistic score + p.value, but perhaps you're more of a visual person? :-) -steve On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick patrick.richard...@vai.org wrote: ?shapiro.test -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noela Sánchez Sent: Thursday, October 01, 2009 12:47 PM To: r-help@r-project.org Subject: [R] Normal distribution Hi, I am dealing with how to check in R if some data that I have belongs to a normal distribution or not. I am not interested in obtaining the theoreticall frequencies. I am only interested in determing if (by means of a test as Kolmogorov, or whatever), if my data are normal or not. But I have tried with ks.test() and I have not got it. -- Noela Grupo de Recursos Marinos y Pesquerías Universidad de A Coruña [[alternative HTML version deleted]] This email message, including any attachments, is for th...{{dropped:6}} __ 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] caret package for time series applications
Hello, I have some time series applications, where i have a large set of X variables (hundreds) and thousands of time data points (sampling every minute). I like to use the caret package to support the analysis, variable selection and model selection. However, reading the documentation, it looks like caret uses resampling methods. Not sure if these methods work with time series, as you need a block bootstrap or such. My question: Does the caret package support the usage of time series data? __ 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.