Questions tagged [tbl]

tbl is part of the troff/groff document formatting system. As described by the man page, tbl compiles descriptions of tables embedded within troff input files into commands that are understood by troff. Use this tag for questions related to tbl's grammar or issues using tbl.

From Tbl — A Program to Format Tables†:

Tbl is a document formatting preprocessor for troff or nroff which makes even fairly complex tables easy to specify and enter.

  1. Introduction.

Tbl turns a simple description of a table into a troff or nroff [3] program (list of commands) that prints the table. It attempts to isolate a portion of a job that it can successfully handle and leave the remainder for other programs. Thus tbl may be used with the equation formatting program eqn [2] or various layout macro packages [1], [5], [6], but does not duplicate their functions.

tbl is a part of a set of tools that were developed by AT&T for typesetters. These include:

  • groff/troff/nroff: a Unix text-formatting program
  • pic: compile pictures for troff or TeX
  • eqn: format equations for troff
  • chem: chemical structure diagrams

References:

31 questions
5
votes
2 answers

Grouping Rows in GTSummary

I am trying to group some rows/variables (both categorical and continuous) to help with the table readability in a large dataset. Here is the dummy dataset: library(gtsummary) library(tidyverse) library(gt) set.seed(11012021) # Create Dataset PIR…
Benjamin Moran
  • 109
  • 1
  • 8
4
votes
1 answer

R gtsummary package: How to Manipulate / Hide Rows in Summary Table

I am working on a project with gtsummary. For one of the tables, I have to build a long table listing covariables before and after the matchit process. My issue is that for all of the covariables (Obesity, for example), it reads one row, Obesity,…
neuroR
  • 53
  • 1
  • 5
3
votes
1 answer

How to rename table rows tbl_summary?

Using the example on gtsummarytbl_summary page (http://www.danieldsjoberg.com/gtsummary/articles/tbl_summary.html): trial %>% select(trt, marker, stage) tbl_summary(trial2) Is it possible to change the names of the rows under trt? For example…
pkreville
  • 33
  • 4
3
votes
1 answer

Subsetting rows and columns for both data.frame and tbl_df

Data.frame allows operations on column subsets using [ , dropping single column/row outputs to vectors by default. Dplyr does not allow this, deliberately (and seemingly because coding was an absolute nightmare). df <- data.frame(a = c(1:5,NA), b =…
dez93_2000
  • 1,730
  • 2
  • 23
  • 34
3
votes
1 answer

R - tbl/collect is slow sometimes

I use dplyr for getting data from sql database and it usually works pretty well. But sometimes my code runs very slow and I'm not sure why. Most of the time I connect to tables with 1 milion rows, I filter some data and then I use collect function…
user4394417
2
votes
1 answer

R gtsummary Row with Categorical Variable Totals

I have a dataset of approximately 700,000 patients where I have hospital site IDs (factor variable). I would like to create a row where the number of hospitals is visible (this is separate to the number of patients). I have 3 categorical variables…
Benjamin Moran
  • 109
  • 1
  • 8
1
vote
1 answer

How can I indent specified rows when using tbl_summary from the gtsummary package?

I have a composite variable ("Needs Medical Attention") that is made up of several sub-variables ("Heart Disease", "Cancer"); that is, if a subject has "Heart Disease" or "Cancer", they are flagged for "Needs Medical Attention". In my presentation…
M. Bolt
  • 35
  • 4
1
vote
0 answers

Create table with tbl_summary in R by more than one variable

Name <- c("Nick", "Bill", "Maria", "Ben", "Tina") Type <- c("general", "specialized", "er", "specialized", "general") MondayDay <- c("yes", "yes", "yes", "yes", "yes") MondayNigth <- c("no", "no", "yes", "no", "no") ThuesdayDay <- c("no", "yes",…
1
vote
1 answer

Add row totals to tbl_summary

I am attempting to add row totals to my tbl_summary(). Here is my code so far ibrary(tidyverse) library(gtsummary) set.seed(42) n <- 1000 dat <- data.frame(q=runif(n, min=45, max=85), r=runif(n, min=2.4, max=6.0), …
Sandro
  • 101
  • 7
1
vote
1 answer

How to get dbplyr in_schema to reference different warehouse

I'm using dbplyr to access a complex warehouse in snowflake, which contains multiple databases. I have write access to one of them, and read access to the rest. Sample structure WH_a - schema_a - table_aa - schema_b - table_ba WH_b -…
aris
  • 11
  • 1
1
vote
0 answers

R gtsummary Overall Column Moved After Merge

In the past, when I've created a summary table with an overall column and merged it, the column remains on the left. However, recently, after merging and modifying the spanning header, the overall column is not on the left. Here is an…
Benjamin Moran
  • 109
  • 1
  • 8
1
vote
1 answer

Converting from .tbl to .csv format using python

Trying to do some data analysis on some data but all downloaded data is in .tbl format and I would rather have it in .csv format. Is there a way to convert to .tbl to .csv through a python script. Right now, I am uploading the files directly into…
1
vote
1 answer

tbl with groff/ntoff: borders messed-up when reaching end-of-page

As output for a script, I produce inut for tbl. However, when a table seems to reach an end of page, the borders of a table go all over the place. As an example: │ │ │ │ │ …
Ljm Dullaart
  • 4,273
  • 2
  • 14
  • 31
1
vote
0 answers

JTable won't display data

So I was recently trying to insert data into a Jtable from a database. The program runs a "Quote" Jframe which contains the JTable called "tblQuote". one the Quote screen there is a button called "Add product" which opens a Frame that allows the…
Jarryd vn
  • 31
  • 6
0
votes
0 answers

Error for adding global p to tbl_regression - caused by qr.solve singular matrix 'a' in solve

I am trying to do a tbl regression but i cannot add the global p and there is an error. It seems to be caused by one parameter "groupe N" because without it there is no error. I coded this parameter whit case_when. Creation of "groupe N" : d <- d…
Ldkr
  • 1
1
2 3