パッケージ 'reporttools' の情報
記述:
Package: reporttools
Type: Package
Title: 記述統計の結果を LaTeX 表として生成する;Generate LaTeX tables of descriptive statistics
Version: 1.0.4
Date: 2009-07-29
Author: Kaspar Rufibach
Maintainer: Kaspar Rufibach <kaspar.rufibach@ifspm.uzh.ch>
Depends: xtable
Description: このパッケージにある関数は,Sweavew を介してデータ分析のレポートを書くときに特に有用である;The functions in this package are especially helpful when writing reports of data analysis using Sweave.
License: GPL (>= 2)
URL: http://www.biostat.uzh.ch/aboutus/people/rufibach.html
Packaged: 2009-07-30 04:59:49 UTC; rufibach
Repository: CRAN
Date/Publication: 2009-08-04 13:23:02
Built: R 2.10.0; ; 2009-10-16 18:51:53 UTC; unix
索引:
reporttools-package 記述統計の表示と,データ操作のための関数;Functions to display descriptive statistics, and for data manipulation
NAtoCategory factor の NA を新設カテゴリーに変更;Change NAs in a factor into a category
> NAtoCategory(c("A", NA, "B"))
[1] A missing B
Levels: A B missing
> NAtoCategory(c("A", NA, "B"), label="U.K.")
[1] A U.K. B
Levels: A B U.K.
checkDateSuccession 2 つのベクトル中の日付が連続しているかどうかを要素ごとにチェック;Check whether dates in two vectors are elementwise consecutive
diagnosis <- as.Date(round(runif(10, min = 35000, max = 40000)), origin = "1899-12-30")
death <- as.Date(round(runif(10, min = 35000, max = 40000)), origin = "1899-12-30")
checkDateSuccession(diagnosis, death, 1:10, names = c("Pat", "diagnosis", "death"), lab = "tab: diag --> death")
disp 特に P 値のような数値ベクトルを表示する;Display vectors of numbers, especially targeted to vectors of p-values
> disp(3.141592, 3)
[1] "3.142"
> disp(c(3.141592, 0.000000012345), 3)
[1] "3.142" "0.00000001"
> disp(c(3.141592, 0.000000012345), 3, 3)
[1] "3.142" "0.0000000123"
> disp(c(3.141592, 0.000000012345), 3, 2)
[1] "3.142" "0.000000012"
displayCI 2 つの要素を持つベクトル,または 2 列の行列として用意されている信頼区間を表す文字列を生成する;Generate strings of a confidence interval from a matrix
> displayCI(c(1.234, 6.789), 3)
[1] "[1.234, 6.789]"
> displayCI(matrix(1:6, 3), 5, "cm")
[1] "[1.00000cm, 4.00000cm]" "[2.00000cm, 5.00000cm]" "[3.00000cm, 6.00000cm]"
displayKbyC 2 つのカテゴリー変数をクロス集計し K 行 C 列の分割表を,変数名,カテゴリー名(行名,列名)および合計欄をつけた表を作成するための LaTeX ソースを生成する;Function to display a K x C frequency table including col- and row-names and totals
x1 <- sample(3, 50, replace=TRUE)
x2 <- sample(4, 50, replace=TRUE)
displayKbyC(x1, x2, names=c("Mathematics", "Chemical"), cap="displayKbyC", lab="Label", row.nam=paste("Math", 1:3), col.nam=paste("Chem", 1:4))
eliminateNA データフレーム中で 1 個でも NA を持つ観察例を除く;Eliminate all observations with at least one NA in a data frame
> eliminateNA(data.frame(a=c(1,2,NA,4,5), b=c("A", NA, "C", "D", NA)))
$complete
a b
1 1 A
4 4 D
$incomplete
a b
2 2 <NA>
3 NA C
5 5 <NA>
tableContinuous 連続変数に対する記述統計の結果を示すための LaTeX ソースを生成する;Generate a LaTeX table of descriptive statistics for continuous variables
tableContinuous(data.frame(a=1:10, b=rnorm(10)), cap="tableContinuous")
tableDate 日付変数に対する記述統計の結果を示すための LaTeX ソースを生成する;Display descriptive statistics for date variables
tableDate(data.frame(d=as.Date(runif(20), origin="1900-1-1")), cap="tableDate")
tableNominal 名義尺度変数に対する記述統計の結果を示すための LaTeX ソースを生成する;Display descriptive statistics for nominal variables
tableNominal(data.frame(n=sample(letters[1:5], 100, replace=TRUE),
m=sample(c("M", "F"), 100, replace=TRUE)), cap="tableNominal")
transformVarNames データフレームの個々の変数をその要素名のオブジェクトに付値するための R コードを生成する;Generate R-code assigning each variable in a data frame to its name
> transformVarNames(iris, "iris")
Sepal.Length <- iris$Sepal.Length
Sepal.Width <- iris$Sepal.Width
Petal.Length <- iris$Petal.Length
Petal.Width <- iris$Petal.Width
Species <- iris$Species
varNamesToChar 文字列を変数を分解して変数名を得る;Split a character string into variable names
> varNamesToChar("a, bcd, JAPAN")
[1] "a\", \"bcd\", \"JAPAN\", \""
これ以上の情報はディレクトリ '/Library/Frameworks/R.framework/Resources/library/reporttools/doc'
にある以下のビニエット中にあります:
reporttools: A guide to the reporttools package (source, pdf)
LaTeX によるタイプセット例†



