Description Usage Arguments Examples
String und Factor zu Numeric.
1 | as_numeric(x, na.strings = NULL, type = class(x))
|
x |
vector |
na.strings |
Fehlende Werte |
type |
factor, numeric, time |
1 2 3 4 5 6 7 8 | x <- c("0","-3","+5"," 5.6"," 3,5 ","3,,4","3-5","uk","na",-77,-99,-999)
f<- factor(c(4, 16, 8, 1, 4, 1, 2, 4, 2, 2, -77, 4 ))
data.frame(x=x,
x_as_num=as_numeric(x, na.strings = c("-77", "-99")),
f=f,
f_as_num=as_numeric(f, na.strings = c("-77", "-99")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.