Ошибка в dimnames (slot (x, "ordins)) при запуске align_move в пакете перемещения - PullRequest
0 голосов
/ 21 апреля 2019

Я пытаюсь запустить анимацию в 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
...