rtables icon indicating copy to clipboard operation
rtables copied to clipboard

Expose `sep` argument of `rtables::export_as_tsv`

Open pawelru opened this issue 2 years ago • 2 comments

In order to export table in form of csv file I would like to have an option to specify sep argument in already existing exporting function

UPDATE: you might also consider to export ... and pass it directly to utils::write.table. One possible use case would be to enable setting up na argument there.

pawelru avatar Jan 21 '22 15:01 pawelru

@pawelru I assume you use this for teal exports. We initially implemented the export_as_tsv for the auto content generation team, so the use cases might differ here. I suggest you join one of the check-in Tuesday meeting to discuss the requirements together.

waddella avatar Feb 03 '22 01:02 waddella

That's correct. I want to use it when exporting rtables object. Right now we are exporting to csv using rtables::as_html() %>% as.character() %>% xml2::read_table() %>% rvest::html_table() %>% utils::write.table(). Don't know where it comes from and I didn't like it. Looking into exporting functionality in rtables public API I have found out that there is already something that we were looking for. In general I do believe that exposing more arguments of internal function is a good thing as increases overall flexibility. There might be some use cases that we won't came up with.

pawelru avatar Feb 03 '22 08:02 pawelru