Skip to content
Prev 382549 / 398500 Next

Value Labels: SPSS Dataset to R

Thanks for all. Here is output from dput.  I used a different dataset
containing categorical variables since the previous one is on a different
computer.

In the following dataset, my interest is in getting frequencies and
barplots for the two variables: Training and Dance, with value labels
displayed.

thanks again - cY


=========
dput(head(CatsDogs, n = 10))
structure(
  list(
    Animal = structure(
      c(0, 0, 0, 0, 0, 0, 0, 0, 0,
        0),
      label = "Animal",
      labels = c(Cat = 0, Dog = 1),
      class = "haven_labelled"
    ),
    Training = structure(
      c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
      label = "Type of Training",
      labels = c(`Food as Reward` = 0,
                 `Affection as Reward` = 1),
      class = "haven_labelled"
    ),
    Dance = structure(
      c(1,
        1, 1, 1, 1, 1, 1, 1, 1, 1),
      label = "Did they dance?",
      labels = c(No = 0,
                 Yes = 1),
      class = "haven_labelled"
    )
  ),
  row.names = c(NA,-10L),
  class = c("tbl_df", "tbl", "data.frame")
)
On Fri, Feb 7, 2020 at 10:14 PM Bert Gunter <bgunter.4567 at gmail.com> wrote: