Hemken / Statamarkdown

Functions to write Stata documentation with knitr
Other
59 stars 11 forks source link

Possible problems with output from the display command in a stata chunk #14

Closed remlapmot closed 1 year ago

remlapmot commented 3 years ago

I think I notice that

An example Rmd file is below - pdf output attached stmd-test.pdf

I am not sure where the error is for these, and maybe there are 2 or more little errors.

I tried to investigate

I have Stata 15.1 (but don't think this is anything to do with the Stata version).

Sorry I can't propose fixes.

Example Rmd file code

---
title: "display command output examples"
output: pdf_document
---

```{r setup}
# remotes::install_github("hemken/statamarkdown")
library(Statamarkdown)
library(sessioninfo)

Output for this chunk is missing

display "Hello 1"

Output correctly displayed with the first blank line removed


di "Hello 2"

Output from the first command omitted

di "Hello 3"
di "Hello 4"

Checking if these occur without the use of string quotes in the command

display 1

di 2
di 3
di 4
sessioninfo::session_info()
Hemken commented 3 years ago

Thanks for the heads up

From: Tom Palmer notifications@github.com Sent: Tuesday, December 1, 2020 3:39 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/Statamarkdown] Possible problems with output from the display command in a stata chunk (#14)

I think I notice that

An example Rmd file is below - pdf output attached stmd-test.pdfhttps://github.com/Hemken/Statamarkdown/files/5621596/stmd-test.pdf

I am not sure where the error is for these, and maybe there are 2 or more little errors.

I tried to investigate

Warning messages:

1: In min(grep("[[:alnum:]]", y)) :

no non-missing arguments to min; returning Inf

I have Stata 15.1 (but don't think this is anything to do with the Stata version).

Sorry I can't propose fixes.

Example Rmd file code


title: "display command output examples"

output: pdf_document



# remotes::install_github("hemken/statamarkdown")

library(Statamarkdown)

library(sessioninfo)

Output for this chunk is missing


display "Hello 1"

Output correctly displayed with the first blank line removed


di "Hello 2"

Output from the first command omitted


di "Hello 3"

di "Hello 4"

Checking if these occur without the use of string quotes in the command


display 1

di 2

di 3

di 4

sessioninfo::session_info()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/14, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME2VIZ2AOX6GGB7FVATSSS2T3ANCNFSM4UIYOW5A.

Hemken commented 3 years ago

Well, you’ve demonstrated that it’s not the quotes, and I can tell you that the problem is prior to the output hook.

From: Tom Palmer notifications@github.com Sent: Tuesday, December 1, 2020 3:39 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/Statamarkdown] Possible problems with output from the display command in a stata chunk (#14)

I think I notice that

An example Rmd file is below - pdf output attached stmd-test.pdfhttps://github.com/Hemken/Statamarkdown/files/5621596/stmd-test.pdf

I am not sure where the error is for these, and maybe there are 2 or more little errors.

I tried to investigate

Warning messages:

1: In min(grep("[[:alnum:]]", y)) :

no non-missing arguments to min; returning Inf

I have Stata 15.1 (but don't think this is anything to do with the Stata version).

Sorry I can't propose fixes.

Example Rmd file code


title: "display command output examples"

output: pdf_document



# remotes::install_github("hemken/statamarkdown")

library(Statamarkdown)

library(sessioninfo)

Output for this chunk is missing


display "Hello 1"

Output correctly displayed with the first blank line removed


di "Hello 2"

Output from the first command omitted


di "Hello 3"

di "Hello 4"

Checking if these occur without the use of string quotes in the command


display 1

di 2

di 3

di 4

sessioninfo::session_info()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/14, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME2VIZ2AOX6GGB7FVATSSS2T3ANCNFSM4UIYOW5A.

Hemken commented 3 years ago

A quick work around is to have a profile.do (even an empty one). The deeper problem lies back in knitr, so I will have to get Yihui to modify a line or two of code (that I contributed – my error!)

From: Tom Palmer notifications@github.com Sent: Tuesday, December 1, 2020 3:39 AM To: Hemken/Statamarkdown Statamarkdown@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [Hemken/Statamarkdown] Possible problems with output from the display command in a stata chunk (#14)

I think I notice that

An example Rmd file is below - pdf output attached stmd-test.pdfhttps://github.com/Hemken/Statamarkdown/files/5621596/stmd-test.pdf

I am not sure where the error is for these, and maybe there are 2 or more little errors.

I tried to investigate

Warning messages:

1: In min(grep("[[:alnum:]]", y)) :

no non-missing arguments to min; returning Inf

I have Stata 15.1 (but don't think this is anything to do with the Stata version).

Sorry I can't propose fixes.

Example Rmd file code


title: "display command output examples"

output: pdf_document



# remotes::install_github("hemken/statamarkdown")

library(Statamarkdown)

library(sessioninfo)

Output for this chunk is missing


display "Hello 1"

Output correctly displayed with the first blank line removed


di "Hello 2"

Output from the first command omitted


di "Hello 3"

di "Hello 4"

Checking if these occur without the use of string quotes in the command


display 1

di 2

di 3

di 4

sessioninfo::session_info()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/14, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME2VIZ2AOX6GGB7FVATSSS2T3ANCNFSM4UIYOW5A.

remlapmot commented 3 years ago

that's brilliant - thanks

Hemken commented 1 year ago

Resolved in an upcoming update to knitr

remlapmot commented 1 year ago

Thanks indeed - I tested with the development version of knitr with your commit and this is fixed.

Hemken commented 1 year ago

Thanks for closing this, I hadn't gotten around to testing this specific report myself.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Tom Palmer @.> Sent: Thursday, January 26, 2023 7:56:52 AM To: Hemken/Statamarkdown @.> Cc: Doug Hemken @.>; Comment @.> Subject: Re: [Hemken/Statamarkdown] Possible problems with output from the display command in a stata chunk (#14)

Closed #14https://github.com/Hemken/Statamarkdown/issues/14 as completed.

— Reply to this email directly, view it on GitHubhttps://github.com/Hemken/Statamarkdown/issues/14#event-8364842079, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACYBME4PAYUXVE3HYRC6NNTWUKGDJANCNFSM4UIYOW5A. You are receiving this because you commented.Message ID: @.***>