Description Usage Arguments Details Value Author(s) See Also Examples

Use this function to generate simple code asserstions about a
`data.frame`

.

1 | ```
generate.assertions(dat, max.level.show = 12, digits.compare = 6)
``` |

`dat` |
A |

`max.level.show` |
Maximum number of factor levels for which to generate an assertion. |

`digits.compare` |
How many decimal digits to include in comparisons of numeric data? |

Assertions are generated about the number of rows and columns in the
`data.frame`

, and about each column it contains.
An assertion is generated about the class of the column, and the number
of missing values (`NA`

). If the column has a `label`

attribute, then as assertion is generated for that as well.
Further assertions depend on the `class`

of the column.
For `factor`

s, the number of levels is asserted. If this does
not exceed `max.level.show`

then the `levels`

are
asserted as well. For numeric data, the range (rounded to
`digits.compare`

is asserted.

None (`invisible`

'`NULL`

').

Ben Rich <[email protected]>

1 2 3 4 5 6 7 8 | ```
## Not run:
require(nlme)
data(Phenobarb)
sink("Phenobarb_checks.R")
generate.assertions(Phenobarb)
sink()
## End(Not run)
``` |

benjaminrich/PCSmisc documentation built on Dec. 17, 2017, 12:50 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.