Questions tagged [crosstable]

For questions related to crosstable::crosstable() and gmodels::CrossTable(). Be sure to also include the [r] tag on your question.

A crosstable is a table that contains descriptive statistics and common statistical tests. Several R packages propose their interface, mostly crosstable and gmodels.

Read the documentation:

25 questions
3
votes
3 answers

How to count Occurrences in a cross table in R?

How can I create a cross table in R (RStudio), where I count occurrences. I have this sample input: Technology <- c("A", "A", "B", "C", "C", "C") Development <- c(1, 0, 1, 1, 1, 1) Production <- c(1, 1, 0, 0, 0, 1) Sales <- c(0, 0, 1, 1, 0, 1) DF <-…
Mec-Eng
  • 199
  • 10
3
votes
1 answer

Is there a way to paste 2 "ftable" object?

I`m using svyby from survey to make some weighted ratios with their standard deviation and coefficient of variation, I use the code below to generate a three way table which provide me the ratio of subocup compared to ocup for male teleworker…
esteban
  • 102
  • 8
2
votes
2 answers

How to create a cross tabulation table between two variables with the counts in R?

I have a data frame with two columns that I want to cross tabulate. The data also includes the counts for the combination. I am trying to create the cross table and include those counts within the table. I am struggling to use the counts from the…
sutsabs
  • 431
  • 2
  • 11
1
vote
1 answer

R - Crosstable highlights with Flextable library

I need to highlight (with bold face or some color) the max counts, rowwise, in a crosstable, according to the example below. But i can't seem to find anywhere how to do it in crosstables. Does anyone have an hint? Thanks in…
Filipa
  • 50
  • 6
1
vote
3 answers

Creating Crosstable with Multiple Variables Summarized by Row Categories

I am interested in summarizing several outcomes by sample categories and presenting it all in one table. Something with output that resembles: vs am cyl 0 1 0 1 4 1 10 3 8 6 3 4 4 3 8 14 0 12 2 were I able to combine ("cbind")…
wes
  • 113
  • 6
1
vote
2 answers

Cross-referencing tables {SEQ Table \\* arabic} and figures {SEQ Figure \\* arabic} with officedown [i.e. block_caption() and run_autonum()]

I want to create a .docx report with {officedown}, but instead of using "bookmark" reference types for cross-referencing my tables and figures as suggested in ch.4.6 and ch.4.7 of the User Documentation, I would like my references to be actual…
Paul Schmidt
  • 1,072
  • 10
  • 23
0
votes
1 answer

spotfire crosstable color by another column

I have one question about spotfire cross table using another column I want to aggregate using column 'VALUE' but color by columns 'FLAG'. I heard that this function was embedded in spotfire after version…
tacona1016
  • 13
  • 2
0
votes
1 answer

How to create separate cross table from list

I want to separate the cross table from single to multiple accprding to the given column list against the last column(CLASS). THE DATA IN THE TABLE LOOKS LIKE GND | BRD | ERS | CLASS F | A | AB | ON M | D | CB | ON M | S | AV | …
zuma boy
  • 15
  • 2
0
votes
2 answers

crosstable sex with flextable and tabulator

I can't figure out how to solve this easily. I would like to create a crosstable of my value crossed by sex (and age later adding the right column) My table below : x> country sex answer value SCO ALL A 50 SCO M A 52 SCO F A 48 SCO ALL B 71 SCO M…
0
votes
0 answers

How to do this kind of tables in R

I need to do a table, like the one below, in R, it has continuous variables in the rows that needs to be separated into two categories (in the image is men and women) and calculate the mean and sd (that has to be between brackets) for each of the…
Elena H
  • 1
  • 1
0
votes
1 answer

Partially marking dependent crosstable spotfire

I have the pie chart & need to create crosstable based on marking but it should connect marking with only one column & other columns in crosstable should show all the data from main table regardless of marking. Attached image is better explanation…
0
votes
0 answers

crosstable expecting object of class 'gtsummary'

Crosstable is reporting "Error: Error in argument 'x='. Expecting object of class 'gtsummary'" It was working earlier, but did an update of packages and it look like the depreciation of as_flextable() in gtsummary 1.3.3 may have broken something. …
0
votes
1 answer

Sportfire cross table coloring scheme

I have a cross table with programs on y axis, activities on x axis and I am displaying dates in the cross table. I want to color the cells (dates) based on values from a different column in the data table (Status) that is not displayed in the cross…
0
votes
1 answer

Error in seq_len(p) : argument must be coercible to non-negative integer

I have a tabulated data with counts in each row. I want to categorize and see the sums of each category in a table. I have used the script below: as.matrix.data.frame(xtabs(Count ~ Factor, data=aggregate(Count ~ Factor,…
0
votes
1 answer

Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, : invalid value 0 for 'digits' argument

I'm new beginner to R, trying to cross-tabulate the variables, use the ctable() function from package "summarytools". But I'm encountering some errors that look like the following. I'm learning to use R by following the worksheet for categorical…
1
2