Hello,
I am a real R Markdown beginner ( I began 10 days ago) and I am stuck on removing the first two columns of the attached table screenshot.
I use the first two columns of the dtb variable (DES_LIV04 and DES_LIV05) to order/group my report .
The print statement is working fine, but their values are still showing for each detail line.
I did try remove.column , col_names and hundreds of other attempts with no success.
Any help is really appreciated.
knitr::opts_chunk$set(echo = TRUE)
library(knitr)
library(xtable)
library(pander)
library(htmltools)
library(DT)
library(data.table)
library(magrittr)
library(kableExtra)
tabolato <- read.csv("/Users/gm/Developments/myApps/myshiny/tabolato.csv", header = TRUE)
\newpage
liv04 <-unique(tabolato[,12])
elements <- length(liv04)
dtb <- data.table(tabolato)
dtb <- dtb[, .(DES_LIV04,DES_LIV05,DESCRIZIONE,CDARTICOLO,CDARTFORN,RAGSOC,
COSTONETTOAC,COSTONETTONETTOAC,PREZZO,PREZZOIVATOAC,ALIQIVA,UM,
QTAMOVIMENTATAAC,QTAVENDUTAAC,PCTMARGINENETTO,PCTMARGINENETTONETTO)]
z = 0
cat("\n")
for (i in liv04){
cat("\n")
cat("\\newpage")
cat("## ", i, "\n") # Create headings
ans <- dtb[DES_LIV04 == i]
print(
kable(ans, "latex", booktabs = TRUE, longtable = TRUE, caption = i) %>%
kable_paper("striped", full_width = F) %>%
kable_styling(latex_options = c("hold_position", "repeat_header"), font_size = 5) %>%
pack_rows(index = table(ans$DES_LIV05))
)
cat("\n")
z = z + 1
if (z == elements-200){
break
}
}
.