Displaying 20 results from an estimated 1086 matches for "iris".
Did you mean:
ipis
2010 May 04
2
split() bug? Inconsistent Windows/Linux behavior.
...invalid permissions" as part of a segfault).? Yes, I realize this is
a silly example that you wouldn't actually do, but... there may be
other more interesting cases with the same problem.? The following was
R-2.10.0 on Linux (with a Windows-64 2.11.0 difference to follow
below):
> data(iris)
> split(1:nrow(iris), list(iris[,1], iris[,2]))
?*** caught segfault ***
address 0x7fc806cd3d0c, cause 'invalid permissions'
Traceback:
?1: split.default(1:nrow(iris), list(iris[, 1], iris[, 2]))
?2: split(1:nrow(iris), list(iris[, 1], iris[, 2]))
Possible actions:
1: abort (with cor...
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] in the text which is probably a typo)
>From...
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
data(iris)
iris <- iris[(iris$Species=="setosa" | iris$Species=="versicolor"),]
irisindex <- sample(1:nrow(iris), nrow(iris))
iris <- iris[irisindex,]
# Make predictions on se...
2008 Feb 27
2
multiple plots per page using hist and pdf
...d, 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 plots onto a
single pdf page?
platform powerpc-apple-darwin8.10.1
version.string R version 2.6.1 (2007-11-26)
Thanks!
Ben
###BEGIN
data(iris)
orig.par = par(no.readonly = TRUE)
pdf(file = "just_plots.pdf")
par(mfrow=c(2,2))
plot(iris$Sepal.Length, iris$Sepal.Width, main = "Plot 1")
plot(iris$Petal.Length, iris$Petal.Width, main = "Plot 2")
plot(iris$Sepal.Length, iris$Petal.Length, main = "Plot 3&q...
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...
2010 Jun 30
5
plot focus
...ions in a loop and then plotting the results by adding a
point to each of 2 charts at the end of the loop. Its very informative as
you can see the progression through time.
My problem is, if I have 2 plots, I don't know how to get the focus back to
the first plot.
layout(matrix(c(1,2)))
plot(iris[,1],col="red",) #plot1
plot(iris[,3],col="blue") #plot2
#goes on plot2
lines(iris[,2],col="pink")
#how do I put this line on plot 1
lines(iris[,4],col="black")
I tried the method below but when you switch the focus back to screen 1 the
line gets drawn n...
2008 Aug 07
6
multiple tapply
Hi folk,
I tried this and it works just perfectly
tapply(iris[,1],iris[5],mean)
but, how to obtain a single table from multiple variables?
In tapply x is an atomic object so this code doesn't work
tapply(iris[,1:4],iris[5],mean)
Thanx and great summer holidays
Gianandrea
--
View this message in context: http://www.nabble.com/multiple-tapply-tp1886806...
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
5.006...
2013 Jan 16
4
Get a percent variable based on group
Dear all, I'd like to get a percentage variable based on a group, but without creating a new data frame.
For example:
data(iris)
iris$percent <-unlist(tapply(iris$Sepal.Length,iris$Species,function(x) x/sum(x, na.rm=TRUE)))
This does not work, I should have only three standard values, respectively for setosa, versicolor, and virginica. How can I do this?
MANY THANKS,
Karine
[[alternative HTML version d...
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 = "green4")
panel.xyplot (iris$Petal.Length [subscripts],
iris$Petal.Width[subscripts], pch= 3, col = "red")
panel.lmline(iris$Petal.Le...
2011 Aug 16
3
Newbie question - struggling with boxplots
Hopefully I will not be flamed for this on the list, but I am starting out
with R and having some trouble with combining plots.
I am playing with the famous iris dataset (checking out example dataset in R
while reading through Introduction to datamining)
What I would like to do is create three graphs (combined boxplots) besides
each other for each of the three species (Setosa, Versicolour and Virginica)
with each graph showing showing four boxplots Sepal.L...
2010 Nov 24
3
Límites de confianza de la mediana en distribuciones simétricas
Por si alguno pudiera ayudarme.
Al realizar el t.test para una muestra, junto con el valor de t y el
p-valor, la función proporciona la estimación de la media y su INTERVALO
DE CONFIANZA.
Desde el punto de vista de la estadística de rangos esto se puede hacer
mediante:
> iris$MEDIANA <- with(iris, 2.95)
> median(iris$Sepal.Width - iris$MEDIANA, na.rm=TRUE) # median difference
[1] 0.05
> wilcox.test(iris$Sepal.Width, iris$MEDIANA,
alternative=''two.sided'',paired=TRUE)
Wilcoxon signed rank test with continuity correction
data: iris$Se...
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() failed: Interrupted system call
May 11 14:01:47 iris sshd[8578]:...
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":
for(i in 1:3) {
for(j in 2:4) {
cor.temp <- cor(iris.allnum[,i], i...
2013 Mar 02
2
caret pls model statistics
Greetings,
I have been exploring the use of the caret package to conduct some plsda
modeling. Previously, I have come across methods that result in a R2 and
Q2 for the model. Using the 'iris' data set, I wanted to see if I could
accomplish this with the caret package. I use the following code:
library(caret)
data(iris)
#needed to convert to numeric in order to do regression
#I don't fully understand this but if I left as a factor I would get an
error following the summary fu...
2010 Jun 09
4
question about "mean"
Hi there:
I have a question about generating mean value of a data.frame. Take
iris data for example, if I have a data.frame looking like the following:
---------------------
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.1 3.5 1.4
0.2 setosa
2 4.9 3.0...
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<- naiveBayes(iris[,1:2], iris[,5])
> table(predict(m, iris[,1:2...
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)])
However in this graphic, the x-axis and the breaks are the same for all 4 variables. I would like them to be adjusted to the data in eac...
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...
>...
2010 Oct 22
2
Random Forest AUC
..., 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 1.
data(iris)
iris <- iris[(iris$Species != "setosa"),]
iris$Species <- factor(iris$Species)
fit <- glm(Species~.,iris,family=binomial)
train.predict <- predict(fit,newdata = iris,type="response")
library(ROCR)
plot(performance(prediction(train.predict,iris$Species),&qu...