Description Usage Arguments Examples
The coverage package and associated function provides you with a visual, data frame or latex table summary of your time and unit coverage.
1 2 3 | coverage(fit, timevar = "year", unitvar = "country", data,
variable.names, special.NA, output = c("visual", "data.frame",
"latex.table")[1], data.frequency = 1, ...)
|
fit |
A fitted object. |
timevar |
Time variable. Defaults to "year". |
unitvar |
Unit variable. Defaults to "country". |
data |
Data to be investigated. If none is supplied, attempts to use same data as " |
variable.names |
Variables to be checked for coverage. If none is supplied, defaults to variables used in |
special.NA |
Variable that if missing will indicate "special" missingness. Can be used to distinguish observations with missing data from time-unit combinations which did not exist or were not considered. (Optional) |
output |
Desired extra output: "visual" (default), "data.frame", or "latex.table". First depends on |
data.frequency |
Integer specifying the increments between observations. Defaults to 1. |
... |
Additional arguments passed to ggplot2's |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | library(WDI)
wdi.sample <- WDI(indicator=c("GDPPC" = "NY.GDP.PCAP.KD",
"services_gdp" = "BG.GSR.NFSV.GD.ZS",
"agriculture_gdp" = "NV.AGR.TOTL.ZS",
"telephones" = "IT.TEL.TOTL.P3"),
start=1970, end=2012,
country="all")
lm.fit <- lm(GDPPC ~ ., data = wdi.sample)
coverage(lm.fit)
# One may also specify variables explicitly:
coverage(timevar = "year",
unitvar = "country",
variable.names = c("GDPPC",
"services_gdp",
"agriculture_gdp",
"telephones"),
data = wdi.sample)
# Or request data.frame or latex.table output:
# For data.frame, use:
coverage(fit = lm.fit, output = "data.frame")
# For latex table, use:
coverage(fit = lm.fit, output = "latex.table")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.