0

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. Unfortunately, my example below continues to return that my onset column is not numeric when str() clearly shows it is. I would appreciate any suggestions for what I am missing.

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()

I really don't understand what I am missing here. Any help would be appreciated and please let me know if any other info is required to reproduce this example.

Rory
  • 95
  • 1
  • 5

1 Answers1

0

I don't understand the formatting behind this but it seems that converting my edgelist from a tbldf to a regular dataframe did the trick.

I did this simply by executing the following before converting to networkDynamic

time = time %>% data.frame()
time = time %>% networkDynamic(edge.spells = time)
Rory
  • 95
  • 1
  • 5