File: parse_formula.Rd

package info (click to toggle)
r-cran-reshape2 1.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 292 kB
  • sloc: cpp: 246; sh: 9; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 935 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/formula.r
\name{parse_formula}
\alias{parse_formula}
\title{Parse casting formulae.}
\usage{
parse_formula(formula = "...  ~ variable", varnames, value.var = "value")
}
\arguments{
\item{formula}{formula to parse}

\item{varnames}{names of all variables in data}

\item{value.var}{name of variable containing values}
}
\description{
There are a two ways to specify a casting formula: either as a string, or
a list of quoted variables. This function converts the former to the
latter.
}
\details{
Casting formulas separate dimensions with \code{~} and variables within
a dimension with \code{+} or \code{*}. \code{.} can be used as a
placeholder, and \code{...} represents all other variables not otherwise
used.
}
\examples{
reshape2:::parse_formula("a + ...", letters[1:6])
reshape2:::parse_formula("a ~ b + d")
reshape2:::parse_formula("a + b ~ c ~ .")
}