Giter VIP home page Giter VIP logo

msslstyleguide's People

Contributors

abtsai avatar mickremedi avatar philliplagoc avatar rexdouglass avatar rohan-b avatar tjbrailey avatar tlscherer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msslstyleguide's Issues

Problem with usethis package

Easy to solve, but thought I'd note it in case we want to update the repo setup wiki

devtools::install_github("r-lib/usethis")

Gives the following error message:

Downloading GitHub repo r-lib/usethis@master
from URL https://api.github.com/repos/r-lib/usethis/zipball/master
Installing usethis
Downloading GitHub repo ropensci/git2r@master
from URL https://api.github.com/repos/ropensci/git2r/zipball/master
WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.0 was found. (Only the following incompatible version(s) of Rtools were found:3.4)

Please download and install the appropriate version of Rtools from http://cran.r-project.org/bin/windows/Rtools/.
Installation failed: Could not find build tools necessary to build git2r
Downloading GitHub repo tidyverse/glue@master
from URL https://api.github.com/repos/tidyverse/glue/zipball/master
WARNING: Rtools is required to build R packages, but no version of Rtools compatible with R 3.5.0 was found. (Only the following incompatible version(s) of Rtools were found:3.4)

Please download and install the appropriate version of Rtools from http://cran.r-project.org/bin/windows/Rtools/.
Installation failed: Could not find build tools necessary to build glue
"C:/PROGRA1/R/R-351.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL
"C:/Users/Andres/AppData/Local/Temp/Rtmp6viIbM/devtools24305e003810/r-lib-usethis-8483d1e" --library="C:/Users/Andres/Documents/R/win-library/3.5" --install-tests

Problem with pipe operator

I have trouble with the pipe operator, not sure why.

MWE

iiss <- readRDS(file = paste0(here::here(), '/data/IISS.rds')) %>%
      janitor::clean_names() %>%
      janitor::remove_empty_rows() %>%
      janitor::remove_empty_cols()

Returns error:
Error in readRDS(file = paste0(here::here(), "/data/IISS.rds")) %>% janitor::clean_names() %>% :
could not find function "%>%"

StyleGuide todo list

to add

Saving dataset with packages (New procedure) #28:

We're switching over to the recommended method of saving and loading datasets from a package
http://r-pkgs.had.co.nz/data.html
See convert_gw_to_nation.r for an example
We save a file locally as part of the package in a /data/ folder using the command
devtools::use_data(object_you_want_to_save,
overwrite = TRUE)
We then load it
data(object_you_want_to_save, package = "NamedEntities")

qdapTools %l% and Error in [.data.frame(key, c("x", "y")) : undefined columns selected #29:

For dumb reasons, qdapTools requires your lookup table to be a data.frame, even though it uses data.tables in the back end.
The error message is not that helpful.

Invitation to Dropbox

The project setup section mentioned making a new issue to get Dropbox access.
My dropbox email is [email protected] (same as on wiki). I am assuming David probably needs access too.

Bookdown

Guide rex finds useful

put prefer to use Rmarkdowns and can refresh on the chrome browser
with bookdown have to manually knit each chapter, sometimes have to knit index chapter first

Rex's flow: write each chapter as a Rmarkdown, and then turn into bookdown book

CableExtra citations in tables:
example

Covid book example

Trick for Not Having to Type in your Github Password Every Single Push

https://help.github.com/articles/caching-your-github-password-in-git/

Turn on the credential helper so that Git will save your password in memory for some time. By default, Git will cache your password for 15 minutes.

In Terminal, enter the following:

git config --global credential.helper cache

Set git to use the credential memory cache

To change the default password cache timeout, enter the following:

git config --global credential.helper 'cache --timeout=3600'

Set the cache to timeout after 1 hour (setting is in seconds

ICBe style lessons

Possible style guide add-ons from ICBe

  • use a bookdown output instead of rticles so that you can use cross doc referencing
  • make all file names in Rmds user ambivalent with here::here()
  • include package address for functions including dplyr
  • for tables, load data and format in paper
  • for figures, load data and format in paper or load image file.
  • isolate non-cross platform parts as much as possible, either with fromscratch or in separate files
  • add titles to figures with caption command in paper to allow for reference. Do not add title direct to image.
  • designate one file as master paper file. if you create another copy for testing or to share, you are in charge of deleting the copy and getting those edits into master copy

MSSL

I would like access to the rex and MSSL dropboxes.

Basic Lyx lessons

load a table, load a graphic, add and refer to labels, different kinds of comments, track changes, bibliography

Making plots better

Here's a 2018 book based around ggplot
https://rkabacoff.github.io/datavis/

Here's Wickham's 2016 book based on his dissertation. This is mostly walking through the design philosophy of ggplot and why he built a tool to encourage you to think about graphics in the right way
http://www.ievbras.ru/ecostat/Kiril/R/Biblio_N/R_Eng/Wickham2016.pdf

Here's a chapter on graphics in the R for data science book
https://r4ds.had.co.nz/graphics-for-communication.html

That will help with the coding details of plots but what you really need is guidance on how to present. Tom and I learned it through brute force watching hundreds of terrible presentations with some scattered good ones.

Tom and I will rack our brain about cites on presenting statistical results for an audience.

Let me give some quick guidance off the top of my head
-Each plot makes an argument. One plot, one argument. For each plot I want you guys to think through exactly what argument you want that plot to make.
-Each plot should have as much detail as necessary to make that argument but no more.
-The only exception to the above is when there are simple extra concerns you might be able to answer visually and intensively.

So for example, if your argument is that the mean of this group is higher than that group, then maybe you want a bar plot. But the first question might be, are these means statistically distinguishable, so might add confidence intervals. If you're presenting a trend line fit to data, the first question might be what's the underlying support of the data (e.g. is there only one or two data points out here where the line dips low), so you decide to plot the raw points underneath the line.

Some issues with the plots recently
-Poor visually vocabulary. Bars, labels, and colors are introduced in one plot as meaning one thing, and then resused to mean something completely different in the next plot. It's the equivalent of defining a new work "asdasd" and saying it means sky, and then two sentences later, using it to mean front door. Like in music, or movies, or art, or a conversation, you are agreeing with the audience on a set of rules that they expect to hold for some amount of time. If you change those quickly, you piss off your audience.
-Hard to read, constantly changing labels. Constantly turning my head sideways to try to see if a axis label means what I think it means, long variable labels with 3 pieces of information shoved into the same string.
-Plots that aren't self explanatory. Someone should be able to look at our plot and know exactly what it means, even if they're not familiar with all the underlying questions and refferants. If you have to stand there and explain a plot, then it's a failure.
-Including unlike things in the same plot. Sometimes we're including side by side our results alongside other people's results without any clear markings to tell the difference. If 3 bars are our runs, and a 4th is the original paper there needs to be an obvious break there because those aren't the same thing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.