简体   繁体   English

在R脚本中处理gps文件时出错

[英]Error processing gps file in R script

Newbie R question: I have been trying to test the R script posted in FlowingData , but the script spit out the following error: 新手R问题:我一直在尝试测试FlowingData中发布的R脚本,但是该脚本吐出以下错误:

Error: XML content does not seem to be XML: 'NA' 错误:XML内容似乎不是XML:“ NA”

I am running R on my windows box, with the .gpx files in the same directory as the script. 我在Windows框上运行R,.gpx文件与脚本位于同一目录中。 Any help is appreciated. 任何帮助表示赞赏。

Not sure if you ever found the answer to this or not, but the XML error relates to the fact that R does not know where your .gpx files are. 不知道是否找到了答案,但是XML错误与R不知道您的.gpx文件在哪里有关。 While the FlowingData script indicates that the script will work if the .gpx files are in the same folder as your saved R script copy/pasted from FlowingData, that is not true. 虽然FlowingData脚本指示如果.gpx文件与从FlowingData复制/粘贴的已保存R脚本位于同一文件夹中,则该脚本将起作用。 You must also set your working directory to this path as well, then R will see your .gpx files. 您还必须将工作目录也设置为此路径,然后R将看到您的.gpx文件。 If you FlowingData R script file and .gpx files are in: C:\\Users\\leon\\Documents\\R then add this line under the library(plotKML) line to set your working directory: setwd("C:\\\\Users\\\\leon\\\\Documents\\\\R") 如果FlowingData R脚本文件和.gpx文件位于:C:\\ Users \\ leon \\ Documents \\ R,则将此行添加到library(plotKML)行下以设置工作目录:setwd(“ C:\\\\ Users \\\\利昂\\\\文档\\\\ R“)

Another word of note, make sure you only use the RunKeeper gpx files for a fairly small geographic area or the plotted data will be insanely small. 另外要注意的是,请确保仅在相当小的地理区域内使用RunKeeper gpx文件,否则绘制的数据会非常小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM