-4
1.在此R代碼中爲什麼使用stringsAsFactors = FALSE?爲什麼在這個R代碼中使用stringsasFactors = FALSE?
# Create the data frame.
emp.data <- data.frame(
emp_id = c (1:5),
emp_name = c("Rick","Dan","Michelle","Ryan","Gary"),
salary = c(623.3,515.2,611.0,729.0,843.25),
start_date = as.Date(c("2012-01-01", "2013-09-23", "2014-11-15", "2014-05- 11","2015-03-27")),
stringsAsFactors = FALSE
)
# Print the data frame.
print(emp.data)
請參閱'?data.frame'如果您不知道參數是什麼意思。在那裏你會看到'stringsAsFactors'這一行:logical:應該將字符向量轉換爲因子?' – Vandenman