Skip to content

Commit

Permalink
Finalize for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinfife committed Sep 24, 2019
1 parent caa286c commit 7d2be66
Show file tree
Hide file tree
Showing 13,655 changed files with 1,774 additions and 2,739,177 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2,251 changes: 1,139 additions & 1,112 deletions .Rapp.history

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
^README\.Rmd$ # An Rmarkdown file used to generate README.md
^jamovi$
^icon$ # An Rmarkdown file used to generate README.md
^\.jmo$ # An Rmarkdown file used to generate README.md
^build$
^icon\.png$ # An Rmarkdown file used to generate README.md
^icon\.svg$ # An Rmarkdown file used to generate README.md
^flexplot\.jmo$ # An Rmarkdown file used to generate README.md
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: flexplot
Type: Package
Title: Flexplot - Graphically Based Data Analysis
Version: 0.5.1
Title: Graphically Based Data Analysis Using Flexplot
Version: 0.5.2
Author: Dustin Fife
Maintainer: Dustin Fife <[email protected]>
Description: The flexplot suite is a graphically-based set of tools for doing data. analysis. Flexplot allows users to specify a formula and the software automatically choses what sort of graphic to present. General Linear Model allows linear modeling and, like flexplot, chooses an appropriate graphic to present alongside the statistical results.
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export(standardized.beta)
export(subsetString)
export(uni.plot)
export(visualize)
import(dplyr)
import(dplyr, except = c(filter, lag))
import(ggplot2)
import(stats)
import(tibble)
Expand Down
248 changes: 247 additions & 1 deletion R/data_documentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,250 @@
#' \item{Month}{Month Published}
#' \item{age}{Age of book}
#' }
"authors"
"authors"

#' Dataset examines what affects blood pressure.
#'
#' This dataset looks at how various lifestyle choices affect blood pressure.
#'
#' @format A data frame with xx rows and 4 variables:
#' \describe{
#' \item{BP}{Blood pressure level}
#' \item{Exercise}{description}
#' \item{Vegetarian}{Whether the subject is vegetarian or not.}
#' \item{Stress}{Level of stress}
#' }
"blood_pressure"


#' Dataset seeks to examine what can affect birthweight.
#'
#' This dataset examines how various variables, especially related to parents, can affect the birthweight of a baby.
#'
#' @format A data frame with xx rows and 16 variables:
#' \describe{
#' \item{id}{observation id}
#' \item{headcirumference}{Circumference of baby's head.}
#' \item{length}{description}
#' \item{Birthweight}{Weight at time of baby's head.}
#' \item{Gestation}{Length of time baby was gestated.}
#' \item{smoker}{is the mother a smoker (1=yes)}
#' \item{motherage}{Age of mother.}
#' \item{mnocig}{number of cigarettes smoked by mother}
#' \item{mheight}{mother's height}
#' \item{mppwt}{mother pre pregnancy weight}
#' \item{fage}{father's age}
#' \item{fedyrs}{father's years of education}
#' \item{fnocig}{father number of cigarettes}
#' \item{fheight}{father height}
#' \item{lowbwt}{binary indicator of whether it's considered low weight or not}
#' \item{mage35}{mother's age, centered on 35}
#' \item{LowBirthWeight}{Same as above, but labeled}
#' }
"birthweight"

#' Dataset examines what affects cholesterol.
#'
#' This dataset looks at how margarine effect cholesterol
#'
#' @format A data frame with xx rows and 4 variables:
#' \describe{
#' \item{ID}{description}
#' \item{Margarine}{description}
#' \item{Week}{description}
#' \item{Cholesterol}{description}
#' }
"cholesterol"


#' Criminal dataset
#'
#' This is a simulated dataset that looks at how various variables affect convictions and rape instances
#'
#' @format A data frame with xx rows and 6 variables:
#' \describe{
#' \item{ses}{Socioeconomic status of the subject}
#' \item{empathy}{description}
#' \item{depression}{Whether the subject is depressed}
#' \item{rape}{description}
#' \item{convictions}{How many times the subject has been convicted of a crime}
#' \item{aggression}{How aggressive the subject is}
#' }
"criminal_data"


#' Diet dataset
#'
#' This dataset seeks to examine how effective certain diets can be for losing weight.
#'
#' @format A data frame with xx rows and 6 variables:
#' \describe{
#' \item{Person}{description}
#' \item{gender}{The subject's gender}
#' \item{Age}{Age of the subject}
#' \item{Height}{Height of the subject}
#' \item{pre.weight}{Weight of the subject before the diet}
#' \item{weight6weeks}{Weight of the subject after 6 weeks}
#' \item{Diet}{Type of diet the subject went on}
#' }
"diet"


#' Drug use and SES
#'
#' This dataset looks at a possible relationship between drug usage and socioeconomic status.
#'
#' @format A data frame with xx rows and 3 variables:
#' \describe{
#' \item{drug.use}{description}
#' \item{SES}{Socioeconomic status of the subject}
#' \item{therapy}{Whether subjects attends therapy for drug use}
#' }
"drug_use"


#' Exercise dataset
#'
#' Simulated data that sees how weight loss varies as a function of various predictors, and treatment condition
#'
#' @format A data frame with xx rows and 13 variables:
#' \describe{
#' \item{therapy.type}{description}
#' \item{health}{description}
#' \item{motivation}{description}
#' \item{weight.loss}{description}
#' \item{gender}{description}
#' \item{satisfaction}{description}
#' \item{rewards}{description}
#' \item{income}{description}
#' \item{muscle.gain}{description}
#' \item{muscle.gain.missing}{description}
#' \item{six.mo.weight}{description}
#' }
"exercise_data"



#' Graduate income
#'
#' This dataset examines whether schools and academic performance can lead to higher income in professions. Simulated data
#'
#' @format A data frame with xx rows and 4 variables:
#' \describe{
#' \item{Grad.School}{Whether the subject attended grad school}
#' \item{Profession}{Profession of the subject}
#' \item{GPA}{GPA of the subject}
#' \item{Income}{The current income of the subject}
#' \item{Years}{Years since they graduated}
#' }
"graduate_income"

#' Math Achievement Dataset
#'
#' Examines the relationship between various variables and math achievement. Great for HLM.
#'
#' @format A data frame with xx rows and 6 variables:
#' \describe{
#' \item{School}{Which school the subject attends}
#' \item{Minority}{description}
#' \item{Sex}{Gender of the subject}
#' \item{SES}{Socioeconomic status of the subject}
#' \item{MathAch}{description}
#' \item{MEANSES}{description}
#' }
"math"

#' NSDUH Dataset
#'
#' This is the 2014 National Survey of Drug Use and Health (NSDUH) dataset
#'
#' @format A data frame with xx rows and 27 variables:
#' \describe{
#' \item{cig.rec}{smoked cigarettes recently?}
#' \item{alc.rec}{used alcohol recently?}
#' \item{coc.rec}{used cocain recently?}
#' \item{her.rec}{used heroin recently?}
#' \item{alc.freq}{frequency of alcohol use}
#' \item{cocain.freq}{frequency of cocain use}
#' \item{heroin.freq}{frequency of heroin use}
#' \item{cig.freq}{frequency of cigarette use}
#' \item{inpatient}{have they received inpatient treatment?}
#' \item{outpatient}{have they received outpatient treatment?}
#' \item{moves.past5}{moved in the past 5 years?}
#' \item{attend.rel.serv}{do you attend religious services?}
#' \item{rel.inf.dec}{how influential is religion on your decisions?}
#' \item{distress}{mental distress score}
#' \item{whodas.impairment}{mental impairment score}
#' \item{MI}{probability of mental illness}
#' \item{major.dep}{ever had major depression}
#' \item{dep.pas.yr}{depression in the past year}
#' \item{age}{age}
#' \item{military}{been in military}
#' \item{health.rating}{self reported health rating}
#' \item{sex}{sex}
#' \item{education}{educational attainment}
#' \item{race}{race}
#' \item{county}{type of county they live in (small metro, large metro, etc)}
#' \item{income}{how much bank they make}
#' }
"nsduh"

#' Plant Growth
#'
#' Measures of seedling growth depending on various characteristics. NOT simulated data.
#'
#' @format A data frame with xx rows and 5 variables:
#' \describe{
#' \item{Location}{Location stored (greenhouse vs inside)}
#' \item{Soil.Type}{Type of soil used}
#' \item{Method}{Method of planting (soil blocks versus newspaper)}
#' \item{Diameter}{Diameter of trunk}
#' \item{Leaves}{Number of leaves}
#' }
"plant_growth"

#' Relationship satisfaction dataset
#'
#' Data about various factors affecting relationship satisfaction. Simulated data.
#'
#' @format A data frame with xx rows and 7 variables:
#' \describe{
#' \item{conscientiousness}{description}
#' \item{honesty}{description}
#' \item{communication}{description}
#' \item{interests}{description}
#' \item{satisfaction}{description}
#' \item{separated}{description}
#' \item{gender}{description}
#' }
"relationship_satisfaction"

#' Secret agent dataset
#'
#' Simulated data about various characteristics of secret agents
#'
#' @format A data frame with xx rows and 7 variables:
#' \describe{
#' \item{muscle}{bicep circumference}
#' \item{height}{height in inches}
#' \item{tortured}{have they been tortured on a mission?}
#' \item{missions}{number of missions completed}
#' \item{Course.Score}{score on an obstacle course}
#' \item{Branch}{Branch of service (CIA versus MI6)}
#' \item{Salary}{Annual salary}
#' }
"secret_agent"

#' Tablesaw injuries
#'
#' Simulated data about the probability of getting injured by a tablesaw
#'
#' @format A data frame with xx rows and 5 variables:
#' \describe{
#' \item{safety}{description}
#' \item{attention}{description}
#' \item{gender}{description}
#' \item{probs}{description}
#' \item{injury}{description}
#' }
"tablesaw.injury"
5 changes: 4 additions & 1 deletion R/estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ estimates.default = function(object){
#'
#' Report lm object Estimates
#' @param object a lm object
#' @import dplyr
#' @rawNamespace import(dplyr, except = c(filter, lag))
#' @export
estimates.lm = function(object){

Expand Down Expand Up @@ -326,6 +326,9 @@ estimates.glm = function(object){
#' @export
estimates.zeroinfl = function(object){

#### get dataset
d = object$model

#### generate list of coefficients
terms = attr(terms(object), "term.labels")

Expand Down
10 changes: 3 additions & 7 deletions R/flexplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
##' @param silent Should all messages be suppressed? Defaults to F.
##' @param third.eye Should the "third eye" be employed? The third eye will be implemented shortly.
##' @author Dustin Fife
##' @import tibble ggplot2
##' @import tibble ggplot2 R6
##' @export
##' @examples
#' data(exercise_data)
Expand Down Expand Up @@ -64,18 +64,14 @@
#' # #### 2N PLOT (2 NUMERIC VARIABLE PLOTS)
##' flexplot(weight.loss~motivation + income, data=d, se=FALSE, method="lm")
##' flexplot(weight.loss~motivation + income, data=d, se=FALSE, method="lm",
##' breaks = list(c(95000, 100000, 105000)),
##' labels=list(c("<95K", "<100K", "<105K", ">105K")))
##' breaks = list(income = c(95000, 100000, 105000)),
##' labels=list(income = c("<95K", "<100K", "<105K", ">105K")))
##' ### change labels for income
#'
#' # #### 3N plot
##' flexplot(weight.loss~motivation + income + health, data=d, se=FALSE, method="lm")
##' ## different lines for income
##' flexplot(weight.loss~motivation | income + health, data=d, se=FALSE, method="lm")
##' ## different panels for income
##' flexplot(weight.loss~motivation | income + health, data=d, se=FALSE, method="lm",
##' breaks = list(c(95000, 100000, 105000)),
##' labels=list(c("<95K", "<100K", "<105K", ">105K")))
##' ## relabel income
##' flexplot(weight.loss~motivation | income + health, data=d, se=FALSE, method="lm", ghost.line="red",
##' breaks = list(income = c(95000, 100000, 105000)),
Expand Down
Loading

0 comments on commit 7d2be66

Please sign in to comment.