Coder Social home page Coder Social logo

sweets's Introduction

sweets sweets website

Steve’s Workflow for Enumerating Elegant Text listings and SAS dispositions

Installation

You can install the development version of sweets from GitHub with:

# install.packages("devtools")
devtools::install_github("shum461/sweets")
#> Using github PAT from envvar GITHUB_PAT
#> Downloading GitHub repo shum461/sweets@HEAD
#> Skipping 1 packages ahead of CRAN: reporter
#> * checking for file ‘/tmp/RtmpTpsRBO/remotes16d554c5ccf/shum461-sweets-57c4dbc/DESCRIPTION’ ... OK
#> * preparing ‘sweets’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * looking to see if a ‘data/datalist’ file should be added
#>   NB: this package now depends on R (>= 3.5.0)
#>   WARNING: Added dependency on R >= 3.5.0 because serialized objects in
#>   serialize/load version 3 cannot be read in older versions of R.
#>   File(s) containing such objects:
#>     ‘sweets/data/fake_data.RData’
#> * building ‘sweets_0.0.0.9000.tar.gz’
#> Installing package into '/tmp/RtmpU7hdZu/temp_libpath1e6f23874f'
#> (as 'lib' is unspecified)

Example

This is a basic example which shows you how to solve a common problem:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(dmcognigen)
#> Loading dmcognigen Version 0.0.9000
library(sweets)

packageVersion('sweets')
#> [1] '0.0.0.9000'
# modified iris data
fd <- get(data("fake_data"))
fd %>%
cnt(DELFN,STUDY,n_distinct_vars = USUBJID, prop = FALSE, pct = FALSE)
#> # A tibble: 13 × 5
#>    DELFN STUDY      n_USUBJID     n n_cumulative
#>    <dbl> <chr>          <int> <int>        <int>
#>  1     0 setosa            12    46           46
#>  2     0 versicolor         9    38           84
#>  3     0 virginica         10    36          120
#>  4     4 setosa             3     8          128
#>  5     5 setosa            11    56          184
#>  6     5 versicolor         2     4          188
#>  7     5 virginica          1     2          190
#>  8     6 setosa             1     2          192
#>  9     6 versicolor        12    48          240
#> 10     6 virginica         11    40          280
#> 11     7 versicolor         5    14          294
#> 12     7 virginica          7    20          314
#> 13     8 virginica          3     6          320

Error: callr subprocess failed: ‘sweet_disposition’ is not an exported object from ‘namespace:sweets’

# fd %>%
#   sweets::sweet_disposition(subjid = USUBJID,
#                       group_vars = STUDY)

Count and Keeps

add deletion flags to ‘r cnt_n_keeps’
if you wish to count but not remove samples and subjects

# fd %>%
#     sweet_disposition(subjid = USUBJID,
#                       group_vars = STUDY, cnt_n_keeps = c(6,7)) 

What is special about using README.Rmd instead of just README.md? You can include R chunks like so:

summary(cars)
#>      speed           dist       
#>  Min.   : 4.0   Min.   :  2.00  
#>  1st Qu.:12.0   1st Qu.: 26.00  
#>  Median :15.0   Median : 36.00  
#>  Mean   :15.4   Mean   : 42.98  
#>  3rd Qu.:19.0   3rd Qu.: 56.00  
#>  Max.   :25.0   Max.   :120.00

sweets's People

Contributors

shum461 avatar

Watchers

 avatar

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.