File: replace_na.tbl_lazy.Rd

package info (click to toggle)
r-cran-dbplyr 2.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,376 kB
  • sloc: sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,097 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/verb-expand.R
\name{replace_na.tbl_lazy}
\alias{replace_na.tbl_lazy}
\title{Replace NAs with specified values}
\usage{
\method{replace_na}{tbl_lazy}(data, replace = list(), ...)
}
\arguments{
\item{data}{A pair of lazy data frame backed by database queries.}

\item{replace}{A named list of values, with one value for each column that
has NA values to be replaced.}

\item{...}{Unused; included for compatibility with generic.}
}
\value{
Another \code{tbl_lazy}. Use \code{\link[=show_query]{show_query()}} to see the generated
query, and use \code{\link[=collect.tbl_sql]{collect()}} to execute the query
and return data to R.
}
\description{
This is a method for the \code{\link[tidyr:replace_na]{tidyr::replace_na()}} generic.
}
\examples{
\dontshow{if (rlang::is_installed("tidyr", version = "1.0.0")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
df <- memdb_frame(x = c(1, 2, NA), y = c("a", NA, "b"))
df \%>\% tidyr::replace_na(list(x = 0, y = "unknown"))
\dontshow{\}) # examplesIf}
}