I am trying to import dynamodb in R using paws.database library. I am successful in retrieving the required attribute into R(using scan operation). However the imported data is in the form of a nested list i.e. in [[]] form. My intention is to format the imported dynamodb attribute into a dataframe and later be able to plot it using ggpplot. I have tried using options such as
- df <- ldply (list_a, data.frame), ldply (list_a, data.frame),
- data.frame(matrix(unlist(list_a), nrow=length(list_a), byrow=TRUE),stringsAsFactors=FALSE),
- as.data.frame(do.call(cbind,list_a))
so far and was unable to convert the data in a proper dataframe format. The final error I get in ggplot is "
Error: data
must be a data frame, or other object coercible by fortify()
, not a list "
Could anyone please help ?