Questions tagged [expss]

expss package provides tabulation functions with support for 'SPSS'-style labels, multiple / nested banners, weights, multiple-response variables and significance testing.

expss package provides tabulation functions with support for 'SPSS'-style labels, multiple / nested banners, weights, multiple-response variables and significance testing.

147 questions
1
vote
1 answer

Use a list at the argument for expss method apply_label

I want to use a list as the argument for apply_labels in the package expss This works from the vignette: library(expss) #> Warning: package 'expss' was built under R version 4.1.1 data(mtcars) mtcars = apply_labels(mtcars, mpg…
Harlan Nelson
  • 1,394
  • 1
  • 10
  • 22
1
vote
1 answer

How to adjust encoding to read accent marks properly in R

I am using read_labelled_csv from expss package to read a labelled csv in R. data1<-expss::read_labelled_csv("C:/Users/User/Desktop/Data/Example.csv") I have a problem reading the labels that has accents. The label looks like this: caf˳ and it has…
1
vote
0 answers

How to add the same labels to different categories in R

I am using expss::val_lab to add labels to a categorical variable. This is an example of the data I am working with: a<-runif(20,3,9) a [1] 7 4 8 5 6 7 9 9 7 8 4 7 3 8 8 4 7 4 4 5 I have problem when I try to add labels with repeated…
1
vote
1 answer

I want to format my expss-table and include specific rows based on values

I've been looking into doin tables with the expss package. I have two questions. The first is that I'm wondering if it's possible to format the table so that the mean for each variable comes after the "total_statistics". The second question is if…
Loevet91
  • 11
  • 2
1
vote
1 answer

Pivoting the table with multiple variables in a row

I am using the expss package in R to create tables. My apologies as I am having difficulty understanding the documentation. Here is my sample data: dput(df) structure(list(cohort_tracing_complete = structure(c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,…
dixi
  • 680
  • 1
  • 13
  • 27
1
vote
1 answer

make a table in expss that shows both freq and cpct but only tests cpct on the cpct columns

Using this data set with a multiple dichotomy set and a group: set.seed(14) checkall <- data.frame(ID=1:200, group=sample(c("A", "B", "C"), size=200, replace=TRUE), q1a=sample(c(0,1), size=200,…
emudrak
  • 789
  • 8
  • 25
1
vote
1 answer

R: logic in using %to%

I notice that the logic of using x1 %to% x8 in R seems not consistent. Sometimes all variables physically located between the variables in the dataset are used (cfr. SPSS), d%>%tab_cols(total()) %>% tab_cells (mdset(Q20_01_more %to% Q20_03_more))…
1
vote
1 answer

R: expss package - "recode into" not working without do_if?

I am trying to use the recode into function using expss. When I replicate the example illustrated in https://gdemin.github.io/expss/#example_of_data_processing_with_multiple-response_variables I notice the following behaviour: code including a do_if…
1
vote
2 answers

How do you remove the row_labels text in an expss table?

I like to pipe my expss tables into kable to get access to some additional formatting options. That sometimes requires some tweaking, and I'm looking for a tweak here to get rid of the row_labels text in the first column of the header in the…
Martina Morris
  • 155
  • 1
  • 1
  • 6
1
vote
1 answer

Trying to implement use_labels from expss package on a ggplot

I have a data frame that I've used the expss library to apply labels to the variables. Example Data: library(expss) data = apply_labels(data, state= "State", Q1_Gender_1 = "Male", Q1_Gender_2 = "Female") the structure of the data ends up looking…
Clark
  • 35
  • 4
1
vote
1 answer

How to do a multiple choice crosstable in R

My code... library(expss) library(haven) X4707 <- read_sav("/home/cfmc/4707/data/4707.sav") X4707 %>% tab_cells("By phone"=qpd4_1==1,"By email"=qpd4_2==1,"Utility website"=qpd4_3==1,"Roseville Electric notification"=qpd4_4==1,"Social…
larryb
  • 25
  • 3
1
vote
1 answer

Weighting tables in expss

I have a column of numbers [range from 0.2 to 2.3] in a column called cwei in SPSS. I want to use these weights as case weights in expss tab_ logic. My efforts so far work and produce a table but it is unweighted. Where is my error? …
MarkWebb
  • 59
  • 4
1
vote
1 answer

How to save the output of the expss package?

I use the expss package to produce summary tables of the mtcar data. library(expss) data(mtcars) mtcars %>% tab_cells(cyl) %>% tab_cols(total(), vs) %>% tab_rows(am) %>% tab_stat_cpct(total_row_position = "above", …
richi
  • 37
  • 5
1
vote
0 answers

expss tab_sort_* Not behaving as expected when tab_row_labels() present

expss script below. Run without tab_sort_asc() and then with it.[last few rows]. The tab_row_labels get sorted. How can this be prevented? mtcars %>% ##################################### tab_row_label("Additional labels1 - means of numeric…
MarkWebb
  • 59
  • 4
1
vote
1 answer

R: expss package: Error in do.call(data.frame, c(x, alis)) : variable names are limited to 10000 bytes

I defined some table functions in R using the expss package to automate tabulation. One of my tables wants to show cases or percentages on categories followed by the mean. The mean can be based on the same category variable or it can be defined to…