I have a dataframe and want to turn the dataframe into a list of lists that is in this exact format below to be ingested into an api. I cannot figure out how to do this. Mine also include the column name and not just index values. Any assistance would be appreciated.
Here is the format of the nested list:
x <- list( list( "value", "value", "value" ), list( "value", "value", "value") )
Here is the dataframe sample:
emp.data <- data.frame(
emp_id = c (1:5),
emp_name = c("Rick","Dan","Michelle","Ryan","Gary"),
salary = c(623.3,515.2,611.0,729.0,843.25))