-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save_to_excel not allowing lists #153
Comments
Thanks for the bug report, I am working on a few things for the next release so this will be one of themSent from my iPhonewww.spsanderson.comOn Mar 2, 2023, at 12:41 PM, Albert Crosby ***@***.***> wrote:
save_to_excel() is not accepting lists, such as generated by named_item_list().
Changing
if (!is.data.frame(.data))
to
if (is.data.frame(.data) | is.list(.data))
would be a partial solution, but wouldn't guarantee that the list is a named list of data frames that could be used by writexl::write_xlsx()
adding another if statement like
if (is.list(.data) & !all(unlist(map(.data,is.data.frame)))) { stop(call. = FALSE, "(.data) is a list, but is not a list of data.frames/tibbles. Please supply a valid list") }
would at least check to ensure that each element of .data is a data.frame/tibble. Might still need to check to see if they are named...
BTW, that's a cool trick and feature of write_xlsx() that i'd missed...
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
save_to_excel() is not accepting lists, such as generated by named_item_list().
Changing
if (!is.data.frame(.data))
to
if (is.data.frame(.data) | is.list(.data))
would be a partial solution, but wouldn't guarantee that the list is a named list of data frames that could be used by writexl::write_xlsx()
adding another if statement like
if (is.list(.data) & !all(unlist(map(.data,is.data.frame)))) { stop(call. = FALSE, "(.data) is a list, but is not a list of data.frames/tibbles. Please supply a valid list") }
would at least check to ensure that each element of .data is a data.frame/tibble. Might still need to check to see if they are named...
BTW, that's a cool trick and feature of write_xlsx() that i'd missed...
The text was updated successfully, but these errors were encountered: