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

How do you get significant differences to show with custom table, when using text in Expss?

How do you get significant differences to show with custom table, when using text instead of labelled numerics as input? (should be + or – in each cell). #Generate data aw = function(n) { sample(x = c("Aware","Consider","Buy"), n, replace = T,…
CK7
  • 229
  • 1
  • 11
1
vote
1 answer

How to adjust table size in markdown knitr

I'm trying to use a package expss, and I followed some of the examples, but my table is huge. How can I adjust the table so that it is small, like in the link? For the tables in the link please see: expss introduction My tables have wide margins: I…
halo09876
  • 2,725
  • 12
  • 51
  • 71
1
vote
1 answer

How to create a nested table in R

I'm struggling to figure out how to create the following table; Image of table using the following dataset ```{r} df<-data.frame(ID=c(1,2,3,4,5,6), Treat_Cont = c("Treatment", "Treatment", "Treatment", "Control", "Control", "Control"), …
physicalcog
  • 399
  • 1
  • 2
  • 9
1
vote
1 answer

Could the 'expss' R package be an equivalent of the SAS PROC TABULATE?

With the expss package for R, the following simple code gives the count of cars for each of the crossed values of 'cyl', 'gear', 'am' and 'vs'. Using a similar layout, would it be possible to replace this count by some statistic computed on a fifth…
Nicolas2
  • 2,170
  • 1
  • 6
  • 15
1
vote
0 answers

How to format expss tables? tab_cells label position and tab_cols alignment?

Is it possible to have the tab_cells label/title wrap so that it does not cut across the columns? Is it possible to adjust alignment of columns?
timj
  • 11
  • 1
0
votes
1 answer

Extract labels dynamically from database

i want to extract labels from the labelelled column from the database. so here i want to extract labels for lists dfl1, dfl2, dfl3 dynamically. output can be a list of labels ("all","version","amp") for dfl1 and ("all","version","amp", "gear type")…
samrr_tr
  • 81
  • 8
0
votes
1 answer

rearrange cpct out in r expss table from row to columns

I'm using the R expss package to calculate the below. Any help is much appreciated. df <- data.frame(repid=c(1:5), q1=c(1,3,2,1,3), q2=c(2,3,1,1,2), q3=c(2,2,3,1,2)) df %>% tab_cells(q1, q2, q3) %>% …
Mike
  • 23
  • 4
0
votes
2 answers

getting the occurrence of frequency in header in table

i want to have the total cases in header itself with in the table. so the total number of responses can be included in table. i want to have spss table type so i a using expsss here df <- data.frame("TB1"=c("OPS", "OPS", "HR", "ADMIN", "HR", …
coder2learn
  • 165
  • 6
0
votes
1 answer

How to specify the row lables in r expss and not to use get(varname) as a label?

when I was trying to use following code to pivot a group of variables which are named with a pattern: Loop through variables tables <- list() pattern <- "aa_bb_cc" for (i in c(1:6)) { varname <-paste0(pattern,i) caption <-…
S.Z
  • 1
0
votes
0 answers

How to import separate .dat +syntax using Expss in R

How do you import separate .dat +syntax using Expss in R? I see there is a read_spss function, but that requires a .sav file. If you don't have SPSS, the only option I see is to use the opensource Windows software PSPP to manually import .dat…
CK7
  • 229
  • 1
  • 11
0
votes
1 answer

using cross_rpct for calulating occurence table

I following the following post on github to create a occurence table of undernourishment indicators: https://github.com/DHSProgram/DHS-Indicators-R/commit/1c64b0f2af33ac56d149a7dbce34ea8bb21ce3f9 I struggling with that code (end of the…
Sulz
  • 333
  • 1
  • 8
0
votes
0 answers

Error message when installing package expss

I'm trying to download the package 'expss' in R, but I get an error message that I don't know how to solve. This is what R tells me after trying to install 'expss': installing the source package ‘expss’ trying URL…
NJF
  • 11
  • 2
0
votes
1 answer

How can I use something like `package::%to%` in a function/package

I want to use functions from the expss package in my own functions/packages. I usually call the functions along with their packages (e.g. dplyr::mutate(...)). The expss package has a function/operator %to%, and I don't know how I can do the same…
deschen
  • 10,012
  • 3
  • 27
  • 50
0
votes
1 answer

Adding a variable name for multiple-answer table expss in R / creating a variable to capture multiple answers

I want to add a variable name for the multiple-answer question Q6 which consist with 12 columns (Q6_1 to Q6_12) adding a label as follows do not give me the intended result. it adds a total_row column. I just need a label to indicate this is the…
0
votes
1 answer

Function is not working as required with mrset_p variables

I am trying to create a function to get a output like below but getting different result. I want table only for Col1,col2,col3 with regular expression as input parameter. the output i am getting like below which is little strange and also showing…
samrr_tr
  • 81
  • 8