[R] rpart package: How can I save print(rpart)

2014-11-13 Thread Karim Mezhoud
Hi, the print of rpart fitting gives the summary of tree I would like to save the console text of: fit - rpart(formula, data) summary - print(fit) when I look in summary I did not find the same thing as in print(rpart) [1] Clinical Data exists [1] merging samples from Clinical and

[R] rpart package: prp does not work with RStudio and R console

2014-11-13 Thread Karim Mezhoud
Hi, All right for rpart package but it seems there is a confusion in text function. prp is not found Error in fun() : could not find function prp Thanks Ô__ c/ /'_;kmezhoud (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ http://bioinformatics.tn/ [[alternative HTML version deleted]]

Re: [R] rpart package: How can I save print(rpart)

2014-11-13 Thread William Dunlap
Use capture.output(), as in junk - capture.output(summary(1:10)) junk [1]Min. 1st Qu. MedianMean 3rd Qu.Max. [2]1.003.255.505.507.75 10.00 cat(junk, sep=\n) Min. 1st Qu. MedianMean 3rd Qu.Max. 1.003.255.505.507.75

Re: [R] rpart package: How can I save print(rpart)

2014-11-13 Thread Karim Mezhoud
Yes Thanks! that works, but I loose the \n when I would like to save or edit it. getTextInWindows is a function that edits any text in editor. getTextInWindows(summary): without \n save (file= junk.txt, junk):without \n getTextInWindow(capture.output(cat(junk, sep = \n))) :No works Thanks

Re: [R] rpart package: How can I save print(rpart)

2014-11-13 Thread William Dunlap
Use paste(collapse=\n, junk) if you want it as a single string with \n's in it. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Nov 13, 2014 at 1:13 PM, Karim Mezhoud kmezh...@gmail.com wrote: Yes Thanks! that works, but I loose the \n when I would like to save or edit it.

Re: [R] rpart package: How can I save print(rpart)

2014-11-13 Thread Karim Mezhoud
OK thanks That works. :) Ô__ c/ /'_;kmezhoud (*) \(*) ⴽⴰⵔⵉⵎ ⵎⴻⵣⵀⵓⴷ http://bioinformatics.tn/ On Thu, Nov 13, 2014 at 10:41 PM, William Dunlap wdun...@tibco.com wrote: Use paste(collapse=\n, junk) if you want it as a single string with \n's in it. Bill Dunlap TIBCO Software

Re: [R] rpart package: why does predict.rpart require values for unused predictors?

2012-08-02 Thread Jean V Adams
Jason, In the help file for predict.rpart it says, The predictors referred to in the right side of formula(object) must be present by name in newdata. ?predict.rpart So, that's just the way it is. There are a couple ways to work around this, if you wish. You could create a data frame with

Re: [R] rpart package: why does predict.rpart require values for unused predictors?

2012-08-02 Thread Jason Roberts
Jean, Thanks for your quick reply and suggestions! In the help file for predict.rpart it says, The predictors referred to in the right side of formula(object) must be present by name in newdata. I was aware of that statement from the help file. I wondered about the reason for that

[R] rpart package: why does predict.rpart require values for unused predictors?

2012-08-01 Thread Jason Roberts
After fitting and pruning an rpart model, it is often the case that one or more of the original predictors is not used by any of the splits of the final tree. It seems logical, therefore, that values for these unused predictors would not be needed for prediction. But when predict() is called on

[R] rpart package

2010-08-12 Thread Olga Shaganova
Hi, I am a brand new user and may be my question is too simple. I have R on our (not Unix) server. I am trying to build a decision tree and the error message says couldn't find function rpart. Does it mean I have to ask our server guy to install an additional package? Thank you, Olga

Re: [R] rpart package

2010-08-12 Thread Erik Iverson
Olga Shaganova wrote: Hi, I am a brand new user and may be my question is too simple. I have R on our (not Unix) server. I am trying to build a decision tree and the error message says couldn't find function rpart. Does it mean I have to ask our server guy to install an additional package?

Re: [R] rpart package

2010-08-12 Thread Boris Reiss
Hi Olga, not directly related to your question. We have also a server installation and subsequently our IT department determines which version and packages I can use on R. A few days ago I have switched to R-portable. Works without any problems from my USB stick on any locked-for-installation