[英]the onset time column of the edge.spells argument to networkDynamic must be numeric
I am trying to create a networkDynamic object and have tried following all of skyebend's suggestions in oymonk's post how upload a dataframe to ndtv in R in setting up the columns in the right order and the data types for each column here correctly. 不幸的是,我下面的示例繼續返回,當 str() 清楚地表明我的起始列不是數字時。 對於我所缺少的任何建議,我將不勝感激。
library("dplyr")
library("ndtv")
time =
structure(list(onset = c(1571011200, 1571616000, 1571011200,
1570406400, 1571616000, 1570406400, 1570406400, 1571011200, 1571011200,
1571616000, 1572220800, 1570406400, 1570406400, 1571616000, 1571011200,
1571011200, 1570406400, 1571616000, 1571011200, 1570406400, 1571616000,
1570406400, 1571011200, 1570406400, 1570406400, 1570406400, 1571011200,
1570406400, 1571616000, 1571616000, 1570406400, 1571011200, 1571011200,
1570406400, 1570406400, 1571011200, 1572220800, 1571616000, 1571616000,
1571011200, 1572220800, 1571616000, 1570406400, 1570406400, 1571011200,
1571011200, 1571616000, 1571011200, 1571616000, 1571616000),
terminus = c(1571356800, 1571961600, 1571356800, 1570752000,
1571961600, 1570752000, 1570752000, 1571356800, 1571356800,
1571961600, 1572566400, 1570752000, 1570752000, 1571961600,
1571356800, 1571356800, 1570752000, 1571961600, 1571356800,
1570752000, 1571961600, 1570752000, 1571356800, 1570752000,
1570752000, 1570752000, 1571356800, 1570752000, 1571961600,
1571961600, 1570752000, 1571356800, 1571356800, 1570752000,
1570752000, 1571356800, 1572566400, 1571961600, 1571961600,
1571356800, 1572566400, 1571961600, 1570752000, 1570752000,
1571356800, 1571356800, 1571961600, 1571356800, 1571961600,
1571961600), tail = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L,
10L, 11L, 12L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L,
21L, 22L, 23L, 24L, 25L, 12L, 5L, 26L, 27L, 28L, 29L, 30L,
31L, 32L, 33L, 34L, 35L, 25L, 36L, 37L, 38L, 39L, 39L, 40L,
41L, 42L, 43L, 44L, 45L), head = c(307L, 308L, 309L, 310L,
307L, 311L, 312L, 308L, 313L, 313L, 308L, 309L, 308L, 308L,
308L, 308L, 314L, 307L, 315L, 308L, 307L, 308L, 314L, 313L,
309L, 313L, 308L, 315L, 313L, 312L, 310L, 309L, 307L, 309L,
308L, 308L, 313L, 308L, 316L, 312L, 312L, 307L, 315L, 309L,
317L, 317L, 307L, 312L, 309L, 314L)), row.names = c(NA, -50L
), class = c("tbl_df", "tbl", "data.frame"))
time_dyn = time %>% networkDynamic(edge.spell = .)
time %>% str()
我真的不明白我在這里缺少什么。 任何幫助將不勝感激,如果需要任何其他信息來重現此示例,請告訴我。
我不明白這背后的格式,但似乎將我的邊緣列表從 tbldf 轉換為常規 dataframe 就可以了。
我只是通過在轉換為 networkDynamic 之前執行以下操作來做到這一點
time = time %>% data.frame()
time = time %>% networkDynamic(edge.spells = time)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.