tableby in papaja with twocolumn classoption - r-markdown

I use the wonderful function tableby to have some summary statistics of my population and I also use the amazing package papaja to write my article.
Here is my code for the use of tableby.
DemoGroup <- tableby (Group ~ Age + education + logMAR + QIT + IRP + ICV + AQ + otherDiag, data=demoShort)
summary(DemoGroup,digits = 1, digits.p =3, booktabs = T, title = "(\\#tab:demo) Demo")
I need my document in a two-column fashion (and use the two-column classoption). However, when I try to knit my document, I have this error related to my table (everything works fine in a single column document):
I was unable to find any missing LaTeX packages from the error log 2022_MMN_FS_TSA_WO.log.
! Package longtable Error: longtable not in 1-column mode.
Error: LaTeX failed to compile 2022_MMN_FS_TSA_WO.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
Is there a way to fix this error?
Thank you for your help,
Chers,
Adeline

Related

Report during local report processing which have not specified, Path format not support

I Have install all package which need for reports viewer but still show have error apply all format path but still face problem.
this.reportViewer1.LocalReport.ReportPath = Application.StartupPath + #"C: \Users\nazir\OneDrive\Documents\Nazam pos\Reportproduct.rdlc";
this.reportViewer1.LocalReport.DataSources.Clear();
DataSet1 ds = new DataSet1();
SqlDataAdapter da = new SqlDataAdapter();
cn.Open();
da.SelectCommand = new SqlCommand("select p.pcode ,p.barcode,p.pdesc,b.brand,c.category,p.purchase,p.price, p.qty, p.reorder from tblProducts as p inner join tblBrand as b on p.bid=b.id inner join tblCategory as c on p.cid=c.id ", cn);
da.Fill(ds.Tables["dtproduct"]);
cn.Close();
enter image description here
Image show error
As #Paulo Santos mentioned, you should check if ReportPath's value is correct, set a breakpoint on the row of the following code and check the value of ReportPath
this.reportViewer1.LocalReport.ReportPath = Application.StartupPath + #"C: \Users\nazir\OneDrive\Documents\Nazam pos\Reportproduct.rdlc";
In addition, please modify the code as below and check if it works. mark sure the rdlc file is exist on the fold.
this.reportViewer1.LocalReport.ReportPath = #"C: \Users\nazir\OneDrive\Documents\Nazam pos\Reportproduct.rdlc";

RMarkdown, knitr::kable shows "\begin{table}" after knitting to pdf document

One of cells in my RMarkdown document
```{r echo=FALSE}
head(data,3) %>% knitr::kable(caption = "Pierwsze 3 wiersze ze zbioru danych Lista_1.csv", digits = 2, booktabs = T)
gives weird result after knitting to pdf:
Of course there shouldn't be "\begin{table}" ,"\caption{}" and "\end{table}" parts. I use knitr::kable often and it never worked this way. Does anyone know how to fix it?
Edit: I have also noticed that all section headers (like "##Section2") below the table are centered. They shouldn't.
I've just found this question: How do I prevent kable from leaving raw latex in the final document if I include a caption in a table?
and used tip from comment (format = pandoc). It worked for me.

gtsummary table footnote missing in knitted pdf

I tried to knit my Rmarkdown report as PDF, and I noticed that the footnote is not there anymore. What did I miss?
stats_summary_table <-
dat %>%
tbl_summary(by = id,
missing = "no",
digits = list(all_continuous() ~ c(0, 0, 1, 1, 3)),
type = list(all_numeric() ~ "continuous"),
statistic = list(all_continuous() ~
"{min} ~ {max} {mean} ± {sd} [{cv}]")) %>%
modify_footnote(starts_with("stat_") ~ "Range and mean±SD [cv]")
PDF output with the gt package is still under development. Can you please confirm the footnotes work properly with PDF output using only the gt package? That will tell us if the issue lies within gt or gtsummary.
In the meantime, may I suggest you utilize one of the other print engines supported by the gtsummary package (gt is the default)
http://www.danieldsjoberg.com/gtsummary/articles/rmarkdown.html

Stargazer ARIMA package in rmarkdown showing full output

I'm trying to generate a PDF with rmarkdown, using stargazer to present some models using the ARIMA package. The table looks beautiful, but there is a lot of output above in the final PDF.
I've tried a few chunk options (message=F, comment=F, header=F) and none get rid of this output. Using results="hide" gets rid of the final table as well.
The final code I'm using is:
```
```{r 1_b_ii, results='asis', echo=F}
stargazer(m, title="Fitting an AR(0) regression to DemHouseMaj",
type = 'latex',
nobs=T,
digits=2,
single.row=T,
dep.var.caption = "Democratic House Majority",
dep.var.labels = "Coefficient (Standard Error)",
header=F) ```
```
Anyone have a solution for this?
Do you have the forecast package loaded? If you do, restart your R session and run your code chunk before you load the forecast package. I'm not sure why, but summarizing arima() models in stargazer is affected by forecast.

Tensorflow: scalar_summary duplicate exception

I'm following the tensorboard tutorial in order to learn how to use summaries and I keep getting the error below.
It throws the error while calling:
summary_op = tf.merge_all_summaries()
but the problem, seems to be here:
def variable_summaries(var):
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.scalar_summary('mean', mean)
Any clues why is this happening?
InvalidArgumentError (see above for traceback): Duplicate tag mean
found in summary inputs [[Node: MergeSummary/MergeSummary =
MergeSummary[N=7,
_device="/job:localhost/replica:0/task:0/cpu:0"](layer1/weights/summaries/ScalarSummary,
layer1/biases/summaries/ScalarSummary,
layer2/weights/summaries/ScalarSummary,
layer2/biases/summaries/ScalarSummary,
out/weights/summaries/ScalarSummary,
out/biases/summaries/ScalarSummary, ScalarSummary)]]
The problem is on the source where I got the code. The tensorboard link takes us to the master version where the code is wrong:
def variable_summaries(var):
"""Attach a lot of summaries to a Tensor (for TensorBoard visualization)."""
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.summary.scalar('mean', mean)
with tf.name_scope('stddev'):
stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
tf.summary.scalar('stddev', stddev)
tf.summary.scalar('max', tf.reduce_max(var))
tf.summary.scalar('min', tf.reduce_min(var))
tf.summary.histogram('histogram', var)
The other versions have the following, correct, code:
def variable_summaries(var, name):
"""Attach a lot of summaries to a Tensor."""
with tf.name_scope('summaries'):
mean = tf.reduce_mean(var)
tf.scalar_summary('mean/' + name, mean)
with tf.name_scope('stddev'):
stddev = tf.sqrt(tf.reduce_mean(tf.square(var - mean)))
tf.scalar_summary('stddev/' + name, stddev)
tf.scalar_summary('max/' + name, tf.reduce_max(var))
tf.scalar_summary('min/' + name, tf.reduce_min(var))
tf.histogram_summary(name, var)