similar to: model.frame error with formula=~1 and na.action=na.fail (PR#14066)

Displaying 20 results from an estimated 10000 matches similar to: "model.frame error with formula=~1 and na.action=na.fail (PR#14066)"

2006 Feb 16
2
getting probabilities from SVM
I am using SVM to classify categorical data and I would like the probabilities instead of the classification. ?predict.svm says that its only enabled when you train the model with it enabled, so I did that, but it didn't work. I can't even get it to work with iris. The help file shows that probability = TRUE when training the model, but doesn't show an example. Then I try to
2007 Apr 29
1
randomForest gives different results for formula call v. x, y methods. Why?
Just out of curiosity, I took the default "iris" example in the RF helpfile... but seeing the admonition against using the formula interface for large data sets, I wanted to play around a bit to see how the various options affected the output. Found something interesting I couldn't find documentation for... Just like the example... > set.seed(12) # to be sure I have
2004 Sep 14
1
how to use update if method for formula is not in namespace?
Dear R-devel, I've noticed that if the method for formula is not exported in NAMESPACE, then update() would fail. As an example: > library(e1071) > data(iris) > iris.svm <- svm(Species ~ ., data=iris) > update(iris.svm) Error in eval(expr, envir, enclos) : couldn't find function "svm.formula" The same thing happens with randomForest, because
2012 Jun 27
4
formula version of sunflowerplot() fails when axis label specified
Hello, R-help, does anybody have already a work-around for the problem that the formula version of sunflowerplot() throws an error when provided with a value for xlab (or ylab) different from NULL: > sunflowerplot( Sepal.Length ~ Sepal.Width, data = iris, xlab = "A") Error in model.frame.default(formula = Sepal.Length ~ Sepal.Width, data = iris, : variable lengths differ
2010 May 04
2
split() bug? Inconsistent Windows/Linux behavior.
I didn't see anything on this in the bug reports, and a search of the archives had lots of false positives when searching on "split" to be helpful. I don't view this as particularly interesting or useful, but wanted to report it because I stumbled on it (and don't remember ever seeing "invalid permissions" as part of a segfault).? Yes, I realize this is a silly
2006 Apr 13
3
What does "rbind(iris[,,1], iris[,,2], iris[,,3])" do?
It's in the Venables & Ripley MASS (ed 3) book in the section on principal components. The context is as follows > ir <- rbind(iris[,,1], iris[,,2], iris[,,3]) > ir.species <- factor(c(rep("s",50),rep("c",50),rep("v",50))) (then they use brush(ir) which I guess is not an R function) and then > princomp(log(ir[1:4]),cor=T) (there is no [1:4]
2008 Feb 27
2
multiple plots per page using hist and pdf
Hello, I am puzzled by the behavior of hist() when generating multiple plots per page on the pdf device. In the following example two pdf files are generated. The first results in 4 plots on one pdf page as expected. However, the second, which swaps one of the plot() calls for hist(), results in a 4 page pdf with one plot per page. How might I get the histogram with 3 other scatter
2005 Apr 07
2
axis colors in pairs plot
The following command produces red axis line in a pairs plot: pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", pch = "+", col = c("red", "green3", "blue")[unclass(iris$Species)]) Trying to fool pairs in the following way produces the same plot as above: pairs(iris[1:4], main = "Anderson's Iris Data -- 3
2012 Dec 10
3
splitting dataset based on variable and re-combining
I have a dataset and I wish to use two different models to predict. Both models are SVM. The reason for two different models is based on the sex of the observation. I wish to be able to make predictions and have the results be in the same order as my original dataset. To illustrate I will use iris: # Take Iris and create a dataframe of just two Species, setosa and versicolor, shuffle them
2012 Feb 06
1
na.action in stats::factanal() must be using formula interface and dataframe input to specify na.action?
hi, Does factanal() force the user to use the formula interface if they wish to specify an na.action? v1 <- c(1,1,1,1,1,1,1,1,NA,1,3,3,3,3,3,4,5,6) v2 <- c(1,2,1,1,1,1,2,1,2,1,3,NA,3,3,3,4,6,5) v3 <- c(3,3,3,3,3,1,1,1,1,1,1,1,1,1,1,5,4,6) v4 <- c(3,3,4,NA,3,1,1,2,1,1,1,1,2,NA,1,5,6,4) v5 <- c(1,1,1,1,1,3,3,3,3,3,1,1,1,1,1,6,4,5) v6 <- c(1,1,1,2,1,3,3,3,4,3,1,1,1,2,1,6,5,4) m1
2000 May 11
1
OpenSSH 2.1.0 under Solaris 8 ...
Compiled great, got both my RSA and DSA keys' generated for Protocol 1/2, started up fine ... try to connect and get a bunch of errors: May 11 14:01:47 iris sshd[8578]: error: Couldn't wait for child '/bin/ls -alni' completion: No child processes May 11 14:01:47 iris last message repeated 3 times May 11 14:01:47 iris sshd[8578]: error: Command '/bin/ls -alni': select()
2010 Jul 07
1
ifelse statement
Hi, I am a newbie of R, and playing with the "ifelse" statement. I have the following codes: ## first, for(i in 1:3) { for(j in 2:4) { cor.temp <- cor(iris.allnum[,i], iris.allnum[,j]) if(i==1 & j==2) corr.iris <- cor.temp else corr.iris <- c(corr.iris, cor.temp) } } this code is working fine. I also tried to perform the same thing in another way with "ifelse":
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community: I tried both of these three versions with ylim as suggested, none work: I am getting only single (pch = 16) not overlayed (pch =3) everytime. *vs 1* require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) panel.lmline(x, y, lty=4, col =
2004 Aug 21
2
more on apply on data frame
Hi R People: Several of you pointed out that using "tapply" on a data frame will work on the iris data frame. I'm still having a problem. The iris data frame has 150 rows, 5 variables. The first 4 are numeric, while the last is a factor, which has the Species names. I can use tapply for 1 variable at a time: >tapply(iris[,1],iris[,5],mean) setosa versicolor virginica
2009 May 12
1
lattice histogram for multiple variables : adjusting x axis
Hello all, I have a large data frame and I want to look at the distribution of each variable very quickly by plotting an individual histogram for each variable. I'd like to do so using lattice. Here is a small example using the iris data set: histogram(as.formula(paste("~",paste(colnames(iris[,!sapply(iris,is.factor)]),collapse="+"))),data=iris[,!sapply(iris,is.factor)])
2012 May 04
1
weird predict function error when I use naive bayes
Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. > m<- naiveBayes(iris[,1], iris[,5]) > table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs, function(v) { : Non-numeric argument to mathematical function However, when I use two predictors, there is not error any more. > m<-
2010 Oct 22
2
Random Forest AUC
Guys, I used Random Forest with a couple of data sets I had to predict for binary response. In all the cases, the AUC of the training set is coming to be 1. Is this always the case with random forests? Can someone please clarify this? I have given a simple example, first using logistic regression and then using random forests to explain the problem. AUC of the random forest is coming out to be
2012 May 05
1
what is Non-numeric argument to mathematical function in prediction ?
Hi, I tried to use naivebayes in package 'e1071'. when I use following parameter, only one predictor, there is an error. > m <- naiveBayes(iris[,1], iris[,5]) > table(predict(m, iris[,1]), iris[,5]) Error in log(sapply(attribs, function(v) { : Non-numeric argument to mathematical function However, when I use two predictors, there is not error any more. > m <-
2009 Apr 08
2
Doubt about aov and lm function... bug?
Hi, The below very strange: # a) aov function av <- aov(Sepal.Length ~ Species, data=iris) # Error in parse(text = x) : # unexpected symbol in "Sepal(Sepal.Length+Species)Length" av <- aov(iris[, 1] ~ iris[, 5]) # summary(av) # Df Sum Sq Mean Sq F value Pr(>F) # iris[, 5] 2 63.2 31.6 119 <2e-16 *** # Residuals 147 39.0 0.3 # ---
2004 Aug 19
2
Suggestion for posting guide
I have a suggestion for the posting guide. One problem with some posts is that they do not provide an example that can be reproduced. I think that many people just do not know how to easily specify some data and some technical assistance should be provided in the posting guide. If the problem depends on specific data they should be made aware, in the posting guide, of: dput(x) since that