as_irgenwas | R Documentation |
as_numeric: character, factor to numeric
as_numeric: beim Type character wird die Funktion readr::parse_number ausgeführt. parse_number(x, na = c(".", ","), trim_ws=TRUE)
as_numeric: beim Type factor wird zu erst versucht aus den labels die Zahlen zu extrahieren und erst wenn das nicht geht die levels (1:n).
as_numeric: beim Type factor wird zu erst versucht aus den labels die Zahlen zu extrahieren und erst wenn das nicht geht die levels (1:n).
as_logical: alles mit zwei Merkmalen zu logical
as_numeric(x, ...)
## S3 method for class 'numeric'
as_numeric(x, ...)
## S3 method for class 'character'
as_numeric(x, na.string = "", dec = c(".", ","), trim_ws = TRUE, ...)
## S3 method for class 'factor'
as_numeric(x, na.string = "", dec = c(".", ","), ...)
## S3 method for class 'logical'
as_numeric(x, ...)
as_logical(x)
x |
vector |
... |
readr::parse_number trim_ws Should leading and trailing whitespace (ASCII spaces and tabs) be trimmed from each field before parsing it? |
na.string |
missing |
dec |
decimal |
trim_ws |
logical trim ws |
vector
dummy <- factor(c("3", "4", "6"))
as_numeric(dummy)
x <-
c(
"> 15100",
"+1",
"-1",
"655.39554148943",
"699.913201822519 ",
" 228.40319734460499",
"",
NA,
"hallo1",
"-77"
)
as_numeric(x, na.string = c("", "-77"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.