r-car

How to calculate the area of ellipse drawn by ggplot2?

霸气de小男生 提交于 2020-03-18 12:48:33
问题 In ggplot2, after I drawing the ellipse plot using stat_ellipse, is there any way to calculate the area of this ellipse? Here is the code and the plot: library(ggplot2) set.seed(1234) x <- rnorm (1:1000) y <- rnorm (1:1000) data <- cbind(x, y) data <- as.data.frame(data) ggplot (data, aes (x = x, y = y))+ geom_point()+ stat_ellipse() 回答1: You can calculate the area of the ellipse by finding its semi-major and semi-minor axes (as shown in this SO answer): # Plot object p = ggplot (data, aes (x

'car' dependency error: Installing caret in R 3.1.2

社会主义新天地 提交于 2020-01-13 19:06:56
问题 Cannot install caret package !! install.packages("caret") Installing package into ‘/home/timekeeper/R/x86_64-unknown-linux-gnu-library/3.1’ (as ‘lib’ is unspecified) Warning: dependency ‘car’ is not available trying URL 'http://mirrors.softliste.de/cran/src/contrib/caret_6.0-52.tar.gz' Content type 'application/x-gzip' length 3665293 bytes (3.5 Mb) opened URL ================================================== downloaded 3.5 Mb ERROR: dependency ‘car’ is not available for package ‘caret’ *

Error in vcov.default(mod) : there is no vcov() method for models of class list (changing from type I to type III Sum of Squares)

◇◆丶佛笑我妖孽 提交于 2019-12-24 19:16:47
问题 I am trying to get an ANOVA table for my split-split plot design where it will use type III Sum sq instead of type I. This is what I have done so far; > Attach(Data) > library(car) > options(contrasts = c("contr.sum", "contr.poly")) > mod <- aov(Response ~ A*B*C + Error(Block/A/B/C)) > Anova(mod, type='III') Error in vcov.default(mod) : there is no vcov() method for models of class aovlist, listof I don't understand why I keep getting this error message, or what to do about it. Any help

Car package not found by R (failed to load)

喜你入骨 提交于 2019-12-21 21:22:23
问题 I am am trying to load a simple dataset using: library(car) but I get the following error: Error in library("car") : there is no package called 'car' Does anyone have an idea why this happens and how to solve it? 回答1: If you don't currently use an IDE (or even if you do), the following will install the package: install.packages("car") Before then running library("car") You should heed @Iris's advice and use a RStudio if you don't already to manage just this sort of task. 回答2: You forgot to

Obtain vertices of the ellipse on an ellipse covariance plot (created by `car::ellipse`)

一曲冷凌霜 提交于 2019-12-19 02:59:10
问题 By following this post one can draw an ellipse with a given shape matrix (A): library(car) A <- matrix(c(20.43, -8.59,-8.59, 24.03), nrow = 2) ellipse(c(-0.05, 0.09), shape=A, radius=1.44, col="red", lty=2, asp = 1) Now how to get the major/minor (pair of intersect points of the major/minor axis and the ellipse) vertices of this ellipse? 回答1: For practical purposes, @Tensibai's answer is probably good enough. Just use a large enough value for the segments argument so that the points give a

Side by side plots using scatterplot from car package

天大地大妈咪最大 提交于 2019-12-12 15:25:28
问题 Is there some reason you cannot lay two scatterplot (from car package) figures side by side? library(car) str(UN) par(mfrow=c(1,2)) scatterplot(infant.mortality~gdp,data=UN, xlab="GDP per capita", ylab="Infant Morality Rate (per 1000 births)", main="(a)", boxplot=FALSE) scatterplot(infant.mortality~gdp,data=UN, xlab="GDP per capita", ylab="Infant Morality Rate (per 1000 births)", main="(b)", log='xy', boxplot=FALSE,id.n=4) par(mfrow=c(1,1)) The above code produces both images, but not as one

How to add pciutils package in yocto AGL?

旧时模样 提交于 2019-12-10 12:08:34
问题 I have built Yocto AGL(6.0.0) image for RCar-salvator-xs board and flashed its hyperflash memory. Now, I want to perform PCIe related investigation, for that I want to use lspci command. But, After ligging in as a root in flashed AGL image and executing lspci command it gives command not found . How can I include pciutils in AGL source code and build it to use lspci command. I am new to Yocto and AGL. Any help will be much appreciated. 回答1: You can add IMAGE_INSTALL += "pciutils" or IMAGE

package car unable to load, wrong version of nlme

五迷三道 提交于 2019-12-10 03:59:44
问题 When I try to load the 'car' package I get this error: library(car) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'nlme' 3.1-122 is already loaded, but >= 3.1.123 is required Error: package or namespace load failed for 'car' But when I run update.packages() there is nothing to update. I'm using MRO 3.2.3 if that matters. 回答1: I had the same problem and solved it simply by installing nlme_3.1-123.tar.gz from https://cran.r-project.org/src

How to recode a variable to numeric?

☆樱花仙子☆ 提交于 2019-12-09 13:32:54
问题 > library(car) > df = data.frame(value=c('A', 'B', 'C', 'A')) > foo = recode(df$value, "'A'=1; 'B'=2; 'C'=3;", as.numeric.result=TRUE) > mean(foo) [1] NA Warning message: In mean.default(foo) : argument is not numeric or logical: returning NA > foo [1] 1 2 3 1 Levels: 1 2 3 Ugh. I thought the definition of as.numeric.result (default TRUE) was that if the results are all numerals, they would be coerced to numeric. How do I get the results of this recoding to be numeric? 回答1: If you look

R- Partial eta squared for repeated measures ANOVA (car package)

一个人想着一个人 提交于 2019-12-09 06:08:04
问题 I have a 2-way repeated measures design (3 x 2), and I would like to get figures out how to calculate effect sizes (partial eta squared). I have a matrix with data in it (called a) like so (repeated measures) A.a A.b B.a B.b C.a C.b 1 514.0479 483.4246 541.1342 516.4149 595.5404 588.8000 2 569.0741 550.0809 569.7574 599.1509 621.4725 656.8136 3 738.2037 660.3058 812.2970 735.8543 767.0683 738.7920 4 627.1101 638.1338 641.2478 682.7028 694.3569 761.6241 5 599.3417 637.2846 599.4951 632.5684