diff --git a/DESCRIPTION b/DESCRIPTION index d79a839..257b1bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: DSTools Title: A Package for Working with DataShop StudentStep Exports -Version: 0.0.2 +Version: 0.1.0 Authors@R: person("Erik", "Harpstead", email = "eharpste@cs.cmu.edu", role = c("aut", "cre")) Description: This package is primarily designed to make it eaiser to plot nicer looking and more informative learning curve from student-step export data from DataShop(https://pslcdatashop.web.cmu.edu/). Along with the main plotting function there are a set of utility functions that streamline working with the assumed format of a DataShop export. Depends: R (>= 3.2.5) diff --git a/NAMESPACE b/NAMESPACE index 88fdf0d..81e8274 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,7 @@ # Generated by roxygen2: do not edit by hand +export(ds.kcs) +export(ds.models) export(ds.plot) export(ds.read) export(ds.save) -export(ds.kcs) -export(ds.models) \ No newline at end of file diff --git a/R/kcs.R b/R/kcs.R index 4dcd7ba..47740bd 100644 --- a/R/kcs.R +++ b/R/kcs.R @@ -1,7 +1,8 @@ -#' Return a list of the kcs within a partiuclar model. +#' List the KCs available within a partiuclar KC model of a DataShop student-step export #' #' @param stu.step A DataShop Student-Step export data.frame #' @param model The name of a KC model within the dataset +#' @export ds.kcs <- function(stu.step, model) { mod.name <- paste0("KC (",model,")") if(mod.name %in% names(stu.step)) { diff --git a/R/models.R b/R/models.R index b52560f..f469539 100644 --- a/R/models.R +++ b/R/models.R @@ -1,6 +1,7 @@ -#' Return a list of the available KC models in a Student-Step file. +#' List the available KC models in a Student-Step file. #' -#' @param stu.step A Student-Step export from datashop +#' @param stu.step A Student-Step export from DataShop +#' @export ds.models <- function(stu.step) { x <- names(stu.step) m <- regexpr("KC (.*)",x,perl=TRUE) diff --git a/R/plot.R b/R/plot.R index 51d058e..4d5c8ce 100644 --- a/R/plot.R +++ b/R/plot.R @@ -1,8 +1,9 @@ -#library(ggplot2) - -#' A Smooth Plot DataShop Learning Curves +#' Plot Learning Curves from DataShop Student-Step export data #' -#' Creates a loess smoothed ggplot from a student step roll up output from Datashop. +#' The main drawback to DataShop's default plotting representation is that it does not properly convey that +#' N is dropping off in a mastery learning paradigm. This function renders a plot with a loess smoothed +#' confidence channel around the real data and the AFM estimates to convey this trend. The curves themsevles +#' can also be plotted loess smoothed (default) for with discrete averages like standard DataShop #' #' @param stu.step A data.frame of a direct load of a student-step rollup file. #' @param model The name of a KC model to use as it appears in DataShop diff --git a/R/read.R b/R/read.R index bf551fc..f91adbb 100644 --- a/R/read.R +++ b/R/read.R @@ -1,6 +1,7 @@ #' Read in a DataShop Student-Step rollup file #' #' @param file.name The name of the file to read in. +#' @export ds.read <- function(file.name) { return(read.csv(file = file.name,sep="\t",check.names=FALSE,na.strings = c(""," ","#N/A"))) } \ No newline at end of file diff --git a/R/save.R b/R/save.R index ed8f11d..afa7212 100644 --- a/R/save.R +++ b/R/save.R @@ -1,12 +1,14 @@ -#library(ggplot2) - #' Save a ds.plot in a commonly useful png format. #' +#' This is just a basic wrapper around ggplot's ggsave but the default settings make it perfect for fitting into +#' a single column of the ACM/EDM paper format. +#' #' @param plot The plot data #' @param name The desired filename #' @param width The width in inches (defaults to 3, which is recommended width for AcM/EDM format) #' @param height The height in inches (which I default to 2.5) #' @param dpi The dpi to output at (defaults to 300) +#' @export ds.save <- function(plot, name, width=3.3, height=2.08, dpi=300) { ggplot2::ggsave(name,plot=plot,width=width,height=height,dpi=dpi,units="in") } \ No newline at end of file diff --git a/man/ds.kcs.Rd b/man/ds.kcs.Rd index 38cf665..ed35c7e 100644 --- a/man/ds.kcs.Rd +++ b/man/ds.kcs.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/kcs.R \name{ds.kcs} \alias{ds.kcs} -\title{Return a list of the kcs within a partiuclar model.} +\title{List the KCs available within a partiuclar KC model of a DataShop student-step export} \usage{ ds.kcs(stu.step, model) } @@ -12,6 +12,6 @@ ds.kcs(stu.step, model) \item{model}{The name of a KC model within the dataset} } \description{ -Return a list of the kcs within a partiuclar model. +List the KCs available within a partiuclar KC model of a DataShop student-step export } diff --git a/man/ds.models.Rd b/man/ds.models.Rd index b81e41f..5bf81f4 100644 --- a/man/ds.models.Rd +++ b/man/ds.models.Rd @@ -2,14 +2,14 @@ % Please edit documentation in R/models.R \name{ds.models} \alias{ds.models} -\title{Return a list of the available KC models in a Student-Step file.} +\title{List the available KC models in a Student-Step file.} \usage{ ds.models(stu.step) } \arguments{ -\item{stu.step}{A Student-Step export from datashop} +\item{stu.step}{A Student-Step export from DataShop} } \description{ -Return a list of the available KC models in a Student-Step file. +List the available KC models in a Student-Step file. } diff --git a/man/ds.plot.Rd b/man/ds.plot.Rd index 32b166a..c222eee 100644 --- a/man/ds.plot.Rd +++ b/man/ds.plot.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/plot.R \name{ds.plot} \alias{ds.plot} -\title{A Smooth Plot DataShop Learning Curves} +\title{Plot Learning Curves from DataShop Student-Step export data} \usage{ ds.plot(stu.step, model, kc = "all", line.type = "smooth", title = NULL, legend.position = "none", label.scale = 1) @@ -23,7 +23,10 @@ ds.plot(stu.step, model, kc = "all", line.type = "smooth", title = NULL, \item{label.scale}{A scaling factor for the axis label and title text.} } \description{ -Creates a loess smoothed ggplot from a student step roll up output from Datashop. +The main drawback to DataShop's default plotting representation is that it does not properly convey that +N is dropping off in a mastery learning paradigm. This function renders a plot with a loess smoothed +confidence channel around the real data and the AFM estimates to convey this trend. The curves themsevles +can also be plotted loess smoothed (default) for with discrete averages like standard DataShop } \keyword{ds.plot} diff --git a/man/ds.save.Rd b/man/ds.save.Rd index 1719eef..45940a0 100644 --- a/man/ds.save.Rd +++ b/man/ds.save.Rd @@ -18,6 +18,7 @@ ds.save(plot, name, width = 3.3, height = 2.08, dpi = 300) \item{dpi}{The dpi to output at (defaults to 300)} } \description{ -Save a ds.plot in a commonly useful png format. +This is just a basic wrapper around ggplot's ggsave but the default settings make it perfect for fitting into +a single column of the ACM/EDM paper format. }