File: tibbles.Rd

package info (click to toggle)
r-cran-memisc 0.99.31.8.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,136 kB
  • sloc: ansic: 5,117; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 2,311 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
\name{tibbles}
\alias{as_tibble.data.set}
\alias{as.item,labelled-method}
\alias{as.item,haven_labelled-method}
\alias{as.item,haven_labelled_spss-method}
\alias{as_haven}
\alias{as_haven,data.set-method}
\alias{as_haven,item.vector-method}
\alias{as.data.set,tbl_df-method}
\title{Interface to Packages 'tibble' and 'haven'}
\description{
  A \code{as_tibble} method (\code{as_table.data.set}) allows to transform \code{"data.set"} objects
  into objects of class \code{"tbl_df"} as defined by the package
  "tibble".

  \code{as.item} methods for objects of classes \code{"haven_labelled"}
  and \code{"have_labelled_spss"} allow to transform a "tibble" imported
  using \code{read_dta}, \code{read_spss}, etc. from the package "haven"
  into an object of class \code{"data.set"}.

  \code{as_haven} can be used to transform \code{"data.set"} objects
  into objects of class \code{"tbl_df"} with that additional information
  that objects imported using the "haven" package usually have, i.e.
  variable labels and value labels (as the \code{"label"} and
  \code{"labels"} attributes of the columns).
}
\usage{
as_tibble.data.set(x,\dots)
\S4method{as.item}{haven_labelled}(x,\dots)
\S4method{as.item}{haven_labelled_spss}(x,\dots)
as_haven(x,\dots)
\S4method{as_haven}{data.set}(x,user_na=FALSE,\dots)
\S4method{as_haven}{item.vector}(x,user_na=FALSE,\dots)
\S4method{as.data.set}{tbl_df}(x,row.names=NULL,\dots)
}
\arguments{
  \item{x}{for \code{as_tibble.data.set} and \code{as_haven}, an object
    of class \code{"data.set"}; for \code{as.item}, an object of class
    \code{"haven_labelled"} or \code{"haven_labelled_spss"};
    an object of class \code{"tbl_df"} for \code{as.data.set}.
  }
  \item{user_na}{logical; if \code{TRUE} then the resulting vectors
    have an \code{"na_values"} and/or \code{"na_range"} attribute.}
  \item{row.names}{\code{NULL} or an optional character vector of row names.}
  \item{\dots}{further arguments, passed through to other the the
    \code{as_tibble} method for lists, or ignored.}
}
\value{
  \code{as_tibble.data.set} and the \code{"data.set"}-method of
  \code{as_haven} return a "tibble". The \code{"item.vector"}-method
  (which is for internal use only) returns a vector with S3 class either
  \code{"haven_labelled"} or \code{"haven_labelled_spss"}. 
}