burgerga / rspacer

RSpace API Wrapper
https://burgerga.github.io/rspacer/
Other
1 stars 1 forks source link

rspacer:::data_frame_to_fields only copies the columns name and content #12

Open hleegwater opened 1 week ago

hleegwater commented 1 week ago

The function now only copies name and content. I think I need at least id as well (see below), but maybe I can find a way to just pivot all columns.

data_frame_to_fields <- function (fields_data_frame) 
{
    fields <- lapply(1:nrow(fields_data_frame), function(row_nr) {
        list(id = fields_data_frame$id[row_nr],
             name = fields_data_frame$name[row_nr], 
             content = fields_data_frame$content[row_nr]
             )
    })
    names(fields) <- fields_data_frame$name
    return(fields)
}