我尝试使用R下载以下csv,结果为:embedded nul in string
library(RCurl)
library(bitops)
URL = "https://raw.githubusercontent.com/datasciencedojo/IntroToTextAnalyticsWithR/master/spam.csv"
x = getURL(URL)
结果如下:
curlPerform出错(curl = curl,.opts = opts,.encoding = .encoding) :在字符串中嵌入nul:' v'
我遗失了什么?如何使getURL
工作?
以下是sessionInfo()
> library(RCurl)
> library(bitops)
>
> URL = "https://raw.githubusercontent.com/datasciencedojo/IntroToTextAnalyticsWithR/master/spam.csv"
> x = getURL(URL)
Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) :
embedded nul in string: '<ff><fe>v'
> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.2
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] caret_6.0-78 lattice_0.20-35 ggplot2_2.2.1 RCurl_1.95-4.10 bitops_1.0-6
loaded via a namespace (and not attached):
[1] Rcpp_0.12.14 lubridate_1.7.1 tidyr_0.7.2 class_7.3-14 assertthat_0.2.0
[6] rprojroot_1.2 digest_0.6.12 ipred_0.9-6 psych_1.7.8 foreach_1.4.4
[11] R6_2.2.2 plyr_1.8.4 backports_1.1.1 stats4_3.4.3 evaluate_0.10.1
[16] rlang_0.1.4 lazyeval_0.2.1 kernlab_0.9-25 rpart_4.1-11 Matrix_1.2-12
[21] rmarkdown_1.8 labeling_0.3 splines_3.4.3 CVST_0.2-1 ddalpha_1.3.1
[26] gower_0.1.2 stringr_1.2.0 foreign_0.8-69 munsell_0.4.3 broom_0.4.3
[31] compiler_3.4.3 pkgconfig_2.0.1 base64enc_0.1-3 mnormt_1.5-5 dimRed_0.1.0
[36] htmltools_0.3.6 nnet_7.3-12 tidyselect_0.2.3 tibble_1.3.4 prodlim_1.6.1
[41] DRR_0.0.3 codetools_0.2-15 RcppRoll_0.2.2 withr_2.1.0 dplyr_0.7.4
[46] MASS_7.3-47 recipes_0.1.2 ModelMetrics_1.1.0 grid_3.4.3 nlme_3.1-131
[51] jsonlite_1.5 gtable_0.2.0 magrittr_1.5 scales_0.5.0 stringi_1.1.6
[56] reshape2_1.4.2 bindrcpp_0.2 timeDate_3042.101 robustbase_0.92-8 lava_1.6
[61] iterators_1.0.9 tools_3.4.3 glue_1.2.0 DEoptimR_1.0-8 purrr_0.2.4
[66] sfsmisc_1.1-1 parallel_3.4.3 survival_2.41-3 yaml_2.1.15 colorspace_1.3-2
[71] knitr_1.17 bindr_0.1