Home Comments Thread
New Thread

8 Comments

giscus-bot giscus-bot 2022-12-16 22:26:57
Guest *nanounanue* @ 2012-06-21 18:00:14 originally posted:

Hi!

I just want to thank you for your excellent package!

I don't know if you noticed, but the last link is broken (the "knitr-card.R" one)

yihui yihui 2022-12-16 22:27:04

Thanks! I'm aware of that. I have fixed it locally a while ago but have not pushed it to the server. Should be fixed now.

Originally posted on 2012-06-22 05:00:23

giscus-bot giscus-bot 2022-12-16 22:26:58
Guest *Jesus_Gaby* @ 2012-12-01 16:57:24 originally posted:

Hi Yihu,

I would like to make a dynamic report using KNITR like what PHP and MySQL do using Apcahe and PHPMyAdmin. My database is Postgres SQL and I would like to make any other reporting system that integrated with my existence database to provide dynamic reporting. I prefer using KNITR, any suggestion?

yihui yihui 2022-12-16 22:27:05

Just like using PHP to connect to MySQL, you can use R to connect to PostgresSQL (take a look at the database related packages like RODBC and RPostgreSQL). Then the rest of things are similar: just like write HTML with PHP, you write HTML with R. You can use either R Markdown or R HTML as the authoring format.

Originally posted on 2012-12-01 23:12:27

giscus-bot giscus-bot 2022-12-16 22:26:59
Guest *Jesus_Gaby* @ 2012-12-02 00:00:07 originally posted:

Thanks, it´s work now :) I already connected to database using RPostgreSQL and DBI, already explored data, make summarization and visualization. I'm using R Markdown, if the data on database increased, through the script, will the result on browser changed automatically? could you provide me any tutorial about KNITR?

Thanks in advance,

yihui yihui 2022-12-16 22:27:06

When the data has changed, just re-compile the R Markdown document. I'm not sure what else you were expecting.

Originally posted on 2012-12-02 04:24:12

giscus-bot giscus-bot 2022-12-16 22:27:00
Guest *Jesus_Gaby* @ 2012-12-02 18:28:12 originally posted:

Yeah, that's what I expected, but is there any way to re-compile the R-Markdown automatically? Because what I do this moment is going to RStudio and do it manually [compile one by one] for every report.

Thanks in advance,

yihui yihui 2022-12-16 22:27:07

Yes, you can do it in command line: Rscript -e "library(knitr); knit('your_report.Rnw')"

RStudio is only one possible editor for R Markdown files. It calls R in the above way behind the scene.

Originally posted on 2012-12-03 07:07:54

giscus-bot giscus-bot 2022-12-16 22:27:01
Guest *Jesus_Gaby* @ 2012-12-03 15:20:58 originally posted:

your_report.Rnw? My reports are saved in Rmd. Any way, can you explain me more details how to run it automatically?

Thanks in advance,

yihui yihui 2022-12-16 22:27:07

Google for "cron job" (if you use *nix) or Windows Task Scheduler (if you are under Windows). Or use Shell scripts or Makefile; there are tons of ways to do it if you are familiar with command line tools.

Replace Rnw with Rmd; that is just a typo.

Originally posted on 2012-12-03 17:37:55

giscus-bot giscus-bot 2022-12-16 22:27:02
Guest *Jesus_Gaby* @ 2012-12-03 23:18:09 originally posted:

Thanks Yihui, I got the point now.

Best Regards,

giscus-bot giscus-bot 2022-12-16 22:27:03
Guest *alobo* @ 2013-10-24 14:43:11 originally posted:

Can I print "nice" tables with xtable within an script to be run with spin()?

I tried
print(xtable(cors_856), type='html')
where cors_856 a 5x5 matrix
but got all the html codes.

Thanks

Agus

yihui yihui 2022-12-16 22:27:08

yes, use the chunk option results='asis'

Originally posted on 2013-10-27 05:54:54

Tarious14 Tarious14 2023-07-30 10:35:27

Hello Yihui, you said that "need to write documentclass after #'" when converting to other formats and I don't really get it. Could you give an example for this ? Thanks a lot.

yihui yihui 2023-07-30 14:22:19

I mean when you want to convert an R script to Rnw, you may need to declare the LaTeX document class in the beginning, e.g.,

#' \documentclass{article}
Tarious14 Tarious14 2023-07-30 15:20:19

Oh I used to test it without backslash like latex command. Almost get it :vv. Thank you for your help and also your terrific package.

Tarious14 Tarious14 2023-07-30 15:44:02

Hi Yihui, it's doesn't work with me. I declared the Latex document class in the first line of my R script and it returns this error:

Error in report && format %in% c("Rnw", "Rtex") && !grepl("^\\s*\\\\documentclass"

How can I overcome it ? Thanks

yihui yihui 2023-07-31 01:25:23

This is a bug in knitr, and I just fixed it: yihui/knitr@ec4c9b6 Thanks for the report!

remotes::install_github('yihui/knitr')

Sign in to join the discussion

Sign in with GitHub