View source: R/edsurveyTable2pdf.R
edsurveyTable2pdf | R Documentation |
Produces the LaTeX code and compiles to a PDF file from the edsurveyTable
results.
edsurveyTable2pdf(
data,
formula,
caption = NULL,
filename = "",
toCSV = "",
returnMeans = TRUE,
estDigits = 2,
seDigits = 3
)
data |
the result of a call to |
formula |
a formula of the form |
caption |
character vector of length one or two containing the table's caption or title.
If the length is two, the second item is the “short caption” used when LaTeX generates
a |
filename |
a character string containing filenames and paths. By default ( |
toCSV |
a character string containing filenames and paths of .csv table output.
|
returnMeans |
a logical value set to |
estDigits |
an integer indicating the number of decimal places to be used for estimates. Negative values are allowed. See Details. |
seDigits |
an integer indicating the number of decimal places to be used for standard errors. Negative values are allowed. |
Rounding to a negative number of digits means rounding to a power of 10,
so, for example, estDigits = -2
rounds estimates to the nearest hundred.
For more details, see the vignette titled
Producing LaTeX
Tables From edsurveyTable
Results With edsurveyTable2pdf
.
Huade Huo
## Not run:
# read in the example data (generated, not real student data)
sdf <- readNAEP(path=system.file("extdata/data", "M36NT2PM.dat", package="NAEPprimer"))
# create a table with composite scores by dsex and b017451
est1 <- edsurveyTable(formula=composite ~ dsex + b017451, data=sdf)
# create a table with csv output
edsurveyTable2pdf(data=est1,
formula=b017451~dsex,
toCSV="C:/example table.csv",
filename="C:/example table.pdf",
returnMeans=FALSE)
# create a pdf file using the default subject scale or subscale
# and keep two digits for estimates and three digits for SE after decimal point
edsurveyTable2pdf(data=est1, formula=b017451~dsex,
returnMeans=TRUE, estDigits=2, seDigits=3)
# create a pdf file using the percentage of students at the
# aggregation level specified by \code{pctAggregationLevel}
# output will be saved as "C:/example table.pdf"
edsurveyTable2pdf(data=est1,
formula=b017451~dsex,
filename="C:/example table.pdf",
returnMeans=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.