I am running into what appears to be a minor conflict between {data.table} and {tinytable}. I simply wanted a single column data.table with no column name. The base command colnames(DT1) <- NULL
gives me the data.table that I want but tt(DT1)
throws an error.
Can anyone duplicate this or is it some peculiarity specific to my system?
Thanks.
# Load packages -----------------------------------------------------------
library(data.table)
library(tinytable)
# Load data ---------------------------------------------------------------
dat1 <-structure(list(EU = c("Austria", "Belgium", "Bulgaria", "Croatia",
"Cyprus", "Czech Republic", "Denmark", "Estonia", "Finland",
"France", "Germany", "Greece", "Hungary", "Ireland",
"Italy",
"Latvia", "Lithuania", "Luxembourg", "Malta", "Netherlands",
"Poland", "Portugal", "Romania", "Slovakia", "Slovenia", "Spain",
"Sweden")), class = "data.frame", row.names = c(NA, -27L))
DT1 <- as.data.table(dat1)
# Create {titytable} table from data.frame sans column name -----------------------------
colnames(dat1) <- NULL
tt(dat1)
# Create {tinytable} table from data.table sans column name -----------------
colnames(DT1) <- NULL
tt(DT1)
> sessionInfo()
R version 4.5.0 (2025-04-11)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 24.04.2 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.12.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/Toronto
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tinytable_0.8.0 data.table_1.17.0
loaded via a namespace (and not attached):
[1] compiler_4.5.0 litedown_0.7 tools_4.5.0 rstudioapi_0.17.1 fansi_1.0.6
[6] knitr_1.50 xfun_0.52 evaluate_1.0.3