美文网首页
geoquery包报错

geoquery包报错

作者: 生命数据科学 | 来源:发表于2022-12-05 16:53 被阅读0次

问题1:

getGEO运行过程中Error in nchar(u, itype) : invalid multibyte string, element 1

解决办法1:

嫌麻烦版(一行搞定):

Sys.setlocale(category = "LC_ALL",locale = "English_United States.1252")

复杂版(了解前因后果):

此报错主要由于编码问题导致,我们下载的R语言跟随系统版本,编码为Chinese (Simplified)_China.936,从而导致文本的报错,因此,需要将其修改为英文编码。

在RStudio中运行sessionInfo()函数,显示如下:

> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936    LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C                               LC_TIME=Chinese (Simplified)_China.936    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.3 tools_4.1.3    tinytex_0.37   xfun_0.30    GEOquery

然后运行:

Sys.setlocale(category = "LC_ALL",locale = "English_United States.1252")

再次输入sessionInfo()

R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
system code page: 936

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.1.3 tools_4.1.3    tinytex_0.37   xfun_0.30

完美解决~

问题2:

下载完成之后显示

invalid 'row.names' length
Using locally cached version of GPL14668 found here:
C:\Users\s2071467\AppData\Local\Temp\Rtmpwr1vrd/GPL14668.soft
Error in .rowNamesDF<-(x, value = value) : invalid 'row.names' length
In addition: Warning message:
One or more parsing issues, see problems() for details

解决办法2:

嫌麻烦版(一行搞定):

readr::local_edition(1)

复杂版(了解前因后果):

本报错主要是由于readr的版本不对,导致下载后读取的报错,但在GEOquery包中并未对其修改,因此需要手动设置readr的参数。

readr::local_edition(1)

完美解决~

相关文章

网友评论

      本文标题:geoquery包报错

      本文链接:https://www.haomeiwen.com/subject/rkrifdtx.html