March 2019
Beginner to intermediate
250 pages
6h 6m
English
We now need to convert all these variables into a numeric format. From the second variable (the first is the identifier) to the rest of variables in the data frame, variables will be explicitly converted to a numeric. The last two variables will be also be excluded from this process (Date and the target variable). Let’s convert variables to a numeric format with the following code:
for (k in 2:(ncol(Model_database)-2)) { Model_database[,k]<-as.numeric(Model_database[,k]) }
Let’s see whether the changes have been applied:
table(sapply(Model_database, class)) ## ## Date integer numeric ## 1 1 1492
Before continuing with the development, and once we have solved problems in the data formats, in the following ...
Read now
Unlock full access