在move包中运行align_move时,dimnames(slot(x,“ coords”))出现错误

时间:2019-04-20 21:05:23

标签: r move

我正在尝试在 Move MoveVis 0.10.1 程序包中运行动画,并且不断出现以下错误:

Error in dimnames(slot(x, "coords")) <-`*vtmp*` : length of 'dimnames' [1] not equal to array extent 

,我不确定这是什么意思。我的数据结构与示例数据集类似,因此我不确定哪里出错了。

列设置为:

`str(pdfhrecenttracks2)
'data.frame':   10312 obs. of  9 variables:
 $ location.long: num  -90.6 -90.6 -90.6 -91 -91 ...
 $ location.lat : num  41.5 41.5 41.5 41.4 41.4 ...
 $ time         : POSIXct, format: "2018-06-05 00:05:18" ...
 $ coords.x1    : num  -90.6 -90.6 -90.6 -91 -91 ...
 $ coords.x2    : num  41.5 41.5 41.5 41.4 41.4 ...
 $ optional     : logi  TRUE TRUE TRUE TRUE TRUE TRUE ...
 $ sensor       : Factor w/ 1 level "unknown": 1 1 1 1 1 1 1 1 1 1 ...
 $ timestamps   : POSIXct, format: "2018-06-05 00:05:18" ...
 $ trackId      : Factor w/ 121 levels "T12414","T12415",..: 1 1 1 1 1 1 1 1 1 1 ...

`pdfh <- move(x=pdfhrecenttracks2$location.long, y=pdfhrecenttracks2$location.lat,time=as.POSIXct(pdfhrecenttracks2$timestamps, format="%Y-%m-%d %H:%M:%S", tz="UTC"), data=pdfhrecenttracks2, proj=CRS("+proj=longlat +ellps=WGS84 + towgs84=0,0,0"), animal=pdfhrecenttracks2$trackId, sensor= pdfhrecenttracks2$sensor)
`m <- align_move(pdfh, res = 240, unit = "secs")

`n <- 121
`color = grDevices::colors()[grep('gr(a|e)y', > grDevices::colors(), invert = T)]
`unique.colors <- sample(color, n)
`pie(rep(1,n), col=unique.colors)

`frames <- frames_spatial(m, path_colours = unique.colors, map_service = "osm", map_type = "watercolor", alpha = 0.5) %>% add_labels(x = "Longitude", y = "Latitude") %>% # add some customizations, such as axis labels
  add_northarrow() %>% 
  add_scalebar() %>% 
  add_timestamps(m, type = "label") %>% 
  add_progress()

`m <- align_move(pdfh, res = 240, unit = "secs")

Error in dimnames(slot(x, "coords")) <- `*vtmp*` : 
  length of 'dimnames' [1] not equal to array extent
In addition: Warning messages:
1: In max.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to max; returning -Inf
2: In min.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to min; returning Inf
3: In max.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to max; returning -Inf
4: In min.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to min; returning Inf
5: In max.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to max; returning -Inf
6: In min.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to min; returning Inf
7: In max.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to max; returning -Inf
8: In min.default(numeric(0), na.rm = FALSE) :
  no non-missing arguments to min; returning Inf

0 个答案:

没有答案