search for: sepal

Displaying 20 results from an estimated 340 matches for "sepal".

Did you mean: seal
2006 May 31
2
a problem 'cor' function
...r [1] "2" $minor [1] "3.0" $year [1] "2006" $month [1] "04" $day [1] "24" $`svn rev` [1] "37909" $language [1] "R" $version.string [1] "Version 2.3.0 (2006-04-24)" > data(iris) > cor(iris[1:4]) Sepal.Length Sepal.Width Petal.Length Petal.Width Sepal.Length 1.0000 -0.1176 0.8718 0.8179 Sepal.Width -0.1176 1.0000 -0.4284 -0.3661 Petal.Length 0.8718 -0.4284 1.0000 0.9629 Petal.Width 0.8179 -0.3661 0.9629 1.0000 &gt...
2012 Aug 01
3
Neuralnet Error
...="setosa",1,ifelse(ir1$Species=="versicolor",0,""))) colnames(ir2)<-("Output") ir3 <- data.frame(rbind(ir1[1:4],ir2)) #rownames(ir3)<-c("SL","SW","PL","PW","Output") print(ir3) n<- neuralnet(Output~Sepal.Length+Sepal.Width+Petal.Length+Petal.Width,data=ir3,err.fct="sse",hidden=2,linear.output=FALSE) Output: Error in neurons[[i]] %*% weights[[i]] :    requires numeric/complex matrix/vector arguments Any assisstance is appreciated [[alternative HTML version deleted]]
2012 Apr 25
1
recommended way to group function calls in Sweave
...a function, but I want both the results and the function calls in the printed output. Let me explain myself. Consider the following computation in an Sweave document: summary(iris[,1:2]) cor(iris[,1:2]) When using these two calls directly, I obtain the following output: > summary(iris[,1:2]) Sepal.Length Sepal.Width Min. :4.300 Min. :2.000 1st Qu.:5.100 1st Qu.:2.800 Median :5.800 Median :3.000 Mean :5.843 Mean :3.057 3rd Qu.:6.400 3rd Qu.:3.300 Max. :7.900 Max. :4.400 > cor(iris[,1:2]) Sepal.Length Sepal.Width Sepal.Length 1.0000000 -0.11...
2012 Jun 11
1
saving sublist lda object with save.image()
...es not have components 'x' and 'y' ### And my lda obects appear to have changed and look like: > list2[[1]][[2]] $prior setosa versicolor virginica 0.3333333 0.3333333 0.3333333 $counts setosa versicolor virginica 50 50 50 $means Sepal.Length Sepal.Width Petal.Length Petal.Width setosa 5.006 3.428 1.462 0.246 versicolor 5.936 2.770 4.260 1.326 virginica 6.588 2.974 5.552 2.026 $scaling LD1 LD2 Sepal.Length 0.8293776 0...
2007 Mar 22
2
unexpected behavior of trellis calls inside a user-defined function
...the error messages I've gotten is: > figFun(smoothFit1) ## no longer worked, once I got fancy with trellis Error in depth(path) : no applicable method for "depth" Smallest example I could construct to illustrate at least one of my problems: predVals <- expand.grid(list(Sepal.Length = seq(from = min(iris$Sepal.Length), to = max(iris$Sepal.Length), length = 50), Petal.Length = seq(from = min(iris$Petal.Length), to = max(iris$Petal.Length), length = 50))) irisFit <- lm(Sepal.Width ~ Sepal.Length * Petal.L...
2007 Sep 19
2
By() with method = spearman
I have a data set where I want the correlations between 2 variables conditional on a students grade level. This code works just fine. by(tmp[,c('mtsc07', 'DCBASmathscoreSPRING')], tmp$Grade, cor, use='complete', method='pearson') However, this generates an error by(tmp[,c('mtsc07', 'DCBASmathscoreSPRING')], tmp$Grade, cor, use='complete',
2008 Oct 13
2
split data, but ensure each level of the factor is represented
Hello, I'll use part of the iris dataset for an example of what I want to do. > data(iris) > iris<-iris[1:10,1:4] > iris Sepal.Length Sepal.Width Petal.Length Petal.Width 1 5.1 3.5 1.4 0.2 2 4.9 3.0 1.4 0.2 3 4.7 3.2 1.3 0.2 4 4.6 3.1 1.5 0.2 5 5.0 3.6 1.4...
2007 Oct 09
2
lattice/xyplot: horizontal y-axis labels with scales(relation="free")
...y-axis limits and horizontal labels at the y-axis tickmarks. The following does not seem to work, although I think it should, going by the documentation for par. R version 2.5.1, Windows XP Prof. Thanks for a clue. Andreas Krause library(lattice) # axis labels for y-axis are horizontal xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris) # labels are now vertical xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free")) # still vertical despite las=1 xyplot(Sepal.Length ~ Sepal.Width | Species, data=iris, scales=list(relation="free"), las=1...
2012 Jul 31
1
kernlab kpca predict
...ist of 1 .. .. .. ..$ sigma: num 0.2 ..@ kpar : list() ..@ xmatrix : num [1:130, 1:4] 5.1 4.9 4.6 5 5.4 4.6 5 4.4 4.9 4.8 ... .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:130] "1" "2" "4" "5" ... .. .. ..$ : chr [1:4] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" .. ..- attr(*, "assign")= int [1:4] 1 2 3 4 ..@ kcall : language kpca(x = x, data = ..1, kernel = "rbfdot", kpar = ..3, features = 2) ..@ terms :Classes 'terms', 'formula&...
2011 Mar 06
4
sorting & subsetting a data.frame
Dear all This may be obvious, but I cannot get it working. I'm trying to subset & sort a data frame in one go. x <- iris x$Species1 <- as.character(x$Species) ##subsetting alone works fine with(x, x[Sepal.Length==6.7,]) ##sorting alone works fine with(x, x[order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but not sorted as expected with(x, x[(Sepal.Length==6.7) & order(Sepal.Length, rev(sort(Species1))),]) ##gets subsetted, but sorts very strangely xa <- with(x, x[Sepal.Length==6....
2003 Sep 09
2
lattice.xyplot: adding grid lines
Hallo, I'd like to add grid lines to a lattice graph having 2 series of Y data. See these 2 examples: data(iris) [1] xyplot(Sepal.Length + Sepal.Width ~ Petal.Length , data = iris, allow.multiple = TRUE, scales = "same",type="l", ) [2] xyplot(Sepal.Length + Sepal.Width ~ Petal.Length , data = iris, allow.multiple = TRUE, scales = "same",type="l", panel = functi...
2012 Jul 10
3
fill 0-row data.frame with 1 line of NAs
Dear all Is there a simpler method to achieve the following: When I obtain an empty data.frame after subsetting, I need for it to contain one line of NAs. Here's a dummy example: > (.xb <- iris[ iris$Species=='zz', ]) [1] Sepal.Length Sepal.Width Petal.Length Petal.Width Species <0 rows> (or 0-length row.names) > dim(.xb) [1] 0 5 > (.xa <- data.frame(matrix(rep(NA, ncol(.xb)), 1))) X1 X2 X3 X4 X5 1 NA NA NA NA NA > names(.xa) <- names(.xb) > (.xb <- .xa) Sepal.Length Sepal.Width Petal.Leng...
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
...ictors includes the levels of a factor or unique values of a character predictor in the $xlevels component of the object, but not the FALSE/TRUE values for a logical predictor even though the latter is treated as a factor in the fit. For example: ------------ snip -------------- > m1 <- lm(Sepal.Length ~ Sepal.Width + Species, data=iris) > m1$xlevels $Species [1] "setosa" "versicolor" "virginica" > m2 <- lm(Sepal.Length ~ Sepal.Width + as.character(Species), data=iris) > m2$xlevels $`as.character(Species)` [1] "setosa" "ve...
2008 Feb 27
2
multiple plots per page using hist and pdf
...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") plot(iris$Sepal.Width, iris$Petal.Width, main = "Plot 4") dev.off() pdf(file = "hist_and_p...
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 (found for '(xlab)') And are you -- the one with the work-around -- willing to share it? :) Best regards -- Gerrit --...
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 *** # Resid...
2019 Aug 31
2
inconsistent handling of factor, character, and logical predictors in lm()
...or example, if you changed the contrasts option, you'd get a different estimate (though of course a model with the same fit to the data and an equivalent interpretation): ------------ snip -------------- > options(contrasts=c("contr.sum", "contr.poly")) > m3 <- lm(Sepal.Length ~ Sepal.Width + I(Species == "setosa"), data=iris) > m3 Call: lm(formula = Sepal.Length ~ Sepal.Width + I(Species == "setosa"), data = iris) Coefficients: (Intercept) Sepal.Width I(Species == "setosa")1 2.66...
2016 Jul 27
2
Model object, when generated in a function, saves entire environment when saved
Another solution is to only save the parts of the model object that interest you. As long as they don't include the formula (which is what drags along the environment it was created in), you will save space. E.g., tfun2 <- function(subset) { junk <- 1:1e6 list(subset=subset, lm(Sepal.Length ~ Sepal.Width, data=iris, subset=subset)$coef) } saveSize(tfun2(1:4)) #[1] 152 Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Jul 27, 2016 at 11:19 AM, William Dunlap <wdunlap at tibco.com> wrote: > One way around this problem is to make a new environment whose > pare...
2012 Jul 23
1
duplicated() variation that goes both ways to capture all duplicates
...romLast, but not both ways. Often users will want to identify and extract all the copies of the item that has duplicates, not only the duplicates themselves. To take the example from the man page: > data(iris) > iris[duplicated(iris), ] ##duplicates while searching "fromFirst" Sepal.Length Sepal.Width Petal.Length Petal.Width Species 143 5.8 2.7 5.1 1.9 virginica > iris[duplicated(iris, fromLast=T), ] ##duplicates while searching "fromLast" Sepal.Length Sepal.Width Petal.Length Petal.Width Species 102 5.8...
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 1.4 0.2 setosa 3 4.7 3.2 1.3 0.2 se...