search for: setosa

Displaying 20 results from an estimated 41 matches for "setosa".

2010 Jun 09
5
question about "mean"
...e 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 1.4 0.2 setosa 3 4.7 3.2 1.3 0.2 setosa . . . . . . . ....
2010 Feb 03
1
Calculating subsets "on the fly" with ddply
..." ddply invocation would look like so: R> my <- ddply(iris, .(w=Sepal.Length < 5.5, Species), transform, grmean=mean(Petal.Width)) R> head(my) w Sepal.Length Sepal.Width Petal.Length Petal.Width Species grmean 1 FALSE 5.8 4.0 1.2 0.2 setosa 0.260000 2 FALSE 5.7 4.4 1.5 0.4 setosa 0.260000 3 FALSE 5.7 3.8 1.7 0.3 setosa 0.260000 4 FALSE 5.5 4.2 1.4 0.2 setosa 0.260000 5 FALSE 5.5 3.5 1.3...
2013 Jul 22
2
union of a list of logical values
Dear all, How can I obtain the union of a list of logical values? Consider the following: x <- head(iris) x[,c(2,4)] <- NA x[c(2,4),] <- NA # > x # Sepal.Length Sepal.Width Petal.Length Petal.Width Species # 1 5.1 NA 1.4 NA setosa # 2 NA NA NA NA <NA> # 3 4.7 NA 1.3 NA setosa # 4 NA NA NA NA <NA> # 5 5.0 NA 1.4 NA setosa # 6 5.4 NA 1...
2013 Apr 16
6
avoid losing data.frame attributes on cbind()
...epal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ... $ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ... $ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ... $ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ... $ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ... - attr(*, "label")= chr "Some df label" > Xb <- round(iris[,1:2]) > names(Xb) <- c("var1",''var2'') > Xc <- cbind(Xa, Xb) > #the attribute is now gone > str(Xc) ''...
2013 Apr 23
2
Questions on function "readNamedRegionFromFile" in XLConnect pacakge
Hi, I have two questions on the function "readNamedRegionFromFile" in XLConnect pacakge. 1. In the documentation, # multiregion xlsx file from demoFiles subfolder of package XLConnect demoExcelFile <- system.file("demoFiles/multiregion.xlsx", package = "XLConnect") # Load a single named region into a single data.frame. df
2013 Feb 20
7
duplicate 'row.names' are not allowed
I am getting an error when trying to import tab delimited .txt file saved from Excel. I have read what is posted on the forums but still am confused. I saved my Excel file (DataTestforR.xlsx) as a tab delimited txt file (DataTestR.txt) on my Desktop. In the RGUI, I tried to import the txt file and got an error > myfile<-"C:\\Users\\jpapa\\Desktop\\DataTestR.txt" >
2013 Mar 18
6
Why stacking rasters return NAs?
I have several rasters that I want to do some calculations ,basically calculating the moving average. dir2 <- list.files("D:\\2010+2011", "*.bin", full.names = TRUE) saf=stack(dir2) movi <- overlay(stack(saf),fun=function(x) movingFun(x, fun=mean, n=3, na.rm=TRUE)) Error in .overlayList(x, fun = fun, filename = filename,
2012 Feb 15
6
extraer datos de un dataframe a partir de un factor
Hola eRReros, Necesito extraer datos de un dataframe según uno de los factores. La cosa sería algo así: df.nuevo <- iris[iris$Species=="setosa"|iris$Species=="virginica",] Que me crea un df nuevo solo con las filas en que Species es setosa o virginica. El problema es que mi factor de interés tiene 22 niveles y a veces he de seleccionar 13, 10, 8 niveles o números así. Esto implica escribir un | con su == correspondiente 1...
1999 Oct 25
1
trouble reading in datasets
...ment also > apply (iris, c(2) ,sum) Error in sum(..., na.rm = na.rm) : invalid "mode" of argument So ... any suggestions as to what have I not done here? Some commands that show that I did load the dataset. > iris V1 V2 V3 V4 V5 1 5.1 3.5 1.4 0.2 Iris-setosa .... and > summary (iris) V1 V2 V3 V4 Min. :4.300 Min. :2.000 Min. :1.000 Min. :0.100 1st Qu.:5.100 1st Qu.:2.800 1st Qu.:1.600 1st Qu.:0.300 Median :5.800 Median :3.000 Median :4.350 Median :1.300 Mean...
2012 May 05
2
what is Non-numeric argument to mathematical function in prediction ?
...edict(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]), iris[,5]) setosa versicolor virginica setosa 49 0 0 versicolor 1 37 19 virginica 0 13 31 Do you know what is the problem? Br, Luffy [[alternative HTML version deleted]]
2017 Oct 24
0
Creating a data table (frame?) from a SQL Statement?
...> // displays TRUE. > >---- > >Few rows of displayed data in R Console from line above: "irisQuery" > > Sepal.Length Sepal.Width Petal.Length Petal.Width Species >1 5.1 3.5 1.4 0.2 setosa >2 4.9 3 1.4 0.2 setosa >3 4.7 3.2 1.3 0.2 setosa >4 4.6 3.1 1.5 0.2 setosa >5 5 3.6 1.4 0.2 setosa >6 5.4...
2008 Oct 12
0
OT: irises
...riter/ based on the Fisher/Anderson iris data, including pictures. Unfortunately, the pictures are not of the right species (two appear to be tall bearded iris cultivars, the third probably either Iris ensata or Iris siberica). Pictures of the right species would be very useful -- Iris setosa really is visibly different in structure (not just in color), not having visible upright `standards''. There are nice pictures at the Iris Species Database: http://www.badbear.com/signa/signa.pl?Introduction Looking for pictures I noticed that the terminology seems to ha...
2017 Oct 16
1
ROC curve for each fold in one plot
...ber=5,savePredictions = TRUE,classProbs = TRUE) > output <- train(Species~., data=iris, trControl=train_control, method="rf") > library(pROC) > selectedIndices <- output$pred$Resample == "Fold1" > plot.roc(output$pred$obs[selectedIndices],output$pred$setosa[selectedIndices]) > selectedIndices <- output$pred$Resample == "Fold2" > plot.roc(output$pred$obs[selectedIndices],output$pred$setosa[selectedIndices]) > selectedIndices <- output$pred$Resample == "Fold3" > plot.roc(output$pred$obs[selectedIndices],out...
2005 Feb 08
1
Toying with neural networks
...)[5] <- "species" > net <- nnet(species ~ ., data=iris, size=124, maxit=10) # weights: 995 initial value 309.342009 iter 10 value 21.668435 final value 21.668435 stopped after 10 iterations > table(iris$species[], predict(net, iris[], type="class")) setosa versicolor virginica setosa 50 0 0 versicolor 0 46 4 virginica 0 0 50 It works just fine, but if I do: > net <- nnet(species ~ ., data=iris, size=125, maxit=10) Error in nnet.default(x, y, w, softmax = TRUE, ...) : Too many (1003)...
2017 Sep 15
2
Regarding Principal Component Analysis result Interpretation
...7;Madam, I am trying to do PCA analysis with "iris" dataset and trying to interpret the result. Dataset contains 150 obs of 5 variables Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4 0.2 setosa ..... ..... 150 5.9 3.0 5.1 18 verginica now I used 'prcomp' function on dataset and got result as following: >print(pc) S...
2010 Jun 30
1
help on naivebayes function in R
Hi, I have written a code in R for classifying microarray data using naive bayes, the code is given below: library(e1071) train<-read.table("Z:/Documents/train.txt",header=T); test<-read.table("Z:/Documents/test.txt",header=T); cl <- c(c(rep("ALL",10), rep("AML",10))); cl <- factor(cl) model <- NaiveBayes(train,cl);
2017 Sep 15
1
Regarding Principal Component Analysis result Interpretation
...to do PCA analysis with "iris" dataset and trying to interpret > the result. Dataset contains 150 obs of 5 variables > > Sepal.Length Sepal.Width Petal.Length Petal.Width Species > 1 5.1 3.5 1.4 > 0.2 setosa > 2 4.9 3.0 1.4 > 0.2 setosa > ..... > ..... > 150 5.9 3.0 5.1 18 > verginica > > now I used 'prcomp' function on dataset and got r...
2012 Mar 07
3
sobre googlevis
Buenas. Esta mañana estoy trasteando un poco con googlevis, sobre todo para ver si introducimos algunos gráficos chulos en la página web de la empresa ( hacemos estudios sociológicos). Y estaba viendo esta página http://neurochem.sisbio.recerca.upc.edu/?p=276 y no encuentro la forma de reproducir el gráfico de las puntuaciones factoriales . Usando gvisScatterChart puedo dibujar
2010 Sep 22
4
randomForest - partialPlot - Reg
Dear R Group I had an observation that in some cases, when I use the randomForest model to create partialPlot in R using the package "randomForest" the y-axis displays values that are more than -1! It is a classification problem that i was trying to address. Any insights as to how the y axis can display value more than -1 for some variables? Am i missing something! Thanks Regards
2005 Jul 06
1
Help: Mahalanobis distances between ''Species'' from iris
Dear R list, I''m trying to calculate Mahalanobis distances for ''Species'' of ''iris'' data as obtained below: Squared Distance to Species From Species: Setosa Versicolor Virginica Setosa 0 89.86419 179.38471 Versicolor 89.86419 0 17.20107 Virginica 179.38471 17.20107 0 This distances above were obtained with proc ''CANDISC'' of SAS, please, see Output 21.1.2: Iris Data: Squared Mahalanobis Distances fr...