Skip to contents

Introduction

memisc-package memisc
Introduction to the 'memisc' Package

Survey items and survey data sets

annotation() `annotation<-`() description() `description<-`() wording() `wording<-`()
Adding Annotations to Objects
codebook()
Generate a Codebook of a Data Set
codeplan() setCodeplan() `codeplan<-`() read_codeplan() write_codeplan()
Describe structure of Data Sets and Importers
data.set() as.data.set() is.data.set() as.data.frame(<data.set>) within(<data.set>) dsView() head(<data.set>) tail(<data.set>)
Data Set Objects
subset(<data.set>) unique(<data.set>) cbind(<data.set>) rbind(<data.set>) merge(<data.set>,<data.set>) merge(<data.set>,<data.frame>) merge(<data.frame>,<data.set>)
Manipulation of Data Sets
deduplicate_labels()
Handle duplicated labels
duplicated_labels()
Check for and report duplicated labels
spss.file() spss.fixed.file() spss.portable.file() spss.system.file() Stata.file() subset(<spss.system.importer>) subset(<spss.portable.importer>) subset(<spss.fixed.importer>) subset(<Stata.importer>) subset(<Stata_new.importer>) as.data.set(<importer>) head(<importer>) tail(<importer>)
Object Oriented Interface to Foreign Files
as.item(<numeric>) as.item(<character>) as.item(<logical>) as.item(<factor>) as.item(<ordered>) as.item(<POSIXct>) as.item(<double.item>) as.item(<integer.item>) as.item(<character.item>) as.item(<datetime.item>)
Survey Items
as.vector(<item>) as.numeric(<item>) as.integer(<item>) as.factor(<item.vector>) as.ordered(<item.vector>) as.character(<item.vector>) as.character(<datetime.item.vector>) as.character(<Date.item.vector>) as.data.frame(<character.item>) as.data.frame(<double.item>) as.data.frame(<integer.item>) as.data.frame(<Date.item>) as.data.frame(<datetime.item>)
How Survey Items Are Converted into "Ordinary" Data Vectors
labels() `labels<-`()
Value Labels
measurement(<item>) `measurement<-`(<item>) measurement(<data.set>) `measurement<-`(<data.set>) is.nominal() is.ordinal() is.interval() is.ratio() as.nominal() as.ordinal() as.interval() as.ratio() set_measurement()
Levels of Measurement of Survey Items
measurement_autolevel()
Automatically Adapt Measurement Levels
neg2mis()
Mark Negative Values as Missing
relabel(<default>) relabel(<factor>) relabel4(<item>)
Change labels of factors or labelled objects
as_tibble.data.set() as.item(<haven_labelled>) as.item(<haven_labelled_spss>) as_haven() as.data.set(<tbl_df>)
Interface to Packages 'tibble' and 'haven'
trim_labels()
Trim Codes from the Labels of an Item
value.filter() missing.values() `missing.values<-`() valid.values() `valid.values<-`() valid.range() `valid.range<-`() is.valid() nvalid() is.missing() include.missings()
Value Filters
wild.codes()
Table of frequencies for unlabelled codes

Tables of model estimates

Groupwise computations and tables of summary statistics

By()
Conditional Evaluation of an Expression
Descriptives()
Vectors of Univariate Sample Statistics
Aggregate() genTable()
Generic Tables and Data Frames of Descriptive Statistics
cbind(<ftable>) rbind(<ftable>) cbind(<ftable_matrix>) rbind(<ftable_matrix>) format(<ftable_matrix>) Write(<ftable_matrix>) print(<ftable_matrix>)
Combining flattened tables.
Groups() recombine() as.data.frame(<grouped.data>) as.data.set(<grouped.data.frame>) as.data.set(<grouped.data.set>) with(<grouped.data>) within(<grouped.data>) withGroups() withinGroups()
Operate on grouped data in data frames and data sets
Means() as.data.frame(<means.table>) as.data.frame(<xmeans.table>)
Means for groups of observations
percentages() as.data.frame(<percentage.table>) as.data.frame(<xpercentage.table>)
Easy Creation of Tables of Percentages
percent()
Table of Percentages with Percentage Base
Table(<atomic>) Table(<factor>) Table(<item.vector>)
One-Dimensional Table of Frequences and/or Percentages

Data preparation helpers and convenience functions

cases()
Distinguish between Cases Specified by Logical Conditions
coarsen()
Coarsen a vector into a factor with a lower number of levels
collect()
Collect Objects
contr() contr.treatment() contr.sum() contrasts(<item>) `contrasts<-`(<item>) contrasts(<ANY>) `contrasts<-`(<ANY>)
Convenience Methods for Setting Contrasts
contract()
Contract data into pattern-frequency format
dimrename() rowrename() colrename()
Change dimnames, rownames, or colnames
foreach()
Loop over Variables in a Data Frame or Environment
query()
Query an Object for Information
recode()
Recode Items, Factors and Numeric Vectors
rename()
Change Names of a Named Object
reorder(<array>) reorder(<matrix>)
Reorder an Array or Matrix
Reshape()
Reshape data frames or data sets
retain()
Retain Objects in an Environment
reversed()
Reverse the codes of a survey item or the levels of a factor
sample(<data.frame>) sample(<data.set>) sample(<importer>)
Take a Sample from a Data Frame-like Object
sort(<data.frame>) sort(<data.set>)
Convenience Methods to Sort Data Frames and Data Sets
Mean() Median() Min() Max() Weighted.Mean() Var() StdDev() Cov() Cor() Range()
Convenience wrappers for common statistical functions

Syntactic sugar

`%if%`
Assign a values to a variable for instances where a condition is met
`%#%` `%##%` `%@%` `%@%<-`()
Operators for Setting Annotations and Attributes
`%nin%`
Negative Match
`%$%` `%$$%` Within()
Operators to abbreviate use of "with" and "within"

HTML and LaTeX formatting

show_html() write_html() format_html()
Format Objects in HTML, show the HTML Format or Write it to a File
format_html(<ftable>) format_html(<ftable_matrix>)
Format "Flattened Tables" as HTML
format_html(<codebook>)
Format Codebooks as HTML
format_md(<codebook>) format_md(<codebookEntry>)
Format Codebooks as Markdown
html() html_group() as.html_group() content() `content<-`() setContent() attribs() `attribs<-`() setAttribs() css() as.css() style() `style<-`() setStyle()
Building Blocks for HTML Code
toLatex(<default>) toLatex(<matrix>) toLatex(<data.frame>) toLatex(<ftable>) toLatex(<ftable_matrix>)
Additional Methods for LaTeX Representations for R objects

Other tools and utilities

applyTemplate()
Apply a Formatting Template to a Numeric or Character Vector
as.array(<data.frame>)
Converting Data Frames into Arrays
as.symbols() syms()
Construction of Lists of Symbols
charTrans()
Character Translation of Aspects of Objects
Iconv()
Convert Annotations, and Value Labels between Encodings
List()
Create a list and conveniently supply names to its elements
Sapply() Lapply()
A Dimension Preserving Variant of "sapply" and "lapply"
Substitute()
Substitutions in Language Objects
to.data.frame()
Convert an Array into a Data Frame
named.list item.list named.list-class item.list-class initialize,item.list-method initialize,named.list-method coerce,data.set,named.list-method show,named.list-method atomic-class double-class
Named Lists, Lists of Items, and Atomic Vectors
view() viewPrep()
A Generic Viewing Function
view_html()
HTML Output for 'view.
Write()
Write Codebooks and Variable Descriptions into a Text File
xapply()
Apply a function to ranges of variables

Deprecated

fapply()
Deprecated Functions in Package memisc