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
5
votes
1 answer

Formatting tables in R Marksdown using expss

I am having some troubles in formatting some tables using expss in an R Markdown. The output is a pdf file. knitr options are: knitr::opts_chunk$set(echo = FALSE, message = FALSE, warning = FALSE) Following the vignette on expss (available here…
Manolo
  • 73
  • 8
4
votes
2 answers

How to open the viewer pane in browser?

Just a simple question that I couldn't find an answer. I just updated my R Studio and R, and one function that I used a lot was opening the results in Viewer pane in my browser. For example, with the resulting tables from packages like sjPlot or…
gustavobrp
  • 53
  • 7
4
votes
1 answer

(RIM) weighting samples in R

I have some survey data. As an example, I use the credit data from the ÌSLR package. library(ISLR) The distribution of Gender in the data looks like this prop.table(table(Credit$Gender)) Male Female 0.4825 0.5175 and the distribution of…
Banjo
  • 1,191
  • 1
  • 11
  • 28
4
votes
1 answer

Reading Spss Data file in R

i am using Expss pakage . df<-read_spss("test.SAV") I shows the following: Warning message: In foreign::read.spss(enc2native(file), use.value.labels = FALSE, : Tally.SAV: Very long string record(s) found (record type 7, subtype 14), each…
Divya
  • 47
  • 7
4
votes
2 answers

Conditional Cross tabulation in R

Looking for the quickest way to achieve below task using "expss" package. With a great package of "expss", we can easily do cross tabulation (which has other advantage and useful functions for cross-tabulations.), we can cross-tabulate multiple…
nikki
  • 239
  • 1
  • 12
4
votes
2 answers

Passing multiple variable information inside R functions using string variable

Here is a reproducible example #install.packages("expss") library("expss") data(mtcars) mtcars = apply_labels(mtcars, mpg = "Miles/(US) gallon", cyl = "Number of cylinders", disp =…
nikki
  • 239
  • 1
  • 12
3
votes
1 answer

How to select row/column variables starting with a particular set of characters (e.g., Q4) in R package expss?

In survey research we often have blocks of variables starting with the same set of characters such as "Q4a", "Q4b", etc. Is it possible to avoid manually entering column names starting with "Q4" as arguments of the tab_cells function of expss…
statadvice
  • 45
  • 5
3
votes
0 answers

How do you pass multiple arguments to a function inside a function?

So I'm trying to make cross tables for multi-response questions with both frequency and counts using expss. I am able to get the result I need by running the following code: library(expss) set.seed(1998) expss_output_viewer() # Example data set x <-…
3
votes
2 answers

How to use R character vector element as string and variable inside function?

I am trying to apply SPSS style category labels to my dataset in R. I think my question arises as I do not know how to parse variables correctly, so is not necessarily related to just these types of data. To begin with, doing this manually as per…
rhacker007
  • 33
  • 3
3
votes
1 answer

How to drop unused value labels in crosstabulations table outputs using cro function from expss package?

I'm using heaven labelled dataframes (variables already have value labels when importing datasets). I need to run many crosstabulations of two variables. I’m using the cro function from expss package because by default displays value labels, and…
3
votes
2 answers

Add row in etable from expss R package

I want to add rows at specific place to expss output etable. I did that with some brute force method which always add the row at the start of etable. Any method to add rows at specific place. library(tidyverse) library(expss) test1 <- mtcars…
MYaseen208
  • 22,666
  • 37
  • 165
  • 309
3
votes
0 answers

Make column titles span over subgroups

Consider the following MWE: library(expss) library(openxlsx) data(mtcars) mtcars = apply_labels(mtcars, mpg = "Miles/(US) gallon", cyl = "Number of cylinders", disp = "Displacement…
Martin Schmelzer
  • 23,283
  • 6
  • 73
  • 98
3
votes
3 answers

How to create two headers table with expss

I have been reading about two headers table here and here with expss package, but the online code didn't work for me. My idea is to create a very similar table to this image: The dataframe is: df <- data.frame(Categoria = c("gender", "gender" ,…
polo
  • 185
  • 1
  • 3
  • 11
3
votes
1 answer

writing a user-defined function using expss::cro()

I'm trying to write a relatively simple user-defined function to output cross-tabulations, but not really sure why it is not running. My testdata: fp_within = structure(list(weight_cat.w1 = structure(c(1L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 3L, 3L, 3L,…
Dani
  • 161
  • 9
3
votes
1 answer

Can the expss package process multiple answer questions with weighted data?

Can the expss package solve the question asked in this link?, it's about multiple response question with a weighting variable in the dataset How to use the R survey package to analyze multiple response questions in a weighted sample? Let's suppose…
Sebastian
  • 95
  • 6
1
2 3
9 10