Created
May 13, 2022 21:26
-
-
Save b-rodrigues/948156d09607e5e8e66b80e5b318a854 to your computer and use it in GitHub Desktop.
code to video: https://youtu.be/uxyhmhRVOfw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options(reactable.theme = reactable::reactableTheme( | |
color = "hsl(233, 9%, 87%)", | |
backgroundColor = "#002b36", | |
borderColor = "#eee8d5", | |
stripedColor = "#586e75", | |
highlightColor = "#6c71c4", | |
inputStyle = list(backgroundColor = "hsl(233, 9%, 25%)"), | |
selectStyle = list(backgroundColor = "hsl(233, 9%, 25%)"), | |
pageButtonHoverStyle = list(backgroundColor = "hsl(233, 9%, 25%)"), | |
pageButtonActiveStyle = list(backgroundColor = "hsl(233, 9%, 28%)") | |
)) | |
view <- function(.data){ | |
if(interactive()) { | |
reactable::reactable(.data, | |
filterable = TRUE, | |
searchable = TRUE, | |
showPageSizeOptions = TRUE, | |
striped = TRUE, | |
highlight = TRUE, | |
compact = TRUE, | |
defaultPageSize = 30) | |
} | |
} | |
view_xl <- function(.data){ | |
if(interactive()){ | |
tmp <- tempfile(fileext = ".csv") | |
data.table::fwrite(.data, tmp) | |
browseURL(tmp, browser = "gnumeric") | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this gist. Super useful.
In case you are using Excel on MacOS. Use this line for browseURL: