Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
Add hard disk failure data to package
  • Loading branch information
boennecd committed Nov 4, 2017
1 parent d9678c3 commit ce2f0d7
Show file tree
Hide file tree
Showing 20 changed files with 122 additions and 35 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ sandbox
speedtest
tests/testthat/previous_results/local_tests
README_cache
data-raw
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
58 changes: 58 additions & 0 deletions R/HDs.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#' @title Hard Drive failures.
#'
#' @description
#' A data set containing hard drive failures data from Backblaze in the
#' start-stop format used in the \code{survival} package.
#'
#' @details
#'
#' Details about the the SMART attributes can be found on
#' \url{https://en.wikipedia.org/wiki/S.M.A.R.T.}. As stated in the orginal
#' source
#'
#' "Reported stats for the same SMART stat can vary in meaning based on the
#' drive manufacturer and the drive model. Make sure you are comparing
#' apples-to-apples as drive manufacturers don't generally disclose what their
#' specific numbers mean."
#'
#' There are some notes on \url{https://en.wikipedia.org/wiki/S.M.A.R.T.}
#' regarding which attributes that have vendor specific raw value. Further,
#'
#' "The values in the files are the values reported by the drives. Sometimes,
#' those values are out of whack. For example, in a few cases the RAW value of
#' SMART 9 (Drive life in hours) reported a value that would make a drive 10+
#' years old, which was not possible. In other words, it’s a good idea to have
#' bounds checks when you process the data."
#'
#' Last value carried forward have been used for all covariates. See this
#' github page for the processing steps
#' \url{https://github.com/boennecd/backblaze_survival_analysis_prep}.
#'
#'
#' @format A \code{data.frame} with the following columns:
#' \describe{
#' \item{serial_number}{Serial number for the hard disk which the row belongs
#' to.}
#' \item{model}{hard disk model.}
#' \item{manufacturer}{manufacturer of the hard disk model.}
#' \item{tstart,tstop}{start and stop times on the SMART 9 attribute scale.}
#' \item{fails}{1 if the hard disk fails at \code{tstop}.}
#' \item{size_tb}{hard disk size in terabytes.}
#' \item{smart_x}{the raw SMART attribute x value. E.g., \code{smart_12} is the power cycle count.}
#' \item{smart_x_bin}{1 if the SMART attribute x value is non-zero.}
#' \item{..._cumsum}{cumulative sum of the prefix \code{...}.}
#' \item{n_fails}{number of failures in the orginal data. Hard disk should
#' only fail once but this is not the case in the raw data.}
#' \item{n_records}{number of records in the original source.}
#' \item{min_date,max_date}{first and last date in the original source.}
#' \item{min_hours,max_hours}{smallest and largest value of the SMART 9
#' attribute in the original source.}
#' }
#'
#' @usage
#' data("hds", package = "dynamichazard")
#'
#' @source
#' Raw data from \url{https://www.backblaze.com/b2/hard-drive-test-data.html}.
#' Data have been processed to get a start-stop \code{data.frame} format.
"hds"
13 changes: 1 addition & 12 deletions R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,8 @@ print.ddhazard_boot <-
}


#' @title Print function for \code{ddhazard} result
#'
#' @param x object returned from \code{\link{ddhazard}}.
#' @param var_indices variable indices to print for time-varying effects.
#' @param time_indices time intervals to print for time-varying effects.
#' @param digits number of digits to print.
#' @param ... not used.
#'
#' @description
#' The \code{sd} printed for time-varying effects are point-wise standard deviations from the smoothed covariance matrices.
#'
#' @export
print.ddhazard<- function(x){
print.ddhazard<- function(x, ...){
cat("Call:", deparse(x$call), sep = "\n")

cat("\n", sQuote(x$model), " model fitted with the ", sQuote(x$method),
Expand Down
1 change: 1 addition & 0 deletions data-raw/hds
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
See hds data set is a processed form of the raw `.csv` files from Backblaze. See this repository for the code https://github.com/boennecd/backblaze_survival_analysis_prep.
Binary file added data/hds.rda
Binary file not shown.
60 changes: 60 additions & 0 deletions man/hds.Rd

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

22 changes: 0 additions & 22 deletions man/print.ddhazard.Rd

This file was deleted.

Binary file modified speedtest/speedtest.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion vignettes/Comparing_methods_for_logistic_models.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ header-includes:
output:
pdf_document:
fig_caption: yes
bibliography: pbc_data.bib
bibliography: bibliography.bib
csl: bib_style.csl
vignette: >
%\VignetteIndexEntry{Comparing methods for time varying logistic models}
Expand Down
File renamed without changes.

0 comments on commit ce2f0d7

Please sign in to comment.