similar to: R 1.9.0 and pred.rpart

Displaying 20 results from an estimated 9000 matches similar to: "R 1.9.0 and pred.rpart"

2008 Aug 28
2
Defining environments within functions
How can I define environments within a function so that they are visible to calls to a sub-function? I have defined an objective function, ProfileErr = function(params,...) which I would like to optimize using standard routines (optim, nlminb,....) but which contains auxiliary variables which need to be updated along with params. No optimization routine in R that I have found has facilities
2009 Aug 28
2
R CMD check does not recognize S4 functions inside other functions?
I am developing a new R package and am now checking it for submission to CRAN. The some functions in the package make use of the sparse matrix routines in the package 'Matrix'. When these are loaded in R, they create no problems. However, when running R CMD check, I run into the following error in executing the examples in a .rd file: > DD = Matrix(diag(1,200),sparse=TRUE) >
2007 Jul 14
3
How to read many files at one time?
I want to load many files in the R. The names of the files are "Sim1.txt", " Sim2.txt", "Sim3.txt", "Sim4.txt", "Sim5.txt" and so on. Can I read them at one time? What should I do? I can give the same names in R. Thanks. For example: > tst=paste("Sim",1:20,".txt",sep="") # the file names > tst [1]
2008 Jul 22
2
rpart$where and predict.rpart
Hello there. I have fitted a rpart model. > rpartModel <- rpart(y~., data=data.frame(y=y,x=x),method="class", ....) and can use rpart$where to find out the terminal nodes that each observations belongs. Now, I have a set of new data and used predict.rpart which seems to give only the predicted value with no information similar to rpart$where. May I know how
2012 Mar 16
2
Elegant Code
Hi, Can anyone help to write a more elegant version of my code? I am sure this can be put into a loop but I am having trouble creating the objects b1,b2,b3,...,etc. b1 <- rigamma(50,1,1) theta1 <- rgamma(50,0.5,(1/b1)) sim1 <- rpois(50,theta1) b2 <- rigamma(50,1,1) theta2 <- rgamma(50,0.5,(1/b2)) sim2 <- rpois(50,theta2) b3 <- rigamma(50,1,1) theta3 <-
2008 Aug 22
1
R CMD check problem
I have a query after finding an error running Rtools on a Windows machine. I am trying to build an update to the R fda library using Rtools27 under Windows XP Pro. This is the current fda library on RForge: http://r-forge.r-project.org/projects/fda Following R CMD build, R CMD check produces the following error in 00Install.out: installing R.css in F:/work/RForge/fda.Rcheck make: ***
2007 Feb 15
2
Does rpart package have some requirements on the original data set?
Hi, I am currently studying Decision Trees by using rpart package in R. I artificially created a data set which includes the dependant variable (y) and a few independent variables (x1, x2...). The dependant variable y only comprises 0 and 1. 90% of y are 1 and 10% of y are 0. When I apply rpart to it, there is no splitting at all. I am wondering whether this is because of the
2007 Dec 19
1
library(rpart) or library(tree)
Hi, I have a problem with library (rpart) (and/or library(tree)). I use a data.frame with variables "pnV22" (observation: 1, 0 or yes, no) "JTemp" (mean temperature) "SNied" (summer rain) I used function "rpart" to build a model: library(rpart) attach(data.frame) result <- rpart(pnV22 ~ JTemp + SNied) I got the following tree: n=55518 (50
2007 Feb 20
1
text.rpart for the "class" method doesn't act on label="yprob"
Hello All, Am I misreading the documentation? The text.rpart documentation says: "label a column name of x$frame; values of this will label the nodes. For the "class" method, label="yval" results in the factor levels being used, "yprob" results in the probability of the winning factor level being used, and ?specific yval level? results in the probability of
2012 May 15
1
caret: Error when using rpart and CV != LOOCV
Hy, I got the following problem when trying to build a rpart model and using everything but LOOCV. Originally, I wanted to used k-fold partitioning, but every partitioning except LOOCV throws the following warning: ---- Warning message: In nominalTrainWorkflow(dat = trainData, info = trainInfo, method = method, : There were missing values in resampled performance measures. ----- Below are some
2018 Aug 14
2
Xenial rpart package on CRAN built with wrong R version?
Hello, I just upgraded my Ubuntu Xenial system to R 3.5.1 (from 3.4.?) by changing the sources.list entry and doing an "apt-get dist-upgrade". Everything works except loading the rpart package in R: > library(rpart) Error: package or namespace load failed for ?rpart?: package ?rpart? was installed by an R version with different internals; it needs to be reinstalled for use with
2012 May 15
2
rpart - predict terminal nodes for new observations
Dear useRs: Is there a way I could predict the terminal node associated with a new data entry in an rpart environment? In the example below, if I had a new data entry with an AM of 5, I would like to link it to the terminal node 2. My searches led to http://tolstoy.newcastle.edu.au/R/e4/help/08/07/17702.html but I do not seem to be able to operationalize Professor Ripley's suggestions. Many
2009 Jun 09
3
rpart - the xval argument in rpart.control and in xpred.rpart
Dear R users, I'm working with the rpart package and want to evaluate the performance of user defined split functions. I have some problems in understanding the meaning of the xval argument in the two functions rpart.control and xpred.rpart. In the former it is defined as the number of cross-validations while in the latter it is defined as the number of cross-validation groups. If I am
2014 Aug 13
1
Request to review a patch for rpart
Dear list For my work, it would be helpful if rpart worked seamlessly with an empty model: library(rpart); rpart(formula=y~0, data=data.frame(y=factor(1:10))) Currently, an unrelated error (originating from na.rpart) is thrown. At some point in the near future, I'd like to release a package to CRAN which uses rpart and relies on that functionality. I have prepared a patch (minor
2001 Aug 12
2
rpart 3.1.0 bug?
I just updated rpart to the latest version (3.1.0). There are a number of changes between this and previous versions, and some of the code I've been using with earlier versions (e.g. 3.0.2) no longer work. Here is a simple illustration of a problem I'm having with xpred.rpart. iris.test.rpart<-rpart(iris$Species~., data=iris[,1:4], parms=list(prior=c(0.5,0.25, 0.25))) + ) >
2004 Mar 19
2
How to collect trees grown by rpart
Jonathan, Try making a list instead of an array. See ?list. Also, did you look into random forests? I'm not sure what you want to do, but there might be methods there to do some of the work for you. Sean On 3/19/04 1:12 PM, "Jonathan Williams" <jonathan.williams at pharmacology.oxford.ac.uk> wrote: > I would like to collect the trees grown by rpart fits in an array,
2003 Jun 02
1
Ploting rpart objects / namespace problems
I've written a small adaptation of the text.rpart function of the rpart package to better suite my tree presentation needs (I basically left the code untouched, only changing some numbers relating to label positioning). When I changed to version 1.7.0 this function stopped working printing the error : couldn't find function "rpartco" As far as I understand this has to do
2006 Aug 09
2
How to draw the decision boundaries for LDA and Rpart object
Hello useR, Could you please tell me how to draw the decision boundaries in a scatterplot of the original data for a LDA or Rpart object. For example: > library(rpart) >fit.rpart <- rpart(as.factor(group.id)~., data=data.frame(Data) ) How can I draw the cutting lines on the orignial Data? Or is there any built in functions that can read the rpart object 'fit.rpart' to do
2005 Sep 24
1
rpart Error in yval[, 1] : incorrect number of dimensions
I tried using rpart, as below, and got this error message "rpart Error in yval[, 1] : incorrect number of dimensions". Thinking it might somehow be related to the large number of missing values, I tried using complete data, but with the same result. Does anyone know what may be going on, and how to fix it? I have traced two similar error messages in the Archive, but following the
2004 Sep 06
1
rpart problem
Dear all, I am having some trouble with getting the rpart function to work as expected. I am trying to use rpart to combine levels of a factor to reduce the number of levels of that factor. In exploring the code I have noticed that it is possible for chisq.test to return a statistically significant result whilst the rpart method returns only the root node (i.e. no split is made). The following