strengejacke / sjlabelled

Working with Labelled Data in R

Home Page:https://strengejacke.github.io/sjlabelled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`as_label` does not work for a variable with on NAs

lyh970817 opened this issue · comments

For instance

a <- c(NA)
set_labels(a, labels = c(a = 1))

results in

Warning messages:
1: In min(x, na.rm = TRUE) :
  no non-missing arguments to min; returning I
nf
2: In max(x, na.rm = TRUE) :
  no non-missing arguments to max; returning -
Inf
3: In set_labels_helper(x = .dat, labels = lab
els, force.labels = force.labels,  :
  Can't set value labels for "x". Infinite val
ue range.