Page 1 of 1

Question 1 The objective of this question is to help your understanding of the difference between character vectors and

Posted: Mon Nov 15, 2021 9:58 am
by answerhappygod
Question 1 The Objective Of This Question Is To Help Your Understanding Of The Difference Between Character Vectors And 1
Question 1 The Objective Of This Question Is To Help Your Understanding Of The Difference Between Character Vectors And 1 (55.65 KiB) Viewed 97 times
Question 1 The Objective Of This Question Is To Help Your Understanding Of The Difference Between Character Vectors And 2
Question 1 The Objective Of This Question Is To Help Your Understanding Of The Difference Between Character Vectors And 2 (12.67 KiB) Viewed 97 times
Question 1 The objective of this question is to help your understanding of the difference between character vectors and factors. Recall the type casting functions as .logical(), as.numeric(), and as character(), which allow us to coerce (or cast) a vector into one of a different mode. Consider the following commands: char <- c("2", "1", "O") num <- 0:2 charnum <- data.frame(char, num, stringsAsFactors = TRUE) (a) Apply as.numeric() to char and to charnum$char. Explain why there is a difference in the results.

(b) Use the type casting functions to coerce charnum$char into a numeric vector that is identical to as. numeric(char).