Skip to content

Commit

Permalink
mostly documentation updates but also noticed I was @exporting most o…
Browse files Browse the repository at this point in the history
…f the functions
  • Loading branch information
eharpste committed Jul 14, 2016
1 parent 422cf37 commit 59e8bbd
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", 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)
Expand Down
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion R/kcs.R
Original file line number Diff line number Diff line change
@@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions R/models.R
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 5 additions & 4 deletions R/plot.R
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions R/read.R
Original file line number Diff line number Diff line change
@@ -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")))
}
6 changes: 4 additions & 2 deletions R/save.R
Original file line number Diff line number Diff line change
@@ -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")
}
4 changes: 2 additions & 2 deletions man/ds.kcs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/ds.models.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions man/ds.plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/ds.save.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 59e8bbd

Please sign in to comment.