#Ghi chu: Reading data into R
t=file.choose() hs=read.csv(t) head(t) [1] “D:\Housing prices data.csv” head(hs) ï..crime zone industry river nox rooms age distance radial tax ptratio black lstat 1 0.00632 18 2.31 0 0.538 6.575 65.2 4.0900 1 296 15.3 396.90 4.98 2 0.02731 0 7.07 0 0.469 6.421 78.9 4.9671 2 242 17.8 396.90 9.14 3 0.02729 0 7.07 0 0.469 7.185 61.1 4.9671 2 242 17.8 392.83 4.03 4 0.03237 0 2.18 0 0.458 6.998 45.8 6.0622 3 222 18.7 394.63 2.94 5 0.06905 0 2.18 0 0.458 7.147 54.2 6.0622 3 222 18.7 396.90 5.33 6 0.02985 0 2.18 0 0.458 6.430 58.7 6.0622 3 222 18.7 394.12 5.21 MEDV 1 24.0 2 21.6 3 34.7 4 33.4 5 36.2 6 28.7 library(table1) Error in library(table1) : there is no package called ‘table1’ install.packages(c(“table1”)) WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/Admin/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) also installing the dependency ‘Formula’
trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.6/Formula_1.2-3.zip’ Content type ‘application/zip’ length 181517 bytes (177 KB) downloaded 177 KB
trying URL ‘https://cran.rstudio.com/bin/windows/contrib/3.6/table1_1.1.zip’ Content type ‘application/zip’ length 124901 bytes (121 KB) downloaded 121 KB
package ‘Formula’ successfully unpacked and MD5 sums checked package ‘table1’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in C:_packages > library(table1)
Attaching package: ‘table1’
The following objects are masked from ‘package:base’:
units, units<-
table1(~crime+room+age+distance+black+MEDV|river,data=hs) Error in eval(predvars, data, env) : object ‘crime’ not found table1(~crime+rooms+age+distance+black+MEDV|river,data=hs) Error in eval(predvars, data, env) : object ‘crime’ not found library(table1) table1(~crime+rooms+age+distance+black+MEDV|river,data=hs) Error in eval(predvars, data, env) : object ‘crime’ not found table1(~crime + rooms + age + distance + black + MEDV | river, data=hs) Error in eval(predvars, data, env) : object ‘crime’ not found table1(~..crime + rooms + age + distance + black + MEDV | river, data=hs) Error in eval(predvars, data, env) : object ‘..crime’ not found table1(~ crime + rooms + age + distance + black + MEDV | river, data=hs) Error in eval(predvars, data, env) : object ‘crime’ not found table1(~rooms + age + distance + black + MEDV | river, data=hs) Warning message: In table1.formula(~rooms + age + distance + black + MEDV | river, : Terms to the right of ‘|’ in formula ‘x’ define table columns and are expected to be factors with meaningful labels. table1(~ ï..crime + rooms + age + distance + black + MEDV | river, data=hs) Warning message: In table1.formula(~ï..crime + rooms + age + distance + black + MEDV | : Terms to the right of ‘|’ in formula ‘x’ define table columns and are expected to be factors with meaningful labels. table1(~..crime + rooms + age + distance + black + MEDV | river, data=hs) Error in eval(predvars, data, env) : object ‘..crime’ not found table1(~ ï..crime + rooms + age + distance + black + MEDV | river, data=hs) Warning message: In table1.formula(~ï..crime + rooms + age + distance + black + MEDV | : Terms to the right of ‘|’ in formula ‘x’ define table columns and are expected to be factors with meaningful labels.