0

I'm trying to use the R0 package in order to estimate this value from a data set. I've formatted my data according to the Example data set, called 'Germany.1918'

typeof(Germany.1918)
> [1] "double"

So, I know that I need to have my data formatted as 'double' in order to run the package commands.

So far this is what I've done: - Formatted an excel document in order for it to show exclusively 2 data elements: date and number of cases - Exported this file as CSV - Imported this CSV file into R

Here's where I get stuck as the format of the data set Germany.1918 indicates is a double (numeric, I suppose) and otherwise my data is read as such I can't run any calculations.

So, summarizing I need to convert my list into a double R object.

Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
Ronald Mora
  • 1
  • 1
  • 3
  • Providing data helps and suggest look at https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example . in R, type conversion functions are generally like `as.` so `as.double` may be what you need. However, R is pretty good at converting (coercing) types automatically. – Andrew Lavers May 27 '17 at 23:36
  • Are you saying that you have a `list` and want to convert it into `double`? you can use `as.double(unlist(df$x))` where `df` is your `dataframe` and `x ` is the `variable`. – Manoj Kumar May 27 '17 at 23:47

0 Answers0