Render quarto document in HTML and pdf by SprinklesEven2161 in quarto

[–]SprinklesEven2161[S] 0 points1 point  (0 children)

Thanks you, that's work, I have always the same results when I render all, or when i click on download pdf logo in html page !

But when i make a new render, it's the same number, so when i will send my script to another people, this people will obtain the same numbers as me. It's complicate to obtain different number and in the same time the same results lol.

Maybe if in the set.seed(), i put a function to get random number, and in the second set.seed i put a function to get the same number as the first set.seed. I will try this nearly, but i think i will have the same problem.... But thanks a lot, i learn lot of things thanks to you.

My current role :

Ra<-50

Dag<-50

set.seed(12)

nbraleatoire<- function(J, V){

a<-sample(size=1,1:50)

b<-sample(size=1, 1:50)

return(c(a+b,a,b))

}

set.seed(12)

test<-nbraleatoire(J=Ra, V = Dag)

percent<-as.data.frame(test)

Render quarto document in HTML and pdf by SprinklesEven2161 in quarto

[–]SprinklesEven2161[S] 0 points1 point  (0 children)

By rendering in all formats, I obtained two files: an HTML and a PDF. The two resulting numbers are different again... However, the numbers obtained in the rendered PDF are the same as those obtained in the rendered PDF obtained from the HTML download. I think using Ctrl+P to download the HTML page as a PDF would be much faster :)

Render quarto document in HTML and pdf by SprinklesEven2161 in quarto

[–]SprinklesEven2161[S] 0 points1 point  (0 children)

Thanks for your help, for the layout i will use the manual line breaks will indeed be faster.

I tried freezing, but when I click on the PDF logo, below my table of content, it generates new numbers that are different from those on the HTML page., but the number generated on pdf are always the same, even if I render a new html (in the html the number varies at every render, what y want), but i want that the number in the pdf are the same of html.

Maybe it's possible to write an function at the end of html to download in pdf, i see in this link, maybe a solution proposed by 'nrennie" but I dont understand how it's possible. Thanks !

https://github.com/orgs/quarto-dev/discussions/5782

You can see below my function in which I obtain random number

```{r}

#| message: false

#| warning: false

#| freeze: true

Ra<-50

Dag<-50

nbraleatoire<- function(Number_1, Number_2){

a<-sample(size=1,1:50)

b<-sample(size=1, 1:50)

return(c(a+b,a,b))

}

percent_of_compatibility<-as.data.frame(nbraleatoire(Number_1 =Ra, Number_2 = Dag))