今天我试图完成我最后的 R-study-exercises,但我失败了。我不允许你展示我学术的精确指示,但你可以帮助我解决采购后收到的警告。他们的意思是什么?什么不适合?我知道,这个问题很模糊,但这是唯一的问法。我相信它是关于“Aufgabe 3”和“Aufgabe 4”的
这是我的输入:
x <- read.csv ("http://hci.stanford.edu/jheer/workshop/data/worldbank/worldbank.csv")
y <- (colnames (x) <- (c ("Country", "Year", "co2", "power","energy", "fertility", "gni", "internet", "life.expectancy","military", "population", "hiv.prevalence")))
y
####Aufgabe 1####
f1 <- min(x$fertility, na.rm=TRUE)
f1
####Aufgabe 2####
f2 <- max (subset(x, Country=="Australia" | Country=="Belarus" | Country=="Germany", select=fertility), na.rm=TRUE)
f2
####Aufgabe 3####
q1 <- quantile (subset(x, Year==2005, select=military), probs=c(.25), na.rm=TRUE)
q1
####Aufgabe 4####
q2 <- quantile (subset(x, Year==2001, select=population), probs=c(.05), na.rm=TRUE)
q2
####Aufgabe 4####
n <- length(which (is.na (subset (x, Year==2000, select=military))))
n
####Aufgabe 5####
library(psych)
mil<- skew (x$military)
coun<- skew(x$Country)
Ye<- skew(x$Year)
co<- skew(x$co2)
po<- skew(x$power)
en<- skew(x$energy)
fer<- skew(x$fertility)
gni<- skew(x$gni)
inertnet<- skew(x$internet)
life<- skew(x$life.expectancy)
pop<- skew(x$population)
hiv<- skew(x$hiv.prevalence)
mil
coun
Ye
co
po
en
fer
gni
inertnet
life
pop
hiv
ku1<- "co2"
ku1
...以及我在采购后收到的这些警告:
1. In var(as.vector(x), na.rm = na.rm : Na generated through conversion
2. n mean.default(x) : argument is not numeric or logical: returning NA
3. 3: In Ops.factor(x, mx) : - not meaningful for factors
4. In var(as.vector(x), na.rm =na.rm) : Na generated through conversion