Re: [R] R CMD INSTALL -l /path/to/library packagename
I don't use Linux but perhaps you should check what environment variables you have defined and also if you have anything in your *.site files, if you have them, that could cause that. On 9/13/05, McClatchie, Sam (PIRSA-SARDI) [EMAIL PROTECTED] wrote: Background: OS: Linux Mandrake 10.1 release: R 2.1.1 editor: GNU Emacs 21.3.2 front-end: ESS 5.2.3 Colleagues Since I upgraded to R 2.1.1, I am getting a an error message from R CMD INSTALL packagename that says R_HOME ('/usr/local/lib/R') not found. That's not too surprising, since R is now in /usr/lib/R, but what is confusing me is that R CMD INSTALL -l /path/to/library packagename is giving me the same message, suggesting that I am misusing the -lib switch when I enter R CMD INSTALL -l /usr/lib/R/library waveslim_1.5.tar.gz I'm sure the fix is trivial, but I can't see it for looking in the manual. Any help appreciated. Sam Sam McClatchie, Biological oceanography South Australian Aquatic Sciences Centre PO Box 120, Henley Beach 5022 Adelaide, South Australia email [EMAIL PROTECTED] Cellular: 0431 304 497 Telephone: (61-8) 8207 5448 FAX: (61-8) 8207 5481 Research home page http://www.members.iinet.net.au/~s.mcclatchie/ /\ ...xX(° °)Xx / \\ (((° (((° ...xX(°O°)Xx __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Running DOS command prompt from R 2.0.1 Windows?
Mr Toby Daniel Ahrens wrote: I am trying to use R (windows version 2.0.1) to manage runs of a program that is run from a DOS command prompt. Is R able to call a DOS prompt? I am hoping that there is something analogous to the spawn command in IDL, but I can't see to find any help in the R archives... Thanks very much, Toby Yes, e.g. system(cmd) to get a DOS prompt. See ?system or ?shell for details. You may consider to use wait=FALSE if you want a non-modal behavior. HTH Thomas P. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Collineariy Diagnostics
Hi, and thanks for your help in order to do collinearity analysis I downloaded the perturb package. I run a lm (regression) and on that the ³calldiag² commad to get condition numbers but i get the following message: the variable XY with modus ³numeric² was not found (it does the same with all predictors despite all variables are numeric and exists). Can anyone tell me how can I go arround this problem? Is there another way to have ³condition numbers²? What about VIF? Please return message to: [EMAIL PROTECTED] Thanks a lot Antoine __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Floating-point arithmetic
Hi Folks, A recent exchange on the 'octave' list led to the following paper being cited, which I had not met before: What Every Computer Scientist Should Know About Floating-Point Arithmetic, by David Goldberg, originally published in the March, 1991 issue of Computing Surveys. PDF and HTML versions are widely available on the web (see Google), e.g. at http://www.physics.ohio-state.edu/~dws/grouplinks/floating_point_math.pdf Though over the years I've many times been there, done that, got bitten by the bugs, and bought the T-shirt [I have one from Florida depicting a large and joyful mosquito with proboscis dripping with blood] I still found this a revealing read, written in a style well-suited to general users of numerical computer languages. So I'm writing to bring it to the notice of R users who may not have come across it. (And also, maybe, to pre-empt that question that some of you may have been thinking of asking ... ). Best wishes to all, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 13-Sep-05 Time: 08:30:03 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Document clustering for R
If you are able to implement the computation of the distance matrix, you can use methods such as pam, agnes and hclust, which operate on dissimilarity matrices of any kind. You may also perform a multidimensional scaling with isoMDS, sammon or cmdscale and use any clustering algorithm for n*p data on the outcome. Best, Christian On Mon, 12 Sep 2005, Raymond K Pon wrote: I'm working on a project related to document clustering. I know that R has clustering algorithms such as clara, but only supports two distance metrics: euclidian and manhattan, which are not very useful for clustering documents. I was wondering how easy it would be to extend the clustering package in R to support other distance metrics, such as cosine distance, or if there was an API for custom distance metrics. Best regards, Raymond Pon [EMAIL PROTECTED] x43062 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html *** --- *** Christian Hennig University College London, Department of Statistical Science Gower St., London WC1E 6BT, phone +44 207 679 1698 [EMAIL PROTECTED], www.homepages.ucl.ac.uk/~ucakche __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] remedial stats education
Everybody, thanks for your suggestions. I am planning to order at least these two: Peter Dalgaard _Introductory Statistics with R_ Andrew Gelman _Bayesian Data Analysis_ Also, while stumbling around amazon.com, I found this book: Statistical Reasoning in Psychology and Education, 4th edition by Edward W. Minium, Bruce M. King ISBN: 0471211877 This book looks perfect for me -- I can do math, learn R, etc, but WHY? Why use one method and not another? Why structure a problem one way and not another? These are the questions which really stump me. So, has anybody read this book? Is there a similar book which is even better? -- Make April 15 just another day, visit http://fairtax.org signature.asc Description: Digital signature __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Document clustering for R
Hi, We discovered that the package amap contain a distance calculation function call Dist which can calculate the distance according to a method call pearson which is in fact the not centered Pearson which seems to be the cosine distance. Could you tell me what do you think on that? Best regards, David On Sep 12, 2005, at 21:47, Raymond K Pon wrote: I'm working on a project related to document clustering. I know that R has clustering algorithms such as clara, but only supports two distance metrics: euclidian and manhattan, which are not very useful for clustering documents. I was wondering how easy it would be to extend the clustering package in R to support other distance metrics, such as cosine distance, or if there was an API for custom distance metrics. Best regards, Raymond Pon [EMAIL PROTECTED] x43062 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Collineariy Diagnostics
Antoine de Bary wrote: Hi, and thanks for your help in order to do collinearity analysis I downloaded the perturb package. I run a lm (regression) and on that the ³calldiag² commad to get condition numbers but i get the following message: the variable XY with modus ³numeric² was not found (it does the same with all predictors despite all variables are numeric and exists). Can anyone tell me how can I go arround this problem? Is there another way to have ³condition numbers²? What about VIF? Please return message to: [EMAIL PROTECTED] I cannot comment on the perturb package. However for condition numbers see ?kappa.lm, and for variance inflation factors see ?vif. The latter is in the Design package. set.seed(1) x1 - rnorm(100) x2 - x1 + 0.1 * rnorm(100) y - rnorm(100) f - lm(y ~ x1 + x2) vif(f) kappa(f) HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Collineariy Diagnostics
Dear Sundar and Antoine, In addition, the vif function in the car package will calculate generalized variance inflation factors. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sundar Dorai-Raj Sent: Tuesday, September 13, 2005 5:16 AM To: Antoine de Bary Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Collineariy Diagnostics Antoine de Bary wrote: Hi, and thanks for your help in order to do collinearity analysis I downloaded the perturb package. I run a lm (regression) and on that the ³calldiag² commad to get condition numbers but i get the following message: the variable XY with modus ³numeric² was not found (it does the same with all predictors despite all variables are numeric and exists). Can anyone tell me how can I go arround this problem? Is there another way to have ³condition numbers²? What about VIF? Please return message to: [EMAIL PROTECTED] I cannot comment on the perturb package. However for condition numbers see ?kappa.lm, and for variance inflation factors see ?vif. The latter is in the Design package. set.seed(1) x1 - rnorm(100) x2 - x1 + 0.1 * rnorm(100) y - rnorm(100) f - lm(y ~ x1 + x2) vif(f) kappa(f) HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] How to erase objects
Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] VB and R
Dear Listers, Is there any good paper about how to use R together with VB? Thank you so much! -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to erase objects
?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] VB and R
I belive R, which is platform independent, does not work with any platform specific software or languages, like Visual Basic. Can you write your code by passing information through input/output files (CSV HML might be good formats)? Jarek Tuszynski SAIC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 7:28 AM To: r-help@stat.math.ethz.ch Subject: [R] VB and R Dear Listers, Is there any good paper about how to use R together with VB? Thank you so much! -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to erase objects
# to see the objects that are currently in memory objects() # to remove everything rm(list = ls()) HTH, Martin --- Luis Ridao Cruz [EMAIL PROTECTED] wrote: ?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] VB and R
On Tue, 13 Sep 2005, Tuszynski, Jaroslaw W. wrote: I belive R, which is platform independent, does not work with any platform specific software or languages, like Visual Basic. Can you write your code by passing information through input/output files (CSV HML might be good formats)? R can be used in a (D)COM context - see: http://cran.r-project.org/contrib/extra/dcom and can be embedded in other software systems too. To quote from: http://cran.r-project.org/contrib/extra/dcom/RSrv135.html R (D)COM server provides a mechanism for standard applications like Microsoft Excel or custom applications written in any language serving as a COM client (e.g. Visual Basic, Perl) to use the R as a powerful computational engine and renderer for graphics and text output. Because there are so many possibilities, the good paper is in the examples, there isn't (as far as I know) a complete manual. Jarek Tuszynski SAIC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 7:28 AM To: r-help@stat.math.ethz.ch Subject: [R] VB and R Dear Listers, Is there any good paper about how to use R together with VB? Thank you so much! -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to erase objects
You can also use ls() which is alias of objects(). One way is to remove unwanted objects by hand rm(a,b,c,d) Another way is to save the required objects, remove everything and then load the saved objects. save(x,y,z, file=out.rda, compress=TRUE) rm( list=ls() ) load(out.rda) The second approach allows you to load the objects in a fresh R session, which is one way to release memory if gc() fails. But which approach you prefer depends on the number of objects to be removed and saved. Regards, Adai On Tue, 2005-09-13 at 04:39 -0700, Martin Lam wrote: # to see the objects that are currently in memory objects() # to remove everything rm(list = ls()) HTH, Martin --- Luis Ridao Cruz [EMAIL PROTECTED] wrote: ?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] VB and R
On 9/13/2005 7:38 AM, Tuszynski, Jaroslaw W. wrote: I belive R, which is platform independent, does not work with any platform specific software or languages, like Visual Basic. That's not true at all. R works with many platform specific packages. I think Roger Bivand's answer covers the easiest way (COM) to link to VB, but you can also use shared libraries (DLL's in Windows) created in just about any package through the dyn.load() facility. Duncan Murdoch Can you write your code by passing information through input/output files (CSV HML might be good formats)? Jarek Tuszynski SAIC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 7:28 AM To: r-help@stat.math.ethz.ch Subject: [R] VB and R Dear Listers, Is there any good paper about how to use R together with VB? Thank you so much! -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] VB and R
On 9/13/05, Wensui Liu [EMAIL PROTECTED] wrote: Dear Listers, Is there any good paper about how to use R together with VB? I assume you are looking to write a VB GUI with an R backend. You might want to look at the R GUIs page and its mailing list to see what other people are doing in that area. From the R home page click on Related Projects in the left pane and then click on R GUIs. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] VB and R
Hello, You can look at SciViews-R (http://www.sciviews.org/Sciviews-R). It is written in VB6. source code is available. Best, Philippe Grosjean ..°})) ) ) ) ) ) ( ( ( ( (Prof. Philippe Grosjean ) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Pentagone (3D08) ( ( ( ( (Academie Universitaire Wallonie-Bruxelles ) ) ) ) ) 8, av du Champ de Mars, 7000 Mons, Belgium ( ( ( ( ( ) ) ) ) ) phone: + 32.65.37.34.97, fax: + 32.65.37.30.54 ( ( ( ( (email: [EMAIL PROTECTED] ) ) ) ) ) ( ( ( ( (web: http://www.umh.ac.be/~econum ) ) ) ) ) http://www.sciviews.org ( ( ( ( ( .. Gabor Grothendieck wrote: On 9/13/05, Wensui Liu [EMAIL PROTECTED] wrote: Dear Listers, Is there any good paper about how to use R together with VB? I assume you are looking to write a VB GUI with an R backend. You might want to look at the R GUIs page and its mailing list to see what other people are doing in that area. From the R home page click on Related Projects in the left pane and then click on R GUIs. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Document clustering for R
On Mon, 2005-09-12 at 12:47 -0700, Raymond K Pon wrote: I'm working on a project related to document clustering. I know that R has clustering algorithms such as clara, but only supports two distance metrics: euclidian and manhattan, which are not very useful for clustering documents. I was wondering how easy it would be to extend the clustering package in R to support other distance metrics, such as cosine distance, or if there was an API for custom distance metrics. You don't have to extend the clustering package in R to support other distance metrics, but you should take care that you produce your dissimilarities (or distances) in the standard format so that they can be used in clustering package or in cmdscale or in isoMDS or any other function excepting a dist object. Clustering package will support new dissimilarities if they were written in standard conforming way. There are several packages that offer alternative dissimilarities (and some even distances) that can be used in clustering functions. Look for distances or dissimilarities in the R Site. Some of these could be the one for you... I would be surprised if cosine index is missing (and if needed, I could write it for you in C, but I don't think that is necessary). cheers, jari oksanen __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] if() command
Hi everyone ! Could you please help me with this problem ? I´ve trying to write a code that assign to a variable the content from another, but all I´ve got is a message error. For example: if (age =10) {group == 1} else if (age 10 age = 20) {group == 2} else {group == 3} Syntax error Or if (age =10) {group == 1} else (age 10 age = 20) {group == 2} else {group == 3} Syntax error I know that is possible to find the solution by ifelse command or even recode command, but I´d like to use this way, because I can add another variable as a new condition and I believe to expand the possibilites. Thanks, Mauricio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] if() command
Carlos Maurício Cardeal Mendes wrote: Hi everyone ! Could you please help me with this problem ? I´ve trying to write a code that assign to a variable the content from another, but all I´ve got is a message error. For example: if (age =10) {group == 1} else if (age 10 age = 20) {group == 2} else {group == 3} Syntax error Or if (age =10) {group == 1} else (age 10 age = 20) {group == 2} else {group == 3} Syntax error I know that is possible to find the solution by ifelse command or even recode command, but I´d like to use this way, because I can add another variable as a new condition and I believe to expand the possibilites. Thanks, Mauricio Because the following line is syntatically correct: if (age =10) {group == 1} the R parser does not expect the following: else (age 10 age = 20) {group == 2} else {group == 3} causing a sytax error. Instead, you want: if (age =10) { group == 1 } else (age 10 age = 20) { group == 2 } else { group == 3 } HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Document clustering for R
On Tue, 13 Sep 2005, Jari Oksanen wrote: On Mon, 2005-09-12 at 12:47 -0700, Raymond K Pon wrote: I'm working on a project related to document clustering. I know that R has clustering algorithms such as clara, but only supports two distance metrics: euclidian and manhattan, which are not very useful for clustering documents. I was wondering how easy it would be to extend the clustering package in R to support other distance metrics, such as cosine distance, or if there was an API for custom distance metrics. You don't have to extend the clustering package in R to support other distance metrics, but you should take care that you produce your dissimilarities (or distances) in the standard format so that they can be used in clustering package or in cmdscale or in isoMDS or any other function excepting a dist object. Clustering package will support new dissimilarities if they were written in standard conforming way. There are several packages that offer alternative dissimilarities (and some even distances) that can be used in clustering functions. Look for distances or dissimilarities in the R Site. Some of these could be the one for you... I would be surprised if cosine index is missing (and if needed, I could write it for you in C, but I don't think that is necessary). Generation of the standard dist format out of a distance matrix m works simply by as.dist(m). Christian *** --- *** Christian Hennig University College London, Department of Statistical Science Gower St., London WC1E 6BT, phone +44 207 679 1698 [EMAIL PROTECTED], www.homepages.ucl.ac.uk/~ucakche __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] plot glmmPQL
Dear All, Is there any function to plot the probability of success (wrt to time) for a glmmPQL object? I can do it with curve but I wonder if there is an efficient way ... Thank you, Bernard - [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] if() command
not enough parenthesis hih __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] trouble with reading data from excel
Hi On 12 Sep 2005 at 15:23, Wensui Liu wrote: Sloan, You don't need to save xls as csv. Actually, R reads data in excel very well. Following code is cutted from my blog and HTH. library(RODBC); ### # 1. READ DATA FROM EXCEL INTO R # ### xlsConnect-odbcConnectExcel(C:\\temp\\demo.xls); demo-sqlFetch(xlsConnect, Sheet1); odbcClose(xlsConnect); rm(demo); or if you are on Windows open Excel select what you want to read, including header press ctrl-C in R mydata-read.delim(clipboard) to write from R write.table(tab, clipboard, sep = \t, row.names = F) open Excel press ctrl-V HTH Petr On 9/12/05, sloan jones [EMAIL PROTECTED] wrote: I have been trying to open data that I have saved in an excel spread sheet. I saved it as a csv. Then I tried using the read.csv command. However, everytime I do this-- diseasedat-read.csv(M:/sloan/R/disease/disease.csv, sep=, header = TRUE, fill= TRUE)-- I get an error message: Error in file(file, r) : unable to open connection In addition: Warning message: cannot open file 'M:/sloan/R/disease/disease.csv' What am I doing wrong or what should I look for to correct this? Sloan -- ___ Surf the Web in a faster, safer and easier way: Download Opera 8 at http://www.opera.com __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- WenSui Liu (http://statcompute.blogspot.com) Senior Decision Support Analyst Cincinnati Children Hospital Medical Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] [EMAIL PROTECTED]: Remedial stats]
It seems like the Bayesian folks like to hide. Hey, I just want to get the job done whether using frequency or Bayesian stats. Can anybody suggest a good introduction to Bayesian Analysis? - Forwarded message from Ken Beath [EMAIL PROTECTED] - To: Joshua N Pritikin [EMAIL PROTECTED] From: Ken Beath [EMAIL PROTECTED] Subject: Remedial stats Hi, Gelman's book Bayesian Data Analysis' while excellent tends to move through the introductory material at a rapid pace. You will need to have a good understanding of things like conditional probability. There are other books which may be better. Peter Lee Bayesian Statistics: an introduction is good on the basic theory but may be a bit light on the Gibbs sampler. There are probably other good books, I'm not really a Bayesian so I don't know them off hand. signature.asc Description: Digital signature __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] if() command
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Floating-point arithmetic
On Tue, 13 Sep 2005, [EMAIL PROTECTED] wrote: A recent exchange on the 'octave' list led to the following paper being cited, which I had not met before: What Every Computer Scientist Should Know About Floating-Point Arithmetic, by David Goldberg, snip So I'm writing to bring it to the notice of R users who may not have come across it. (And also, maybe, to pre-empt that question that some of you may have been thinking of asking ... ). Since the paper is already linked from the relevant R FAQ question, there surely wouldn't be any of these ;-) -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] if() command
Hallo On 13 Sep 2005 at 10:29, Carlos Maurício Cardeal Mende wrote: Hi everyone ! Could you please help me with this problem ? I´ve trying to write a code that assign to a variable the content from another, but all I´ve got is a message error. For example: if (age =10) {group == 1} else if (age 10 age = 20) {group == 2} else {group == 3} if you put your statement on one line it works (at least it does not give you syntax error) but the result is hardly what you really expect age-sample(seq(10,50,10), 20, replace=T) if (age =10) {group - 1} else if (age 10 age = 20) {group - 2} else {group - 3} if (age =10) {group == 1} else if (age 10 age = 20) {group == 2} else {group == 3} Maybe you want something like group-as.numeric(cut(age,c(0,10,20,100))) but it is only guess HTH Petr Syntax error Or if (age =10) {group == 1} else (age 10 age = 20) {group == 2} else {group == 3} Syntax error I know that is possible to find the solution by ifelse command or even recode command, but I´d like to use this way, because I can add another variable as a new condition and I believe to expand the possibilites. Thanks, Mauricio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Petr Pikal [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] if() command
First, == is logical comparison, so if you want to create a variable based on both age and group you can do that. However, it looks like you want to define the variable group, so you want to use - or = for that. Second, if you're typing this at a command prompt, you need to make sure you tell R you're not finished when it looks like you could be. There are several ways to do this. One is to put everything inside braces; another is to deliberately leave lines incomplete, like if (age = 10) { group - 1 } else { if (age = 20) { group - 2 } else group - 3 } Third, this will work for a vector of length 1. If you want to take a vector age and produce a corresponding vector group, you'll need to put this in a loop, or use lapply, or some iteration. Fourth, you can also write the above as group - if (age = 10) 1 else if (age = 20) 2 else 3 that is, if() returns a value you can assign. Finally, besides ifelse you can use cut for this particular task. Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Carlos Maurício Cardeal Mendes Sent: Tuesday, September 13, 2005 9:29 AM To: r-help@stat.math.ethz.ch Subject: [R] if() command Hi everyone ! Could you please help me with this problem ? I´ve trying to write a code that assign to a variable the content from another, but all I´ve got is a message error. For example: if (age =10) {group == 1} else if (age 10 age = 20) {group == 2} else {group == 3} Syntax error Or if (age =10) {group == 1} else (age 10 age = 20) {group == 2} else {group == 3} Syntax error I know that is possible to find the solution by ifelse command or even recode command, but I´d like to use this way, because I can add another variable as a new condition and I believe to expand the possibilites. Thanks, Mauricio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Any S-plus/R doc or manual for SAS user out there?
Dear list, I am looking for an Splus or R doc / manual for SAS user. Thank you in advance. PK __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] where is eda library (Prof. Ripley's Exploratory Data Analysis Library)
Hi I want to install eda library. Where can I download it? I use R version 2.1.0 on Linux. Thanks. Stephen. - Original Message - From: Luis Ridao Cruz [EMAIL PROTECTED] Date: Tuesday, September 13, 2005 1:32 pm Subject: Re: [R] How to erase objects ?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] multiple comparisons for proportions
Dear all I am still fishing for help on this theme. In Zar 1999 page 563-565 he describes a Tukey-type multiple comparison for testing among proportions. It involves comparisons of ranked proportions transformed to degrees. In the following pages there are a couple of similar comparisons. I cannot find an example of this in R. Is there such a thing? Cheers Chris Buddenhagen, Botany Department, Charles Darwin Research Station, Santa Cruz,Galapagos. Mail: Charles Darwin Foundation, Casilla 17-01-3891 Avenida 6 de Diciembre N36-109 y Pasaje California Quito, ECUADOR __ EL CONTENIDO DE ESTE MENSAJE ES DE ABSOLUTA RESPONSABILIDAD DEL AUTOR. FUNDACION CHARLES DARWIN WWW.DARWINFOUNDATION.ORG [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] where is eda library (Prof. Ripley's Exploratory Data Analysis Library)
S.O. Nyangoma wrote: Hi I want to install eda library. Where can I download it? I use R version 2.1.0 on Linux. Thanks. Stephen. library(eda) Warning message: package 'eda' has been merged into 'stats' EJ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Reading data from a serial port
I need to read data from from a medical appliance via the serial port. This medical appliance produces streams of set data at regular intervals. What commands, packages are available for this purpose? Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] where is eda library (Prof. Ripley's Exploratory Data Analysis Library)
S.O. Nyangoma wrote: Hi I want to install eda library. Where can I download it? I use R version 2.1.0 on Linux. What about typing library(eda) Warning message: package 'eda' has been merged into 'stats' Now we see immediately that we alreeady have access to the functions that *were* included in *package* eda. Uwe Ligges Thanks. Stephen. - Original Message - From: Luis Ridao Cruz [EMAIL PROTECTED] Date: Tuesday, September 13, 2005 1:32 pm Subject: Re: [R] How to erase objects ?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] where is eda library (Prof. Ripley's Exploratory Data Analysis Library)
Three things: 1. Please do not hit the reply button to an unrelated topic and change the subject. As the signature tells you, PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html; 2. You are looking for the eda *package* and not a *library*. 3. Since eda is not on CRAN (just tried install.packages(eda)) perhaps you can tell us what functions you're looking for. eda, which I'm not familiar with, may have been merged with other packages or is defunct. Either way, there may be alternatives out there that will satisfy your needs. Thanks, --sundar S.O. Nyangoma wrote: Hi I want to install eda library. Where can I download it? I use R version 2.1.0 on Linux. Thanks. Stephen. - Original Message - From: Luis Ridao Cruz [EMAIL PROTECTED] Date: Tuesday, September 13, 2005 1:32 pm Subject: Re: [R] How to erase objects ?rm [EMAIL PROTECTED] 13/09/2005 12:08:55 Hi, I admit that I rather carelessly built lots of large objects and therefore ran out of memory. Most objects, which I have at the moment are now unnecessary, but it would take a lot of time to recreate the last few ones from scratch. So I would like to erase (get rid of) selected objects in order to be able to continue. Does anyone know how I could do this? Machen Sie aus 14 Cent spielend bis zu 100 Euro! Die neue Gaming-Area von Arcor - über 50 Onlinespiele im Angebot. http://www.arcor.de/rd/emf-gaming-1 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting- guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] best way to fit a model
Em Sex 09 Set 2005 15:25, Achim Zeileis escreveu: On Fri, 9 Sep 2005 14:55:04 -0300 Ronaldo Reis-Jr. wrote: Hi, I have some data that have this behaviour: |*** |* | * |* | * | What is the best and simpler way to fit this in R? If the changepoint is known, then this is straightforward using lm: I try this. But my doubt now is: How to justify this kind of analysis? Why dont use any linearized or non linear regression to fit this? Something like a log function (I try but is not a good function). Thanks Ronaldo -- Your reasoning is excellent -- it's only your basic assumptions that are wrong. -- | // | \\ [***] | ( õ õ ) [Ronaldo Reis Júnior] | V [UFV/DBA-Entomologia] |/ \ [36570-000 Viçosa - MG ] | /(.''`.)\ [Fone: 31-3899-4007 ] | /(: :' :)\ [EMAIL PROTECTED]] |/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ] |( `- ) [***] | _/ \_Powered by GNU/Debian Woody/Sarge __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Reading data from a serial port
I don't know of a specific package, but there is support for various connections in R. look for help on connections by typing: ?connection There is also a section in the R Data Import/Export document on connections. You will probably use a fifo or a pipe. Good luck, Greg Snow, Ph.D. Statistical Data Center, LDS Hospital Intermountain Health Care [EMAIL PROTECTED] (801) 408-8111 vittorio [EMAIL PROTECTED] 09/13/05 10:07AM I need to read data from from a medical appliance via the serial port. This medical appliance produces streams of set data at regular intervals. What commands, packages are available for this purpose? Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] [S] Any S-plus/R doc or manual for SAS user out there?
paul king wrote: Dear list, I am looking for an Splus or R doc / manual for SAS user. Thank you in advance. PK Somewhat helpful in that regard: http://biostat.mc.vanderbilt.edu/twiki/pub/Main/RS/sintro.pdf -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Floating-point arithmetic
On 13-Sep-05 Thomas Lumley wrote: On Tue, 13 Sep 2005, [EMAIL PROTECTED] wrote: A recent exchange on the 'octave' list led to the following paper being cited, which I had not met before: What Every Computer Scientist Should Know About Floating-Point Arithmetic, by David Goldberg, snip So I'm writing to bring it to the notice of R users who may not have come across it. (And also, maybe, to pre-empt that question that some of you may have been thinking of asking ... ). Since the paper is already linked from the relevant R FAQ question, there surely wouldn't be any of these ;-) -thomas Except, perhaps, from people (like me) who had not read that FAQ -- and who knows what legions these may be? ;) Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 13-Sep-05 Time: 16:06:25 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] best way to fit a model
On Tue, 13 Sep 2005 13:24:02 -0300 Ronaldo Reis-Jr. wrote: Em Sex 09 Set 2005 15:25, Achim Zeileis escreveu: On Fri, 9 Sep 2005 14:55:04 -0300 Ronaldo Reis-Jr. wrote: Hi, I have some data that have this behaviour: |*** |* | * |* | * | What is the best and simpler way to fit this in R? If the changepoint is known, then this is straightforward using lm: I try this. But my doubt now is: How to justify this kind of analysis? Why dont use any linearized or non linear regression to fit this? Something like a log function (I try but is not a good function). The motivation usually comes from subject-matter knowledge. For example, such changepoint models are accepted by practitioners as good proxies for certain biological processes. If you think that the data-generating process might contain a structural change, why not model it as such? Z Thanks Ronaldo -- Your reasoning is excellent -- it's only your basic assumptions that are wrong. -- | // | \\ [***] | ( õ õ ) [Ronaldo Reis Júnior] | V [UFV/DBA-Entomologia] |/ \ [36570-000 Viçosa - MG ] | /(.''`.)\ [Fone: 31-3899-4007 ] | /(: :' :)\ [EMAIL PROTECTED]] |/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ] |( `- ) [***] | _/ \_Powered by GNU/Debian Woody/Sarge __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] what OS
How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
Omar Lakkis wrote: How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that Hi, Omar, Look at version$os. # windows version$os [1] mingw32 # linux version$os [1] linux-gnu HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
?.Platform -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA The business of the statistician is to catalyze the scientific learning process. - George E. P. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 11:30 AM To: r-help@stat.math.ethz.ch Subject: [R] what OS How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
Try this Sys.info()[sysname] Etienne - Original Message - From: Omar Lakkis [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Tuesday, September 13, 2005 8:29 PM Subject: [R] what OS How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.23/99 - Release Date: 12/09/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
.Platform$OS.type -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 11:30 AM To: r-help@stat.math.ethz.ch Subject: [R] what OS How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
.Platform contains this and more. Reid Huntsinger -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 2:30 PM To: r-help@stat.math.ethz.ch Subject: [R] what OS How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
From: Sundar Dorai-Raj Omar Lakkis wrote: How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that Hi, Omar, Look at version$os. # windows version$os [1] mingw32 # linux version$os [1] linux-gnu Or see ?.Platform. Andy HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] is library loaded
Is there a way to test if a library has been loaded? is.loaded does not give me what I want, I am looking to say: if loaded(Rdbi) dbSendQuery(conn, q) if loaded(RODBC) sqlQuery(conn, q) I need this to support both unix and windows platforms as I could not find a windows distribution for RdbiPgSQL. I am using R 2.1.0 and postgresql. I will be connecting to the database using Rdbi and RdbiPgSQL and have other developers using windows connect with RODBC, unless someone can suggest a better solution. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] coxph.detail() does not work
Hello everyone, I tried to use coxph.detail() to get the hazard function. But a warning messge always returns to me, even in the example provided by its help document: ?coxph.detail fit - coxph(Surv(futime,fustat) ~ age + rx + ecog.ps, ovarian, x=TRUE) fitd - coxph.detail(fit) Warning message: data length [37] is not a sub-multiple or multiple of the number of rows [12] in matrix Can anyone suggest why it does not work? I use R 2.1.1 with Windows XP Thanks a lot. Zhen Zhang __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Reading data from a serial port
On 13-Sep-05 vittorio wrote: I need to read data from from a medical appliance via the serial port. This medical appliance produces streams of set data at regular intervals. What commands, packages are available for this purpose? Vittorio Have a look at ?scan. You will have to do several things which depend on your hardware setup, your operating system, the behaviour of your medical applicance, and how you want to handle the data as it comes through. Some of this can be worked out from ?scan; the rest is up to you! Example: On my Linux machine here, the serial port at the back is /dev/ttyS0. I have used 'minicom' to set its data parameters to 4800 baud, 7-bit data, space parity, 1 stop bit (4800 7S1). Next, I have connected my GPS gadget (which has a serial output in ASCII text format at the above characteristics) to the serial port. Then, in R (with permissions on /dev/ttyS0 set to allow user read/write, namely rw-rw-rw-), in R I have executed, for example, scan(file=/dev/ttyS0,n=1,what=character) Read 1 items [1] @050913192752N5228545E00023023G007-4END which tells me that it is 2005/09/13 at 19:27:52 UTC, that I am at 52deg 28.545minN and 000deg 23.023min E, that I have a Good stellite fix, have a potential horizontal position error of 007 metres, am at .4 metres below sea level, and am moving at 000.0m/s Eastwards, 000.0m/s Northwards, and 00.00m/s Downwards. (Illustrating that such data is parsed by position; 'scan' does not seem to have a mechanism for splitting a line into fields by position, but it can be done after reading by using 'substr'). That command read just one line, so by repeating the command I can read a line at a time, do something with it, read the next ... Again, scan(file=/dev/ttyS0,n=5,what=character) Read 5 items [1] @050913191942N5228544E00023023G010-1ENU0001 [2] @050913191943N5228544E00023023G010-1ENU0001 [3] @050913191944N5228544E00023023G010-1ENU0001 [4] @050913191945N5228544E00023023G010-1ENU0001 [5] @050913191946N5228544E00023023G010-1ENU0001 reads a batch of lines, which can be assigned to a vector. Variants on this depend on what data format your apparatus puts out, and on what you want to do. In particular, if you want to process the output in real time, then probably you are best off reading a line at a time. But if you simply want to store a batch of lines for later processing, then set a (possibly large) number of lines to be read at a time. An so on. Hoping this helps, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 13-Sep-05 Time: 20:26:09 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Floating-point arithmetic
On 13-Sep-05 Ted Harding wrote: [..] Except, perhaps, from people (like me) who had not read that FAQ -- and who knows what legions these may be? ;) Ted. Apologies that people may have received two copies of the above message. When I first sent it there was a bounce on the grounds that the ISP's mailrouter IP was blacklisted, so I assumed it had failed to be delivered and so re-sent it. Best wishes, Ted. E-Mail: (Ted Harding) [EMAIL PROTECTED] Fax-to-email: +44 (0)870 094 0861 Date: 13-Sep-05 Time: 19:01:37 -- XFMail -- __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] inconsistant decimal marker with write.table
Hi, My problem does not happen all the time, nor with all files I save to csv format. I can send my test file (format rda or csv) to whoever would like to replicate (and hopefully explain) my problem. In short, I have a dataset with mostly numerical variables. One of my variable is called pfi2 and is definitely numerical, as shown by this: summary(test$pfi2) Min. 1st Qu. MedianMean 3rd Qu.Max. 0.0 0.0 0.0 0.01208 0.01500 0.08900 Yet, when I export to a text file and asking for comma as the decimal separator, I get a period as the separator for this variable, whereas all the other variables have the desired comma as separator. write.table(test, out1.csv, sep = ;, dec = ,, row.names = F, col.names = TRUE) write.csv2(test, out2.csv) First 5 lines of out1.csv: trait;tfi;sto_wt;pfi2;pfi_st;focc;sed;mob;date;latitu de;longitud;hre_deb;temp_fon;strate;lat.km;long.km;temp_.2 5C 10;0,764;5,1;0.007;0,213;0,143;0,048;0,095;05/08/99; 47,49;-58,9267;20:11;4,9;302;-167,7912;230,761439786593;4,88 106;0,566;3,3;0.089;4,762;0,25;0;0,25;14/08/99; 49,84;-59,655;23:25;4,4;814;93,34084;168,052052432345;4,38 110;1,517;8,3;0.003;0,172;0,25;0;0;15/08/99; 49,88667;-60,2167;04:57;0,3;833;98,526770403;127,674990442535;0,38 111;1,232;7,5;0.016;1,309;0,25;0;0;15/08/99;49,84;-60,1617;06:14; 0,1;833;93,34084;131,739909589075;0,12 I'm sorry but I wanted to make this lighter by removing more variables from my original dataset, but the problem disappeared, so I had to keep these variables to show you the problem SOMETIMES happen. You'll notice that the 4th variable has periods for decimal markers. The write.csv2 command produced the same problem. With other files I sometimes get commas for all variables, sometimes I get more than one variable with periods. It is frustrating. So let me know if you'd like the data file, Sincerely, Denis Chabot platform powerpc-apple-darwin7.9.0 arch powerpc os darwin7.9.0 system powerpc, darwin7.9.0 status major2 minor1.1 year 2005 month06 day 20 language R __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] coxph.detail() does not work
On Tue, 13 Sep 2005, Zhen Zhang wrote: Hello everyone, I tried to use coxph.detail() to get the hazard function. But a warning messge always returns to me, even in the example provided by its help document: ?coxph.detail fit - coxph(Surv(futime,fustat) ~ age + rx + ecog.ps, ovarian, x=TRUE) fitd - coxph.detail(fit) Warning message: data length [37] is not a sub-multiple or multiple of the number of rows [12] in matrix Can anyone suggest why it does not work? It does work. That's a warning, not an error. If you want to know why the warning is there, it's because the code turns a 37-element vector into a 12x3 matrix. This drops the last element. In S-PLUS, and in some older versions of R, there is no warning, but in current R there is a warning. The answer is the same, though. -thomas __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] is library loaded
Dear Omar, The following function tests whether a package is in the search path (with the package name given in quotes): packageLoaded - function(name) 0 != length(grep(paste(^package:, name, $, sep=), search())) I hope this helps, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 2:09 PM To: r-help@stat.math.ethz.ch Subject: [R] is library loaded Is there a way to test if a library has been loaded? is.loaded does not give me what I want, I am looking to say: if loaded(Rdbi) dbSendQuery(conn, q) if loaded(RODBC) sqlQuery(conn, q) I need this to support both unix and windows platforms as I could not find a windows distribution for RdbiPgSQL. I am using R 2.1.0 and postgresql. I will be connecting to the database using Rdbi and RdbiPgSQL and have other developers using windows connect with RODBC, unless someone can suggest a better solution. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] what OS
Liaw, Andy wrote: From: Sundar Dorai-Raj Omar Lakkis wrote: How can I determine whT OS I am running under? if WINDOWS do this if LINUX do that Hi, Omar, Look at version$os. # windows version$os [1] mingw32 # linux version$os [1] linux-gnu Or see ?.Platform. Yes, please follow Andy and use .Platform, and in particular nothing else for programming! It is *not* guaranteed that on Windows version$os == mingw32. Uwe Ligges Andy HTH, --sundar __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] Anyone have any code for importing data from NAMCS?
The National Ambulatory and Medical Care Survey is a free data set from the CDC that I'd like to analyze using the Survey package in R. Before I dive in, though, it occurred to me that someone may already have gone to the trouble of writing code that will bring in the data and assign the variable names and value labels. This is a big file, so doing it from scratch will take quite a bit of time... Just hoping I can avoid re-inventing the wheel! Anyone out there interested in throwing me a rope? Thanks! -- --- David L. Van Brunt, Ph.D. mailto:[EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] is library loaded
Hi, Almost surely this is a bad name. With the advent of name spaces it is important to distinguish between loading and attaching. This function tests for attached packages. To test for loaded packages we already have loadedNamespaces. Best wishes, Robert John Fox wrote: Dear Omar, The following function tests whether a package is in the search path (with the package name given in quotes): packageLoaded - function(name) 0 != length(grep(paste(^package:, name, $, sep=), search())) I hope this helps, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 2:09 PM To: r-help@stat.math.ethz.ch Subject: [R] is library loaded Is there a way to test if a library has been loaded? is.loaded does not give me what I want, I am looking to say: if loaded(Rdbi) dbSendQuery(conn, q) if loaded(RODBC) sqlQuery(conn, q) I need this to support both unix and windows platforms as I could not find a windows distribution for RdbiPgSQL. I am using R 2.1.0 and postgresql. I will be connecting to the database using Rdbi and RdbiPgSQL and have other developers using windows connect with RODBC, unless someone can suggest a better solution. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Robert Gentleman, PhD Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M2-B876 PO Box 19024 Seattle, Washington 98109-1024 206-667-7700 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] logistic regression with nominal predictors
(Sorry for obvious mistakes, as I am quite a newby with no Statistics background). My question is going to be what is the gain of logistic regression over odds ratios when none of the input variables is continuous. My experiment: Outcome: ordinal scale, ``quality'' (QUA=1,2,3) Predictors: ``segment'' (SEG) and ``stress'' (STR). SEG is nominal scale with 24 levels, and STR is dychotomous (0,1). Considering the outcome continuous, two-way ANOVA with aov(as.integer(QUA) ~ SEG * STR) doesn't find evidence of interaction between SEG and STR, and they are significant on their own. This is the result that we would expect from clinical knowledge. I use xtabs(~QUA+SEG, data=data2.df, subset=STR==0) xtabs(~QUA+SEG, data=data2.df, subset=STR==0) for the contingency tables. There are zero cells, and for some values of SEG, there is only one none-zero cell, i.e. some values of SEG determine the output with certainty. So initially I was thinking of a proportional odds logistic regression model, but following Hosmer and Lemeshow [1], zero cells are problematic. So I take out of the data table the deterministic values of SEG, and I pool QUA=2 and QUA=3, and now I have a dychotomous outcome (QUA = Good/Bad) and no zero cells. The following model doesn't find evidence of interaction glm(QUA ~ STR * SEG, data=data3.df, family=binomial) so I go for glm(QUA ~ STR + SEG, data=data3.df, family=binomial) (I suppose that what glm does is to create design variables for SEG, where 0 0 ... 0 is for the first value of SEG, 1 0 ... 0 for the second value, 0 1 0 ... 0 for the third, etc). Coefficients: Estimate Std. Error z value Pr(|z|) (Intercept) -1.085e+00 1.933e-01-5.614 1.98e-08 *** STR.L2.112e-01 6.373e-02 3.314 0.000921 *** SEGP2C.MI -9.869e-01 3.286e-01-3.004 0.002669 ** SEGP2C.AI -1.306e+00 3.585e-01-3.644 0.000269 *** SEGP2C.AA -1.743e+00 4.123e-01-4.227 2.37e-05 *** [shortened] SEGP4C.ML -5.657e-01 2.990e-01-1.892 0.058485 . SEGP4C.BL -2.908e-16 2.734e-01 -1.06e-15 1.00 SEGSAX.MS1.092e-01 2.700e-01 0.405 0.685772 SEGSAX.MAS -5.441e-16 2.734e-01 -1.99e-15 1.00 SEGSAX.MA7.130e-01 2.582e-01 2.761 0.005758 ** SEGSAX.ML1.199e+00 2.565e-01 4.674 2.96e-06 *** SEGSAX.MP1.313e+00 2.570e-01 5.108 3.26e-07 *** SEGSAX.MI8.865e-01 2.569e-01 3.451 0.000558 *** --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 3462.0 on 3123 degrees of freedom Residual deviance: 3012.6 on 3101 degrees of freedom AIC: 3058.6 Number of Fisher Scoring iterations: 6 Even though some coefficients have no evidence of statistical significance, the model requires them from a clinical point of view. At this point, the question would be how to interpret these results, and what advantage they offer over odds ratios. From [1] I can understand that in the case of a dychotomous and a continuous predictor, you can adjust for the continuous variable. But when all predictors are dychotomous (due to the design variables), I don't quite see the effect of adjustment. Wouldn't it be better just to split the data in two groups (STR=0 and STR=1), and instead of using logistic regression, use odds ratios for each value of SEG? Cheers, Ramón. [1] D.W. Hosmer and S. Lemeshow. ``Applied Logistic Regression''. John-Wiley. 2000. -- Ramón Casero Cañas web:http://www.robots.ox.ac.uk/~rcasero/ __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Reading data from a serial port
Alle 21:26, martedì 13 settembre 2005, Ted Harding ha scritto: ... Have a look at ?scan. You will have to do several things which depend on your hardware setup, your operating system, the behaviour of your medical applicance, and how you want to handle the data as it comes through. Some of this can be worked out from ?scan; the rest is up to you! Example: On my Linux machine here, the serial port at the back is /dev/ttyS0. I have used 'minicom' to set its data parameters to 4800 baud, 7-bit data, space parity, 1 stop bit (4800 7S1). Next, I have connected my GPS gadget (which has a serial output in ASCII text format at the above characteristics) to the serial port. Then, in R (with permissions on /dev/ttyS0 set to allow user read/write, namely rw-rw-rw-), in R I have executed, for example, scan(file=/dev/ttyS0,n=1,what=character) Read 1 items [1] @050913192752N5228545E00023023G007-4END which tells me that it is 2005/09/13 at 19:27:52 UTC, that I am at 52deg 28.545minN and 000deg 23.023min E, that I have a Good stellite fix, have a potential horizontal position error of 007 metres, am at .4 metres below sea level, and am moving at 000.0m/s Eastwards, 000.0m/s Northwards, and 00.00m/s Downwards. (Illustrating that such data is parsed by position; 'scan' does not seem to have a mechanism for splitting a line into fields by position, but it can be done after reading by using 'substr'). That command read just one line, so by repeating the command I can read a line at a time, do something with it, read the next ... . Again, scan(file=/dev/ttyS0,n=5,what=character) Read 5 items [1] @050913191942N5228544E00023023G010-1ENU0001 [2] @050913191943N5228544E00023023G010-1ENU0001 [3] @050913191944N5228544E00023023G010-1ENU0001 [4] @050913191945N5228544E00023023G010-1ENU0001 [5] @050913191946N5228544E00023023G010-1ENU0001 reads a batch of lines, which can be assigned to a vector. Variants on this depend on what data format your apparatus puts out, and on what you want to do. In particular, if you want to process the output in real time, then probably you are best off reading a line at a time. But if you simply want to store a batch of lines for later processing, then set a (possibly large) number of lines to be read at a time. An so on. Hoping this helps, Thanks, it helps! But Ted, how do you let R know the parameters of the serial connection (e.g. 4800 7S1) ? Ciao Vittorio __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] is library loaded
Dear Robert, packageLoaded() may well be a bad name but loadedNamespaces() won't detect a package without a namespace. It therefore seemed safe to me to check the path, which would include both packages with and without namespaces. With respect to loading and attaching, I thought that library() both loaded a package (with or without a namespace) and attached it to the search path, but I must admit that I'm easily confused about these distinctions. Regards, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: Robert Gentleman [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 13, 2005 3:53 PM To: John Fox Cc: [EMAIL PROTECTED]; r-help@stat.math.ethz.ch Subject: Re: [R] is library loaded Hi, Almost surely this is a bad name. With the advent of name spaces it is important to distinguish between loading and attaching. This function tests for attached packages. To test for loaded packages we already have loadedNamespaces. Best wishes, Robert John Fox wrote: Dear Omar, The following function tests whether a package is in the search path (with the package name given in quotes): packageLoaded - function(name) 0 != length(grep(paste(^package:, name, $, sep=), search())) I hope this helps, John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Omar Lakkis Sent: Tuesday, September 13, 2005 2:09 PM To: r-help@stat.math.ethz.ch Subject: [R] is library loaded Is there a way to test if a library has been loaded? is.loaded does not give me what I want, I am looking to say: if loaded(Rdbi) dbSendQuery(conn, q) if loaded(RODBC) sqlQuery(conn, q) I need this to support both unix and windows platforms as I could not find a windows distribution for RdbiPgSQL. I am using R 2.1.0 and postgresql. I will be connecting to the database using Rdbi and RdbiPgSQL and have other developers using windows connect with RODBC, unless someone can suggest a better solution. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html -- Robert Gentleman, PhD Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M2-B876 PO Box 19024 Seattle, Washington 98109-1024 206-667-7700 [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] package Spcmdr
In the R Console (ver 2.1.1) I typed the command help(ppinit) and received the error message: Error in help.search(ppinit) : could not find package 'Spcmdr' After typing library(spatial) I could get help on the ppinit function. However, I have tried in vain to find any information on the Spcmdr package. This has included searching the full R search site (Jonathan Baron and U. Penn) and looking under the RGUI's and Rgeo pages. Does anyone know what the package 'Spcmdr' is and where I can find either the package or documentation about it? Larry Layne [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] package Spcmdr
Larry Layne wrote: In the R Console (ver 2.1.1) I typed the command help(ppinit) and received the error message: Error in help.search(ppinit) : could not find package 'Spcmdr' That sounds like a local installation problem. Perhaps you had a package with that name installed at some point, and then deleted it, but didn't update the indices? It probably has nothing to do with ppinit. Duncan Murdoch After typing library(spatial) I could get help on the ppinit function. However, I have tried in vain to find any information on the Spcmdr package. This has included searching the full R search site (Jonathan Baron and U. Penn) and looking under the RGUI's and Rgeo pages. Does anyone know what the package 'Spcmdr' is and where I can find either the package or documentation about it? Larry Layne [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] package Spcmdr
Thank you very much for the quick response! As far as I know I did not install the Spcmdr explicitly. When I installed R ver 2.1.1, I uninstalled the previous version of R and deleted the R directory and all directories under R in C:\Program Files. (BTW, I am using the windows binaries of R). In the R Console, if I click on the Packages pull-down menu and select Load Packages..., Spcmdr does appear in the list of packages. Selecting this I get an error that says there is no package called 'Spcmdr'. Should I be directing my question to a windows mailing list? --On Tuesday, September 13, 2005 6:15 PM -0400 Duncan Murdoch [EMAIL PROTECTED] wrote: Larry Layne wrote: In the R Console (ver 2.1.1) I typed the command help(ppinit) and received the error message: Error in help.search(ppinit) : could not find package 'Spcmdr' That sounds like a local installation problem. Perhaps you had a package with that name installed at some point, and then deleted it, but didn't update the indices? It probably has nothing to do with ppinit. Duncan Murdoch After typing library(spatial) I could get help on the ppinit function. However, I have tried in vain to find any information on the Spcmdr package. This has included searching the full R search site (Jonathan Baron and U. Penn) and looking under the RGUI's and Rgeo pages. Does anyone know what the package 'Spcmdr' is and where I can find either the package or documentation about it? Larry Layne [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] package Spcmdr
Larry Layne wrote: Thank you very much for the quick response! As far as I know I did not install the Spcmdr explicitly. When I installed R ver 2.1.1, I uninstalled the previous version of R and deleted the R directory and all directories under R in C:\Program Files. (BTW, I am using the windows binaries of R). In the R Console, if I click on the Packages pull-down menu and select Load Packages..., Spcmdr does appear in the list of packages. Selecting this I get an error that says there is no package called 'Spcmdr'. Should I be directing my question to a windows mailing list? That sounds like you have a messed up your R_HOME/library directory. There's apparently a subdirectory called Spcmdr, with a file named DESCRIPTION in it, but it's not a correctly installed R package. No idea how it would have got there. Duncan Murdoch --On Tuesday, September 13, 2005 6:15 PM -0400 Duncan Murdoch [EMAIL PROTECTED] wrote: Larry Layne wrote: In the R Console (ver 2.1.1) I typed the command help(ppinit) and received the error message: Error in help.search(ppinit) : could not find package 'Spcmdr' That sounds like a local installation problem. Perhaps you had a package with that name installed at some point, and then deleted it, but didn't update the indices? It probably has nothing to do with ppinit. Duncan Murdoch After typing library(spatial) I could get help on the ppinit function. However, I have tried in vain to find any information on the Spcmdr package. This has included searching the full R search site (Jonathan Baron and U. Penn) and looking under the RGUI's and Rgeo pages. Does anyone know what the package 'Spcmdr' is and where I can find either the package or documentation about it? Larry Layne [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] package Spcmdr
That sounds like you have a messed up your R_HOME/library directory. There's apparently a subdirectory called Spcmdr, with a file named DESCRIPTION in it, but it's not a correctly installed R package. No idea how it would have got there. Yes there is and now I remember putting it there, although there is no such package. Sorry for wasting your time with my confusion. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] mvpart: 'weights' argument
Hallo dear R-users! Does anyone know if it's possible to use the weights argument (available in rpart() ) in mvpart() function too?Thanks a lot Simone Vantini -- Simone Vantini MOX (Modelling and Scientific Computing) Dipartimento di Matematica F. Brioschi Politecnico di Milano P.za Leonardo da Vinci, 32 20133 Milano (Italy) tel: +39 02 2399 4604 email: [EMAIL PROTECTED] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] package Spcmdr
Larry Layne wrote: That sounds like you have a messed up your R_HOME/library directory. There's apparently a subdirectory called Spcmdr, with a file named DESCRIPTION in it, but it's not a correctly installed R package. No idea how it would have got there. Yes there is and now I remember putting it there, although there is no such package. Sorry for wasting your time with my confusion. Generally if you're writing your own package, it's a good idea to do it in a directory separate from R, then use Rcmd install pkg to install it. If it's missing something it won't install, and you'll avoid problems like this. Duncan Murdoch __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Reading data from a serial port
On 13-Sep-05 vittorio wrote: Alle 21:26, martedì 13 settembre 2005, Ted Harding ha scritto: ... Have a look at ?scan. You will have to do several things which depend on your hardware setup, your operating system, the behaviour of your medical applicance, and how you want to handle the data as it comes through. Some of this can be worked out from ?scan; the rest is up to you! Example: On my Linux machine here, the serial port at the back is /dev/ttyS0. I have used 'minicom' to set its data parameters to 4800 baud, 7-bit data, space parity, 1 stop bit (4800 7S1). Next, I have connected my GPS gadget (which has a serial output in ASCII text format at the above characteristics) to the serial port. Then, in R (with permissions on /dev/ttyS0 set to allow user read/write, namely rw-rw-rw-), in R I have executed, for example, scan(file=/dev/ttyS0,n=1,what=character) Read 1 items [1] @050913192752N5228545E00023023G007-4END [...] Hoping this helps, Thanks, it helps! But Ted, how do you let R know the parameters of the serial connection (e.g. 4800 7S1) ? Ciao Vittorio I didn't, as it happens -- I used the 'minicom' program to set the serial port to these characteristics before starting the business with 'scan' in R, so it was an external operation. In fact I have a ready-made configuration file for this purpose called /etc/minirc.etrex which contains # Machine-generated file - use minicom -s to change parameters. pr port /dev/ttyS0 pu baudrate 4800 pu bits 7 pu parity S pu stopbits 1 so when I run mincom etrex the serial port is set to those parameters. Unfortunately, minicom does not have an option causing it to quit after initialising the serial port, so it has to be killed explicitly, since otherwise it will continue reading the serial port and thereby steal data from R! This I do by pressing Ctrl-C on the keyboard, but it could be wrapped in a script which identified minicom's process ID and then sent a 'kill -15 pid' to it. If I did it that way, say the script were called set.etrex. Then, using the 'system' command system(set.etrex) I could set it up from within an R session. On Unix/Linux systems there is a program 'setserial' which can be used to set up the serial port, but it seems it can only be used to set baud rate (and in a somewhat obscure way); I've seen nothing which indicates how to use it to set data bits, parity, and stop bits. So as far as I know 'minicom' is the only program I have available which can do the lot (short of getting out a serial port manual and writing a C program which will talk directly to the hardware port!). If other readers know better, I'd be very grateful to hear of it! (Come to think of it, that's just the sort of question to ask my mates on Linux lists ... ) Once that was done (and checked by reading a few lines of output to screen by 'cat /dev/ttyS0', closed by Ctrl-C) I then went into R, and did the things like scan(file=/dev/ttyS0,n=1,what=character) Since the serial port was already set up, and receiving the output from the instrument, all R was doing was reading this from the serial port. Now all this of course is written in terms of a Linux system, and we don't know yet what sort of system you are using. On Windows, I find one can navigate by hand through My Computer - Control Panel - System - Device Manager - Ports - Communications Port (COM1) - Port settings where again one can manually set Bits per second, Data bits, Stop bits and Flow control but, again, I don't know of a program which can be used to set these non-manually. Anyway, the summary of the way I did it is to set the serial port parameters independently of R, connect the device and get it sending data, and then within R use 'scan' to read the port. Initially one may capture an incomplete first line from the port, since R will start with whatever is sitting on the serial port's data lines when 'scan' is invoked. However, I have rarely seen this and indeed, even at 4800 baud, it is not very likely. The GPS device sends a line of data for every second of time, consisting of 57 ASCII characters including the terminal CRLF, which is a total of 9*57 = 413 bits at 7S1 taking 513/4800 approx= 1/10 seconds, so it is only about 1/10 chance of catching an incomplete first line. However, there are various ways you can arrange to avoid such incomplete data being processed: a) Get R reading the serial port before the device starts sending data. The R will already be looking for data before the first line starts to come through; b) Simply dump the first line read by R; c) Read it anyway, but if its length (as a character string) is too short, then dump it (use the R function 'nchar' for this); This is always the issue when dealing with hardware interfaces: mere logic is not enough -- you have to plan how to cope with unruly behaviour as well!
[R] R CMD INSTALL -l /path/to/library packagename/ fixed
Background: OS: Linux Mandrake 10.1 release: R 2.1.1 editor: GNU Emacs 21.3.2 front-end: ESS 5.2.3 - Colleagues The environment variables checked with Sys.getenv() all appeared to be in the right place. The easy fix was to copy /usr/lib/R into /usr/local/lib/R then run the R CMD INSTALL packagename then just copy the package subdirectory back to /usr/lib/R/library A cheat fix, but it worked. Sam -Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tuesday, 13 September 2005 3:41 PM To: McClatchie, Sam (PIRSA-SARDI) Cc: r-help@stat.math.ethz.ch Subject: Re: [R] R CMD INSTALL -l /path/to/library packagename I don't use Linux but perhaps you should check what environment variables you have defined and also if you have anything in your *.site files, if you have them, that could cause that. Sam McClatchie, Biological oceanography South Australian Aquatic Sciences Centre PO Box 120, Henley Beach 5022 Adelaide, South Australia email [EMAIL PROTECTED] Cellular: 0431 304 497 Telephone: (61-8) 8207 5448 FAX: (61-8) 8207 5481 Research home page http://www.members.iinet.net.au/~s.mcclatchie/ /\ ...xX(° °)Xx / \\ (((° (((° ...xX(°O°)Xx __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] matrix calculation?
Hi, I am wondering if anybody has a simpler solution to calculate the following: ma a b [1,] 1 4 [2,] 2 3 [3,] 3 2 [4,] 4 5 pa [,1] [,2] [,3] [,4] a1234 b4325 diag(ma%*%pa) [1] 17 13 13 41 I only want to calculate the product of the row of the first matrix and the corresponding column of the second matrix (instead of other columns). However, what I did was to multiply these two and then extract the diagonal components. Is there a simpler way to do this in R? (ma and pa may not be the same matrix.) Thanks! __ Donate to the Hurricane Katrina relief effort. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] is library loaded
On 13 Sep 2005, [EMAIL PROTECTED] wrote: packageLoaded() may well be a bad name but loadedNamespaces() won't detect a package without a namespace. Right, that's a problem. It therefore seemed safe to me to check the path, which would include both packages with and without namespaces. With respect to loading and attaching, I thought that library() both loaded a package (with or without a namespace) and attached it to the search path, but I must admit that I'm easily confused about these distinctions. As I understand it, library(foo) will load and attach package foo. If foo has a namespace, some of foo's dependencies may get loaded but not attached. This is only possible if said dependencies also use namespaces. So it is possible for a package to be loaded and not attached. In this case, the loaded package is not visible via search(), but is visible via loadedNamespaces() since only packages with namespaces can be loaded and not attached. Clear as mud? HTH, + seth __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] matrix calculation?
Try this: rowSums(ma * t(pa)) On 9/13/05, Cunningham Kerry [EMAIL PROTECTED] wrote: Hi, I am wondering if anybody has a simpler solution to calculate the following: ma a b [1,] 1 4 [2,] 2 3 [3,] 3 2 [4,] 4 5 pa [,1] [,2] [,3] [,4] a1234 b4325 diag(ma%*%pa) [1] 17 13 13 41 I only want to calculate the product of the row of the first matrix and the corresponding column of the second matrix (instead of other columns). However, what I did was to multiply these two and then extract the diagonal components. Is there a simpler way to do this in R? (ma and pa may not be the same matrix.) Thanks! __ Donate to the Hurricane Katrina relief effort. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html