atlas-aai / ratlas Goto Github PK
View Code? Open in Web Editor NEWCustom graphics and report generation for @atlas-aai
Home Page: https://ratlas.netlify.app
Custom graphics and report generation for @atlas-aai
Home Page: https://ratlas.netlify.app
create a hex logo for the package.
Based on my pet peeves, I've decided against changing plotting defaults automatically when the package is loaded. However, let's write a couple functions that can globally set options if someone desires (i.e., could be used in the setup chunk of an Rmd).
There should be two versions: one for theme_atlas()
(#5) and one for theme_atlas_ms()
(#10). These functions should:
Create a vignette showcasing how to create atlas themed ggplot2 plots. Should include how to use:
theme_atlas()
(#5)theme_atlas_ms()
(#10)Should probably also begin with a brief section directing users to general ggplot2 resources, for those who aren't as familiar with ggplot2. Some ideas, but feel free to add others you have come across:
The `...` argument of `across()` is deprecated as of dplyr 1.1.0.
Supply arguments directly to `.fns` through an anonymous function instead.
# Previously
across(a:b, mean, na.rm = TRUE)
# Now
across(a:b, \(x) mean(x, na.rm = TRUE))
Prepare for release:
devtools::check()
devtools::check_win_devel()
rub::check_for_cran()
Submit to CRAN:
usethis::use_version("major")
cran-comments.md
devtools::submit_cran()
Wait for CRAN...
usethis::use_github_release()
usethis::use_dev_version()
remotes::install_github("atlas-aai/ratlas")
Error: Failed to install 'unknown package' from GitHub: HTTP error 404. No commit found for the ref master Did you spell the repo owner (atlas-aai
) and repo name (ratlas
) correctly? - If spelling is correct, check that you have the required permissions to access the repo.
This vignette should demonstrate how to use ratlas to write reports.
R/
- for analysis scriptsdata-raw/
- for raw data filesdata/
- for cleaned data, or intermediate data filesoutput/
- for final output files to be read into report, if not calculated in the report directlyknitr::combine_words()
from MK--
"In prepping a bunch of slide decks for presentations at conferences with stringent accessibility criteria, I ran into a case where we had to rebuild a graph originally generated in r by hand-entering the stats into excel and reproducing the graph. This was the best path toward getting the figure to meet accessibility criteria, rather than writing a long paragraph of alt text that didn’t conform to certain standard sequencing of information. This experience made me think R&P might want to consider extra commands in their scripts for some types of figures so we can get data like that in a little table that easily reads into excel. In this case it was clustered bar graphs showing percentages, if that helps the idea become more concrete. I can see how other graphs would be hard to reproduce in tabular form that excel would know what to do with.
I don’t have a particular solution or goal – just handing it off for consideration."
Should follow the same structure as functions for topicguide_docx, but for pdf tech reports. The latex template can be found in the IE Usage report repo.
I would like to have a custom atlas ggplot2 theme that we can add to all our graphics with something like
+ theme_atlas()
My ideal look would be similar to theme_ipsum()
from hrbrthemes, so that's probably a good place to start in terms of how to create a theme. He also has examples of how to write tests for these functions, so we will want to mimic that as well. We'll want to make some modifications to this. For example, in theme_ipsum
axis title are not centered by default, and have a smaller font and the axis text. It would also be good to have the legend be at the bottom of the plot by default.
In addition, I'm hoping you can google around and figure out how to set a default color palette. I ideally, we would use palette_OkabeIto
from the colorblindr package for discrete scales, and viridis
from viridisLite for continuous scales. I feel like I've seen somewhere how to change the default color scales, but I can't remember now.
What I'm hoping for is that this:
library(tidyverse)
library(ratlas)
ggplot(mtcars, aes(x = mpg, y = disp)) +
geom_point(aes(color = factor(cyl))) +
theme_atlas()
Will do the same thing as:
library(tidyverse)
library(hrbrthemes)
library(colorblindr)
ggplot(mtcars, aes(x = mpg, y = disp)) +
geom_point(aes(color = factor(cyl))) +
scale_color_OkabeIto() +
theme_ipsum(axis_title_just = "c",
axis_title_size = 12,
axis_text_size = 10) +
theme(legend.position = "bottom")
Created on 2019-05-15 by the reprex package (v0.2.1)
Images don't render in HTML document if alt text isn't provided in the fig.alt
parameter. Images should render with fig.alt
defaulting to fig.cap
if alt text is not provided.
IDEA:
add checks to verify arguments sent into functions
wrap kableExtra::kbl()
to apply common formatting
kableExtra::kable_styling()
kbl()
kable_classic()
fmt_prop
is not rendering correctly for html versions of the tech manual, specifically values that become <.01, <.001, etc. It appears that the code for the less than symbol is being misinterpreted when rendering to html output.
This should be very similar to theme_atlas
, but using the Montserrat font. See theme_ipsum_tw
from hrbrthemes for an example of using a new font, and importing the font.
Should also include a function to set the default text and label fonts (see the update_geom_font_defaults()
function in theme-atlas.R
, which may need to be renamed).
After applying fmt_table()
, we need a helper function to combine two columns, n
and pct
, into a single column n (%)
that preserves the spacing added by fmt_table()
Example synopses:
Possibly use {pagedreport} as an example template we could build on?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.