GithubHelp home page GithubHelp logo

medman1025 / n741pkg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from melindahiggins2000/n741pkg

0.0 1.0 0.0 250 KB

N741 Package of R code and templates for course

License: Other

R 100.00%

n741pkg's Introduction

N741pkg

Build Status

Package Last Updated: 03-13-2017

N741 Package of R code and templates for course

Install from Github

devtools::install_github("melindahiggins2000/N741pkg")

NOTE 1: You need to install the devtools package first to use the devtools""install_github() function.

NOTE 2: This package also needs the dplyr package, be sure to also have dplyr installed, which is part of tidyverse.

View Vignette Demo

Description

This package was created for N741 Big Data Analytics for Healthcare. It contains functions and R Markdown templates helpful in this course.

To date, this N741pkg includes 2 functions and 1 R Markdown template described below.

Functions Included

To date, this package includes 2 functions:

  • tbl.continuous(x,x$a,"label for var a")

    • This function creates a table of summary statistics for a numeric variable in a data frame.
    • There are 3 arguments you need to provide:
      • a data.frame, df
      • a column variable from the data.frame df$var
      • a character vector to serve as a label for the variable "var label"
    • The returned table is a data.frame object with 1 row and 10 variables/columns. These 10 columns include:
      • item: the variable label provided
      • n: the number of non-missing values
      • missing: the number of missing values
      • min: the minimum value
      • avg: the average/mean value
      • SD: the standard deviation of the values
      • median: the median value
      • Q1: the 25th percentile (1st quartile) of the values
      • Q3: the 75th percentile (3rd quartile) of the values
      • max: the maximum value
  • tbl.cat(gx,gx$b)

    • This function creates a table of summary statistics (frequencies and percents) for a categorical (or ordinal) variable in a data frame.
    • There are 2 arguments you need to provide:
      • a "grouped" data.frame, gdf SEE NOTE
      • a column variable from the "grouped" data.frame gdf$var
    • NOTE A "grouped" data.frame can be created using the dplyr::group_by() function. See the example provided with help(tbl.cat). You need to "group_by" the categorical (or ordinal) variable you want to make the table for.
    • The returned table is a data.frame object with 1 row and 3 variables/columns. These 3 columns include:
      • var: the categorical variable categories or ordinal levels
      • freq: the frequencies (or counts) for each category or level
      • pct: the percentage of the total number of rows - these percents are NOT adjusted for missing. However, the frequency and percentage of NAs are provided.

Template Included

To date, this package includes 1 R Markdown Template "N741 Final Project". After installing the N741pkg (from Github using devtools::install_github() listed above), you will be able to access the R Markdown template(s) included. To access these custom templates, use the File Menu to create a new R Markdown file:

newrmd

When creating a new R Markdown file, in addition to "Document", "Presentation", and "shiny", you can also create a new R Markdown documents "From Template". Any packages you have installed which have templates included will show up here. After installing N741pkg you should see the "N741 Final Project" listed - just select the template and click "OK".

rmdtemplate

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.