Re: Knitr (Rnw) Rscript error log

2012-10-02 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:
 If you are using the German translation of the GUI, you can set the
 interface language option to be Default in the preferences. Otherwise
 you have to wait for LyX 2.0.5 for the bug fix.


My interpretation was wrong then. I thought the workaround was to 
explicitly use the Default language option if I had been using the 
German GUI. My OS is set to American language, so Default for me led 
to US GUI and the C locale. Setting the user interface language to 
German solves it. I could have thought this far... Thanks yet again.



On 10/1/12 10:36 PM, Jean-Marc Lasgouttes wrote:

What do you mean exactly? Is it just that the US GUI is not convenient
to you? You do not need the German UI to input German documents.



Quite the contrary, I prefer the US GUI. The last sentence is exactly 
why I thought my German document has to work using the the US GUI. I 
thought that setting the document language leads to Rscript picking up 
the correct locale - it did not occur to me that the locale is 
influenced by the GUI language setting.




Re: Knitr (Rnw) Rscript error log

2012-10-02 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:
 If you are using the German translation of the GUI, you can set the
 interface language option to be Default in the preferences. Otherwise
 you have to wait for LyX 2.0.5 for the bug fix.


My interpretation was wrong then. I thought the workaround was to 
explicitly use the Default language option if I had been using the 
German GUI. My OS is set to American language, so Default for me led 
to US GUI and the C locale. Setting the user interface language to 
German solves it. I could have thought this far... Thanks yet again.



On 10/1/12 10:36 PM, Jean-Marc Lasgouttes wrote:

What do you mean exactly? Is it just that the US GUI is not convenient
to you? You do not need the German UI to input German documents.



Quite the contrary, I prefer the US GUI. The last sentence is exactly 
why I thought my German document has to work using the the US GUI. I 
thought that setting the document language leads to Rscript picking up 
the correct locale - it did not occur to me that the locale is 
influenced by the GUI language setting.




Re: Knitr (Rnw) Rscript error log

2012-10-02 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:
> If you are using the German translation of the GUI, you can set the
> interface language option to be Default in the preferences. Otherwise
> you have to wait for LyX 2.0.5 for the bug fix.
>

My interpretation was wrong then. I thought the workaround was to 
explicitly use the "Default" language option if I had been using the 
German GUI. My OS is set to American language, so "Default" for me led 
to US GUI and the C locale. Setting the user interface language to 
German solves it. I could have thought this far... Thanks yet again.



On 10/1/12 10:36 PM, Jean-Marc Lasgouttes wrote:

What do you mean exactly? Is it just that the US GUI is not convenient
to you? You do not need the German UI to input German documents.



Quite the contrary, I prefer the US GUI. The last sentence is exactly 
why I thought my German document has to work using the the US GUI. I 
thought that setting the document language leads to Rscript picking up 
the correct locale - it did not occur to me that the locale is 
influenced by the GUI language setting.




Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:

Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.



Thanks for your help on investigation and the bug link!

I am using an American locale and GUI, so interface language default 
does not work.


Anyway, I am preparing statistics lectures involving R as the main tool, 
so I might get into compiling LyX myself if I can find my way around on 
the (new) OS X - switched two weeks ago...


Best Regards,
Michael




Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Jean-Marc Lasgouttes

Le 01/10/12 21:37, Michael Bach a écrit :

On 10/1/12 12:15 AM, Yihui Xie wrote:
I am using an American locale and GUI, so interface language default
does not work.


What do you mean exactly? Is it just that the US GUI is not convenient 
to you? You do not need the German UI to input German documents.


JMarc


Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Yihui Xie
That is something confused me as well. Here is a screenshot of what I
was talking about: http://i.imgur.com/vkLhP.png It only sets the
language of the GUI and will not affect the document itself.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Oct 1, 2012 at 3:36 PM, Jean-Marc Lasgouttes lasgout...@lyx.org wrote:
 Le 01/10/12 21:37, Michael Bach a écrit :
 I am using an American locale and GUI, so interface language default
 does not work.


 What do you mean exactly? Is it just that the US GUI is not convenient to
 you? You do not need the German UI to input German documents.

 JMarc


Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:

Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.



Thanks for your help on investigation and the bug link!

I am using an American locale and GUI, so interface language default 
does not work.


Anyway, I am preparing statistics lectures involving R as the main tool, 
so I might get into compiling LyX myself if I can find my way around on 
the (new) OS X - switched two weeks ago...


Best Regards,
Michael




Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Jean-Marc Lasgouttes

Le 01/10/12 21:37, Michael Bach a écrit :

On 10/1/12 12:15 AM, Yihui Xie wrote:
I am using an American locale and GUI, so interface language default
does not work.


What do you mean exactly? Is it just that the US GUI is not convenient 
to you? You do not need the German UI to input German documents.


JMarc


Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Yihui Xie
That is something confused me as well. Here is a screenshot of what I
was talking about: http://i.imgur.com/vkLhP.png It only sets the
language of the GUI and will not affect the document itself.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Oct 1, 2012 at 3:36 PM, Jean-Marc Lasgouttes lasgout...@lyx.org wrote:
 Le 01/10/12 21:37, Michael Bach a écrit :
 I am using an American locale and GUI, so interface language default
 does not work.


 What do you mean exactly? Is it just that the US GUI is not convenient to
 you? You do not need the German UI to input German documents.

 JMarc


Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Michael Bach

On 10/1/12 12:15 AM, Yihui Xie wrote:

Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.



Thanks for your help on investigation and the bug link!

I am using an American locale and GUI, so interface language default 
does not work.


Anyway, I am preparing statistics lectures involving R as the main tool, 
so I might get into compiling LyX myself if I can find my way around on 
the (new) OS X - switched two weeks ago...


Best Regards,
Michael




Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Jean-Marc Lasgouttes

Le 01/10/12 21:37, Michael Bach a écrit :

On 10/1/12 12:15 AM, Yihui Xie wrote:
I am using an American locale and GUI, so interface language default
does not work.


What do you mean exactly? Is it just that the US GUI is not convenient 
to you? You do not need the German UI to input German documents.


JMarc


Re: Knitr (Rnw) Rscript error log

2012-10-01 Thread Yihui Xie
That is something confused me as well. Here is a screenshot of what I
was talking about: http://i.imgur.com/vkLhP.png It only sets the
language of the GUI and will not affect the document itself.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Mon, Oct 1, 2012 at 3:36 PM, Jean-Marc Lasgouttes  wrote:
> Le 01/10/12 21:37, Michael Bach a écrit :
>> I am using an American locale and GUI, so interface language default
>> does not work.
>
>
> What do you mean exactly? Is it just that the US GUI is not convenient to
> you? You do not need the German UI to input German documents.
>
> JMarc


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/29/12 11:43 PM, Yihui Xie wrote:

He sent me the message log without cc'ing the list, and I saw



Sorry about that, I am using a Newsgroup Account under Thunderbird and 
am posting to gmane. There is a predefined Newsgroup field that I use, 
that posts to gmane, and thus later also to the LyX list, or so I 
thought. This field apparently does not get transmitted in the email 
header, so I will now try to also cc the list. Sorry in advance for 
eventual double-posts because of this...



12:13:14.353: Rscript --verbose --no-save --no-restore
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
UTF-8 /Users/XYZ/Documents/...

I think that is Mac OS, although in the first email it was Windows 7.



Sorry about the confusion! The error occurs only on Mac OS X 10.8.2 
Mountain Lion. The problem I think is related to the fact that I work on 
the same code base from both Windows 7 and Mac OS X using a git 
repository. To handle end-of-line characters differently, there is an 
option in git to always commit unix-style line endings, but check out 
files with OS-native line endings respectively.


Now I wondered whether end-of-line issues lead to the error, but then 
again the .tex gets cut off some lines after \begin{document}.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach
I found the error source, but have no clue for a fix yet. The resulting 
.tex document after a LyX-caused knit() is cut off exactly at the first 
occurrence of a German diacritic o, i.e. the character ö. This is also 
in line with the fact that the knitr-minimal example runs fine since it 
is written in English...


As I wrote earlier, a manual knit() from an R session on the .Rnw file 
succeeds. So I guess there is something wrong with the UTF-8 part in the 
Rscript call by the knitr(Rnw) module(?).


For reference:

 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex

 UTF-8 /Users/XYZ/Documents/...

R and Terminal locale are set correctly as mentioned in a previous post.

@Yihui:

Do you remember any similar issues when updating knitr.module and 
lyxknitr.R?


@Scott:

I will try your attached files if that could help now as the error is 
obvious.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
You can make a copy of that document, delete everything in it, and
only put a code chunk

=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 2:11 PM, Michael Bach pha...@gmail.com wrote:
 I found the error source, but have no clue for a fix yet. The resulting .tex
 document after a LyX-caused knit() is cut off exactly at the first
 occurrence of a German diacritic o, i.e. the character ö. This is also in
 line with the fact that the knitr-minimal example runs fine since it is
 written in English...

 As I wrote earlier, a manual knit() from an R session on the .Rnw file
 succeeds. So I guess there is something wrong with the UTF-8 part in the
 Rscript call by the knitr(Rnw) module(?).

 For reference:


 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R

 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw

 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
 UTF-8 /Users/XYZ/Documents/...

 R and Terminal locale are set correctly as mentioned in a previous post.

 @Yihui:

 Do you remember any similar issues when updating knitr.module and
 lyxknitr.R?

 @Scott:

 I will try your attached files if that could help now as the error is
 obvious.

 Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/30/12 10:51 PM, Yihui Xie wrote:

You can make a copy of that document, delete everything in it, and
only put a code chunk

=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().



Good idea, it is as I suspected:

sessionInfo()
## R version 2.15.1 (2012-06-22)
## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
##
## locale:
## [1] C
##
## attached base packages:
## [1] stats graphics  grDevices utils datasets  base
##
## other attached packages:
## [1] knitr_0.8
##
## loaded via a namespace (and not attached):
## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
## [5] stringr_0.6.1  tools_2.15.1

The R started from Terminal picks up the utf-8 locale, Rscript does not. 
How/where best to look next?


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 5:06 PM, Michael Bach pha...@gmail.com wrote:
 On 9/30/12 10:51 PM, Yihui Xie wrote:

 You can make a copy of that document, delete everything in it, and
 only put a code chunk

 =
 sessionInfo()
 @

 there and compile it. Then show us the results from sessionInfo().


 Good idea, it is as I suspected:

 sessionInfo()
 ## R version 2.15.1 (2012-06-22)
 ## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
 ##
 ## locale:
 ## [1] C
 ##
 ## attached base packages:
 ## [1] stats graphics  grDevices utils datasets  base
 ##
 ## other attached packages:
 ## [1] knitr_0.8
 ##
 ## loaded via a namespace (and not attached):
 ## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
 ## [5] stringr_0.6.1  tools_2.15.1

 The R started from Terminal picks up the utf-8 locale, Rscript does not.
 How/where best to look next?

 Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/29/12 11:43 PM, Yihui Xie wrote:

He sent me the message log without cc'ing the list, and I saw



Sorry about that, I am using a Newsgroup Account under Thunderbird and 
am posting to gmane. There is a predefined Newsgroup field that I use, 
that posts to gmane, and thus later also to the LyX list, or so I 
thought. This field apparently does not get transmitted in the email 
header, so I will now try to also cc the list. Sorry in advance for 
eventual double-posts because of this...



12:13:14.353: Rscript --verbose --no-save --no-restore
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
UTF-8 /Users/XYZ/Documents/...

I think that is Mac OS, although in the first email it was Windows 7.



Sorry about the confusion! The error occurs only on Mac OS X 10.8.2 
Mountain Lion. The problem I think is related to the fact that I work on 
the same code base from both Windows 7 and Mac OS X using a git 
repository. To handle end-of-line characters differently, there is an 
option in git to always commit unix-style line endings, but check out 
files with OS-native line endings respectively.


Now I wondered whether end-of-line issues lead to the error, but then 
again the .tex gets cut off some lines after \begin{document}.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach
I found the error source, but have no clue for a fix yet. The resulting 
.tex document after a LyX-caused knit() is cut off exactly at the first 
occurrence of a German diacritic o, i.e. the character ö. This is also 
in line with the fact that the knitr-minimal example runs fine since it 
is written in English...


As I wrote earlier, a manual knit() from an R session on the .Rnw file 
succeeds. So I guess there is something wrong with the UTF-8 part in the 
Rscript call by the knitr(Rnw) module(?).


For reference:

 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex

 UTF-8 /Users/XYZ/Documents/...

R and Terminal locale are set correctly as mentioned in a previous post.

@Yihui:

Do you remember any similar issues when updating knitr.module and 
lyxknitr.R?


@Scott:

I will try your attached files if that could help now as the error is 
obvious.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
You can make a copy of that document, delete everything in it, and
only put a code chunk

=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 2:11 PM, Michael Bach pha...@gmail.com wrote:
 I found the error source, but have no clue for a fix yet. The resulting .tex
 document after a LyX-caused knit() is cut off exactly at the first
 occurrence of a German diacritic o, i.e. the character ö. This is also in
 line with the fact that the knitr-minimal example runs fine since it is
 written in English...

 As I wrote earlier, a manual knit() from an R session on the .Rnw file
 succeeds. So I guess there is something wrong with the UTF-8 part in the
 Rscript call by the knitr(Rnw) module(?).

 For reference:


 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R

 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw

 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
 UTF-8 /Users/XYZ/Documents/...

 R and Terminal locale are set correctly as mentioned in a previous post.

 @Yihui:

 Do you remember any similar issues when updating knitr.module and
 lyxknitr.R?

 @Scott:

 I will try your attached files if that could help now as the error is
 obvious.

 Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/30/12 10:51 PM, Yihui Xie wrote:

You can make a copy of that document, delete everything in it, and
only put a code chunk

=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().



Good idea, it is as I suspected:

sessionInfo()
## R version 2.15.1 (2012-06-22)
## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
##
## locale:
## [1] C
##
## attached base packages:
## [1] stats graphics  grDevices utils datasets  base
##
## other attached packages:
## [1] knitr_0.8
##
## loaded via a namespace (and not attached):
## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
## [5] stringr_0.6.1  tools_2.15.1

The R started from Terminal picks up the utf-8 locale, Rscript does not. 
How/where best to look next?


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 5:06 PM, Michael Bach pha...@gmail.com wrote:
 On 9/30/12 10:51 PM, Yihui Xie wrote:

 You can make a copy of that document, delete everything in it, and
 only put a code chunk

 =
 sessionInfo()
 @

 there and compile it. Then show us the results from sessionInfo().


 Good idea, it is as I suspected:

 sessionInfo()
 ## R version 2.15.1 (2012-06-22)
 ## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
 ##
 ## locale:
 ## [1] C
 ##
 ## attached base packages:
 ## [1] stats graphics  grDevices utils datasets  base
 ##
 ## other attached packages:
 ## [1] knitr_0.8
 ##
 ## loaded via a namespace (and not attached):
 ## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
 ## [5] stringr_0.6.1  tools_2.15.1

 The R started from Terminal picks up the utf-8 locale, Rscript does not.
 How/where best to look next?

 Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/29/12 11:43 PM, Yihui Xie wrote:

He sent me the message log without cc'ing the list, and I saw



Sorry about that, I am using a Newsgroup Account under Thunderbird and 
am posting to gmane. There is a predefined "Newsgroup" field that I use, 
that posts to gmane, and thus later also to the LyX list, or so I 
thought. This field apparently does not get transmitted in the email 
header, so I will now try to also cc the list. Sorry in advance for 
eventual double-posts because of this...



12:13:14.353: Rscript --verbose --no-save --no-restore
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw"
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex"
UTF-8 "/Users/XYZ/Documents/..."

I think that is Mac OS, although in the first email it was Windows 7.



Sorry about the confusion! The error occurs only on Mac OS X 10.8.2 
Mountain Lion. The problem I think is related to the fact that I work on 
the same code base from both Windows 7 and Mac OS X using a git 
repository. To handle end-of-line characters differently, there is an 
option in git to always commit unix-style line endings, but check out 
files with OS-native line endings respectively.


Now I wondered whether end-of-line issues lead to the error, but then 
again the .tex gets cut off some lines after \begin{document}.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach
I found the error source, but have no clue for a fix yet. The resulting 
.tex document after a LyX-caused knit() is cut off exactly at the first 
occurrence of a German diacritic o, i.e. the character ö. This is also 
in line with the fact that the knitr-minimal example runs fine since it 
is written in English...


As I wrote earlier, a manual knit() from an R session on the .Rnw file 
succeeds. So I guess there is something wrong with the UTF-8 part in the 
Rscript call by the knitr(Rnw) module(?).


For reference:

> 12:13:14.353: Rscript --verbose --no-save --no-restore
> "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
> 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw"
> 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex"

> UTF-8 "/Users/XYZ/Documents/..."

R and Terminal locale are set correctly as mentioned in a previous post.

@Yihui:

Do you remember any similar issues when updating knitr.module and 
lyxknitr.R?


@Scott:

I will try your attached files if that could help now as the error is 
obvious.


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
You can make a copy of that document, delete everything in it, and
only put a code chunk

<<>>=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 2:11 PM, Michael Bach  wrote:
> I found the error source, but have no clue for a fix yet. The resulting .tex
> document after a LyX-caused knit() is cut off exactly at the first
> occurrence of a German diacritic o, i.e. the character ö. This is also in
> line with the fact that the knitr-minimal example runs fine since it is
> written in English...
>
> As I wrote earlier, a manual knit() from an R session on the .Rnw file
> succeeds. So I guess there is something wrong with the UTF-8 part in the
> Rscript call by the knitr(Rnw) module(?).
>
> For reference:
>
>
>> 12:13:14.353: Rscript --verbose --no-save --no-restore
>> "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
>>
>> "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw"
>>
>> "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex"
>> UTF-8 "/Users/XYZ/Documents/..."
>
> R and Terminal locale are set correctly as mentioned in a previous post.
>
> @Yihui:
>
> Do you remember any similar issues when updating knitr.module and
> lyxknitr.R?
>
> @Scott:
>
> I will try your attached files if that could help now as the error is
> obvious.
>
> Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Michael Bach

On 9/30/12 10:51 PM, Yihui Xie wrote:

You can make a copy of that document, delete everything in it, and
only put a code chunk

<<>>=
sessionInfo()
@

there and compile it. Then show us the results from sessionInfo().



Good idea, it is as I suspected:

sessionInfo()
## R version 2.15.1 (2012-06-22)
## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
##
## locale:
## [1] C
##
## attached base packages:
## [1] stats graphics  grDevices utils datasets  base
##
## other attached packages:
## [1] knitr_0.8
##
## loaded via a namespace (and not attached):
## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
## [5] stringr_0.6.1  tools_2.15.1

The R started from Terminal picks up the utf-8 locale, Rscript does not. 
How/where best to look next?


Michael


Re: Knitr (Rnw) Rscript error log

2012-09-30 Thread Yihui Xie
Wonderful. That is the root of the problem. The locale should not be C.

This bug has been biting us: http://www.lyx.org/trac/ticket/7741

If you are using the German translation of the GUI, you can set the
interface language option to be Default in the preferences. Otherwise
you have to wait for LyX 2.0.5 for the bug fix.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sun, Sep 30, 2012 at 5:06 PM, Michael Bach  wrote:
> On 9/30/12 10:51 PM, Yihui Xie wrote:
>>
>> You can make a copy of that document, delete everything in it, and
>> only put a code chunk
>>
>> <<>>=
>> sessionInfo()
>> @
>>
>> there and compile it. Then show us the results from sessionInfo().
>>
>
> Good idea, it is as I suspected:
>
> sessionInfo()
> ## R version 2.15.1 (2012-06-22)
> ## Platform: i386-apple-darwin9.8.0/i386 (32-bit)
> ##
> ## locale:
> ## [1] C
> ##
> ## attached base packages:
> ## [1] stats graphics  grDevices utils datasets  base
> ##
> ## other attached packages:
> ## [1] knitr_0.8
> ##
> ## loaded via a namespace (and not attached):
> ## [1] digest_0.5.2   evaluate_0.4.2 formatR_0.6plyr_1.7.1
> ## [5] stringr_0.6.1  tools_2.15.1
>
> The R started from Terminal picks up the utf-8 locale, Rscript does not.
> How/where best to look next?
>
> Michael


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

On 9/26/12 6:25 PM, Yihui Xie wrote:

The first place to look at is View--View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf



Very good to know, thanks. I enabled that and tried again. It seems that 
there is an invalid input found by R(?). Please see also the complete 
log at the end of this post.


I investigated the .tex file and found it was cut off in the middle of 
the abstract environment. I then opened an R session in the temp 
directory and ran knit(skryptum.Rnw) which produces a skryptum.tex 
file that can be tex'ed correctly and contains the \Sepr{} parts. Also, 
the .Rnw file is complete, i.e. not cut off like the .tex file.


So I guess the Rscript call messes things up? I tried the hint by Scott 
on setting an error hook, but to no avail. How to debug further?


--
12:13:14.051: Previewing ...
12:13:14.085: (buffer-view: ⌘R)
12:13:14.353: Rscript --verbose --no-save --no-restore 
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8 /Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/

12:13:14.373: running
12:13:14.381: 
'/Library/Frameworks/R.framework/Versions/2.15/Resources/bin/R --slave 
--no-restore --no-save --no-restore 
--file=/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
--args /var/folders/yx/
12:13:14.383: 
tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8'

12:13:14.384:

Running: Rscript --verbose --no-save --no-restore 
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8 /Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/

12:13:14.663: [1] TRUE
12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'
12:13:14.925:
12:13:14.925:
12:13:14.927: processing file: skryptum.Rnw
12:13:14.942:
  |
  | |   0%
  |
12:13:14.943:
  || 100%
12:13:14.944:   ordinary text without R code
12:13:14.944:
12:13:14.947:
12:13:14.948: output file: /Users/.../Documents/Vorlesung/Theorie der 
Simulationstechnik/src/skryptum.tex

12:13:14.949:
12:13:14.949: [1] skryptum.tex
12:13:14.951: [1] TRUE
12:13:14.965: pdflatex  skryptum.tex
Running: pdflatex  skryptum.tex  /dev/null
12:13:15.211: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:15.212:  restricted \write18 enabled.
12:13:15.227: entering extended mode
12:13:15.229: (./skryptum.tex
12:13:15.230: LaTeX2e 2011/06/27
12:13:15.230: Babel v3.8m and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:15.231: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:15.232: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:15.232: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 
ethiopic, farsi, finnis
12:13:15.233: h, french, friulan, galician, german, ngerman, 
swissgerman, monogreek, greek, h
12:13:15.233: ungarian, icelandic, assamese, bengali, gujarati, hindi, 
kannada, malayalam, ma
12:13:15.234: rathi, oriya, panjabi, tamil, telugu, indonesian, 
interlingua, irish, italian,
12:13:15.234: kurmanji, latin, latvian, lithuanian, mongolian, 
mongolianlmc, bokmal, nynorsk,
12:13:15.235:  polish, portuguese, romanian, romansh, russian, sanskrit, 
serbian, serbianc, s
12:13:15.236: lovak, slovenian, spanish, swedish, turkish, turkmen, 
ukrainian, uppersorbian,

12:13:15.236: welsh, loaded.
12:13:15.237:
12:13:16.309: pdflatex  skryptum.tex
12:13:16.503: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:16.504:  restricted \write18 enabled.
/Users/Shared/LyX/lyx-2.0.4/src/support/Systemcall.cpp(273): Systemcall: 
'pdflatex  skryptum.tex' finished with exit code 1


Running: pdflatex  skryptum.tex  /dev/null
12:13:16.520: entering extended mode
12:13:16.521: (./skryptum.tex
12:13:16.521: LaTeX2e 2011/06/27
12:13:16.522: Babel v3.8m and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:16.523: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:16.523: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:16.523: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 
ethiopic, farsi, finnis
12:13:16.524: h, french, friulan, galician, german, ngerman, 
swissgerman, 

Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

Just a quick follow-up.

I gather from the log that R reads the file as UTF-8. I checked my System

$ locale

and the R

 Sys.getlocale()

Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...



Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
Does the knitr example file work? I forget how to get to example files on MacOS.

Mabye Yihui will have an idea of what's going on, but in the meantime
if you want to try something, you can try with the newest version of
LyX's knitr module that Yihui sent in a couple of days ago. To do
this, you can either

(1) apply the attached diff. It should succeed on 2.0.4 with a hunk offset.

or

(2) copy the other two files attached, to the correct places.

Don't forget to back up the original files.

Scott

On Sat, Sep 29, 2012 at 11:52 AM, Michael Bach pha...@gmail.com wrote:
 Just a quick follow-up.

 I gather from the log that R reads the file as UTF-8. I checked my System

 $ locale

 and the R

 Sys.getlocale()

 Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...

diff --git a/lib/examples/knitr.lyx b/lib/examples/knitr.lyx
index ddbfe01..feab161 100644
--- a/lib/examples/knitr.lyx
+++ b/lib/examples/knitr.lyx
@@ -182,7 +182,7 @@ status collapsed
 
 \begin_layout Plain Layout
 
-http://yihui.github.com/knitr
+http://yihui.name/knitr
 \end_layout
 
 \end_inset
diff --git a/lib/layouts/knitr.module b/lib/layouts/knitr.module
index 694ae77..fe64359 100644
--- a/lib/layouts/knitr.module
+++ b/lib/layouts/knitr.module
@@ -1,7 +1,7 @@
 #\DeclareLyXModule[knitr-latex]{Rnw (knitr)}
 #DescriptionBegin
 #Uses the knitr package in R for dynamic report generation. This R package has 
to be installed for this module to work: install.packages('knitr'). Note it 
depends on R = 2.14.1.
-#For more info see http://yihui.github.com/knitr
+#For more info see http://yihui.name/knitr
 #DescriptionEnd
 #Category: literate
 #Excludes: lilypond | sweave
diff --git a/lib/scripts/lyxknitr.R b/lib/scripts/lyxknitr.R
index 03150f2..7c029ea 100644
--- a/lib/scripts/lyxknitr.R
+++ b/lib/scripts/lyxknitr.R
@@ -11,7 +11,7 @@
 ## author Yihui Xie
 
 ## knitr is an alternative package to Sweave, and has more features
-## and flexibility; see https://yihui.github.com/knitr
+## and flexibility; see https://yihui.name/knitr
 
 ## Rscript $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r
 ## $$p the path of the output (temp dir)
@@ -31,18 +31,7 @@ options(encoding = .cmdargs[3])
 ## can put your data files there and functions like read.table() can
 ## work correctly without specifying the full path
 setwd(.cmdargs[4])
+opts_knit$set(root.dir = getwd())
 
-## copy the Rnw file to the current working directory if it does not exist
-.tmp.file = tempfile(); .rnw.file = basename(.cmdargs[1])
-.rnw.exists = file.exists(.rnw.file)
-if (.rnw.exists) file.rename(.rnw.file, .tmp.file)
-file.copy(.cmdargs[1], '.')
 ## run knit() to get .tex or .R
-knit(.rnw.file, tangle = 'tangle' %in% .cmdargs)
-
-setwd(.cmdargs[4])
-## remove the copied .Rnw if it did not exist, otherwise move the original one 
back
-if (.rnw.exists) file.rename(.tmp.file, .rnw.file) else unlink(.rnw.file)
-file.rename(basename(.cmdargs[2]), .cmdargs[2])  # move .tex to the temp dir
-rm(.tmp.file, .rnw.file, .rnw.exists)  # clean up these variables
-
+knit(.cmdargs[1], output = .cmdargs[2], tangle = 'tangle' %in% .cmdargs)


knitr.module
Description: Binary data


lyxknitr.R
Description: Binary data


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
I think this indicated the problem in your log:

12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'

But without a reproducible example, I'm afraid I cannot do anything,
especially I do not have Mac OS to test with.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 10:52 AM, Michael Bach pha...@gmail.com wrote:
 Just a quick follow-up.

 I gather from the log that R reads the file as UTF-8. I checked my System

 $ locale

 and the R

 Sys.getlocale()

 Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...



Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:34 PM, Yihui Xie x...@yihui.name wrote:
 I think this indicated the problem in your log:

 12:13:14.670: Warning in readLines(input, warn = FALSE) :
 12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'

 But without a reproducible example, I'm afraid I cannot do anything,
 especially I do not have Mac OS to test with.

I misunderstood. In his original email he stated that he is using Windows 7.
Sorry for the confusion.

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
He sent me the message log without cc'ing the list, and I saw

12:13:14.353: Rscript --verbose --no-save --no-restore
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
UTF-8 /Users/XYZ/Documents/...

I think that is Mac OS, although in the first email it was Windows 7.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 4:39 PM, Scott Kostyshak skost...@lyx.org wrote:

 I misunderstood. In his original email he stated that he is using Windows 7.
 Sorry for the confusion.

 Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:43 PM, Yihui Xie x...@yihui.name wrote:
 He sent me the message log without cc'ing the list, and I saw

 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
 UTF-8 /Users/XYZ/Documents/...

 I think that is Mac OS, although in the first email it was Windows 7.

Ah, yes I think I thought the same thing when I saw that. Glad I'm not
the only one that was confused.

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

On 9/26/12 6:25 PM, Yihui Xie wrote:

The first place to look at is View--View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf



Very good to know, thanks. I enabled that and tried again. It seems that 
there is an invalid input found by R(?). Please see also the complete 
log at the end of this post.


I investigated the .tex file and found it was cut off in the middle of 
the abstract environment. I then opened an R session in the temp 
directory and ran knit(skryptum.Rnw) which produces a skryptum.tex 
file that can be tex'ed correctly and contains the \Sepr{} parts. Also, 
the .Rnw file is complete, i.e. not cut off like the .tex file.


So I guess the Rscript call messes things up? I tried the hint by Scott 
on setting an error hook, but to no avail. How to debug further?


--
12:13:14.051: Previewing ...
12:13:14.085: (buffer-view: ⌘R)
12:13:14.353: Rscript --verbose --no-save --no-restore 
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8 /Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/

12:13:14.373: running
12:13:14.381: 
'/Library/Frameworks/R.framework/Versions/2.15/Resources/bin/R --slave 
--no-restore --no-save --no-restore 
--file=/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
--args /var/folders/yx/
12:13:14.383: 
tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8'

12:13:14.384:

Running: Rscript --verbose --no-save --no-restore 
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8 /Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/

12:13:14.663: [1] TRUE
12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'
12:13:14.925:
12:13:14.925:
12:13:14.927: processing file: skryptum.Rnw
12:13:14.942:
  |
  | |   0%
  |
12:13:14.943:
  || 100%
12:13:14.944:   ordinary text without R code
12:13:14.944:
12:13:14.947:
12:13:14.948: output file: /Users/.../Documents/Vorlesung/Theorie der 
Simulationstechnik/src/skryptum.tex

12:13:14.949:
12:13:14.949: [1] skryptum.tex
12:13:14.951: [1] TRUE
12:13:14.965: pdflatex  skryptum.tex
Running: pdflatex  skryptum.tex  /dev/null
12:13:15.211: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:15.212:  restricted \write18 enabled.
12:13:15.227: entering extended mode
12:13:15.229: (./skryptum.tex
12:13:15.230: LaTeX2e 2011/06/27
12:13:15.230: Babel v3.8m and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:15.231: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:15.232: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:15.232: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 
ethiopic, farsi, finnis
12:13:15.233: h, french, friulan, galician, german, ngerman, 
swissgerman, monogreek, greek, h
12:13:15.233: ungarian, icelandic, assamese, bengali, gujarati, hindi, 
kannada, malayalam, ma
12:13:15.234: rathi, oriya, panjabi, tamil, telugu, indonesian, 
interlingua, irish, italian,
12:13:15.234: kurmanji, latin, latvian, lithuanian, mongolian, 
mongolianlmc, bokmal, nynorsk,
12:13:15.235:  polish, portuguese, romanian, romansh, russian, sanskrit, 
serbian, serbianc, s
12:13:15.236: lovak, slovenian, spanish, swedish, turkish, turkmen, 
ukrainian, uppersorbian,

12:13:15.236: welsh, loaded.
12:13:15.237:
12:13:16.309: pdflatex  skryptum.tex
12:13:16.503: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:16.504:  restricted \write18 enabled.
/Users/Shared/LyX/lyx-2.0.4/src/support/Systemcall.cpp(273): Systemcall: 
'pdflatex  skryptum.tex' finished with exit code 1


Running: pdflatex  skryptum.tex  /dev/null
12:13:16.520: entering extended mode
12:13:16.521: (./skryptum.tex
12:13:16.521: LaTeX2e 2011/06/27
12:13:16.522: Babel v3.8m and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:16.523: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:16.523: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:16.523: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 
ethiopic, farsi, finnis
12:13:16.524: h, french, friulan, galician, german, ngerman, 
swissgerman, 

Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

Just a quick follow-up.

I gather from the log that R reads the file as UTF-8. I checked my System

$ locale

and the R

 Sys.getlocale()

Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...



Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
Does the knitr example file work? I forget how to get to example files on MacOS.

Mabye Yihui will have an idea of what's going on, but in the meantime
if you want to try something, you can try with the newest version of
LyX's knitr module that Yihui sent in a couple of days ago. To do
this, you can either

(1) apply the attached diff. It should succeed on 2.0.4 with a hunk offset.

or

(2) copy the other two files attached, to the correct places.

Don't forget to back up the original files.

Scott

On Sat, Sep 29, 2012 at 11:52 AM, Michael Bach pha...@gmail.com wrote:
 Just a quick follow-up.

 I gather from the log that R reads the file as UTF-8. I checked my System

 $ locale

 and the R

 Sys.getlocale()

 Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...

diff --git a/lib/examples/knitr.lyx b/lib/examples/knitr.lyx
index ddbfe01..feab161 100644
--- a/lib/examples/knitr.lyx
+++ b/lib/examples/knitr.lyx
@@ -182,7 +182,7 @@ status collapsed
 
 \begin_layout Plain Layout
 
-http://yihui.github.com/knitr
+http://yihui.name/knitr
 \end_layout
 
 \end_inset
diff --git a/lib/layouts/knitr.module b/lib/layouts/knitr.module
index 694ae77..fe64359 100644
--- a/lib/layouts/knitr.module
+++ b/lib/layouts/knitr.module
@@ -1,7 +1,7 @@
 #\DeclareLyXModule[knitr-latex]{Rnw (knitr)}
 #DescriptionBegin
 #Uses the knitr package in R for dynamic report generation. This R package has 
to be installed for this module to work: install.packages('knitr'). Note it 
depends on R = 2.14.1.
-#For more info see http://yihui.github.com/knitr
+#For more info see http://yihui.name/knitr
 #DescriptionEnd
 #Category: literate
 #Excludes: lilypond | sweave
diff --git a/lib/scripts/lyxknitr.R b/lib/scripts/lyxknitr.R
index 03150f2..7c029ea 100644
--- a/lib/scripts/lyxknitr.R
+++ b/lib/scripts/lyxknitr.R
@@ -11,7 +11,7 @@
 ## author Yihui Xie
 
 ## knitr is an alternative package to Sweave, and has more features
-## and flexibility; see https://yihui.github.com/knitr
+## and flexibility; see https://yihui.name/knitr
 
 ## Rscript $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r
 ## $$p the path of the output (temp dir)
@@ -31,18 +31,7 @@ options(encoding = .cmdargs[3])
 ## can put your data files there and functions like read.table() can
 ## work correctly without specifying the full path
 setwd(.cmdargs[4])
+opts_knit$set(root.dir = getwd())
 
-## copy the Rnw file to the current working directory if it does not exist
-.tmp.file = tempfile(); .rnw.file = basename(.cmdargs[1])
-.rnw.exists = file.exists(.rnw.file)
-if (.rnw.exists) file.rename(.rnw.file, .tmp.file)
-file.copy(.cmdargs[1], '.')
 ## run knit() to get .tex or .R
-knit(.rnw.file, tangle = 'tangle' %in% .cmdargs)
-
-setwd(.cmdargs[4])
-## remove the copied .Rnw if it did not exist, otherwise move the original one 
back
-if (.rnw.exists) file.rename(.tmp.file, .rnw.file) else unlink(.rnw.file)
-file.rename(basename(.cmdargs[2]), .cmdargs[2])  # move .tex to the temp dir
-rm(.tmp.file, .rnw.file, .rnw.exists)  # clean up these variables
-
+knit(.cmdargs[1], output = .cmdargs[2], tangle = 'tangle' %in% .cmdargs)


knitr.module
Description: Binary data


lyxknitr.R
Description: Binary data


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
I think this indicated the problem in your log:

12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'

But without a reproducible example, I'm afraid I cannot do anything,
especially I do not have Mac OS to test with.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 10:52 AM, Michael Bach pha...@gmail.com wrote:
 Just a quick follow-up.

 I gather from the log that R reads the file as UTF-8. I checked my System

 $ locale

 and the R

 Sys.getlocale()

 Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...



Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:34 PM, Yihui Xie x...@yihui.name wrote:
 I think this indicated the problem in your log:

 12:13:14.670: Warning in readLines(input, warn = FALSE) :
 12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'

 But without a reproducible example, I'm afraid I cannot do anything,
 especially I do not have Mac OS to test with.

I misunderstood. In his original email he stated that he is using Windows 7.
Sorry for the confusion.

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
He sent me the message log without cc'ing the list, and I saw

12:13:14.353: Rscript --verbose --no-save --no-restore
/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
UTF-8 /Users/XYZ/Documents/...

I think that is Mac OS, although in the first email it was Windows 7.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 4:39 PM, Scott Kostyshak skost...@lyx.org wrote:

 I misunderstood. In his original email he stated that he is using Windows 7.
 Sorry for the confusion.

 Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:43 PM, Yihui Xie x...@yihui.name wrote:
 He sent me the message log without cc'ing the list, and I saw

 12:13:14.353: Rscript --verbose --no-save --no-restore
 /Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R
 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw
 /var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/tex
 UTF-8 /Users/XYZ/Documents/...

 I think that is Mac OS, although in the first email it was Windows 7.

Ah, yes I think I thought the same thing when I saw that. Glad I'm not
the only one that was confused.

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

On 9/26/12 6:25 PM, Yihui Xie wrote:

The first place to look at is View-->View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf



Very good to know, thanks. I enabled that and tried again. It seems that 
there is an invalid input found by R(?). Please see also the complete 
log at the end of this post.


I investigated the .tex file and found it was cut off in the middle of 
the abstract environment. I then opened an R session in the temp 
directory and ran knit("skryptum.Rnw") which produces a skryptum.tex 
file that can be tex'ed correctly and contains the \Sepr{} parts. Also, 
the .Rnw file is complete, i.e. not cut off like the .tex file.


So I guess the Rscript call messes things up? I tried the hint by Scott 
on setting an error hook, but to no avail. How to debug further?


--
12:13:14.051: Previewing ...
12:13:14.085: (buffer-view: ⌘R)
12:13:14.353: Rscript --verbose --no-save --no-restore 
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.tex" 
UTF-8 "/Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/"

12:13:14.373: running
12:13:14.381: 
'/Library/Frameworks/R.framework/Versions/2.15/Resources/bin/R --slave 
--no-restore --no-save --no-restore 
--file=/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R 
--args /var/folders/yx/
12:13:14.383: 
tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.Rnw 
/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/skryptum.tex 
UTF-8'

12:13:14.384:

Running: Rscript --verbose --no-save --no-restore 
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R" 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw" 
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.tex" 
UTF-8 "/Users/XYZ/Documents/Vorlesung/Theorie der Simulationstechnik/src/"

12:13:14.663: [1] TRUE
12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'
12:13:14.925:
12:13:14.925:
12:13:14.927: processing file: skryptum.Rnw
12:13:14.942:
  |
  | |   0%
  |
12:13:14.943:
  |>| 100%
12:13:14.944:   ordinary text without R code
12:13:14.944:
12:13:14.947:
12:13:14.948: output file: /Users/.../Documents/Vorlesung/Theorie der 
Simulationstechnik/src/skryptum.tex

12:13:14.949:
12:13:14.949: [1] "skryptum.tex"
12:13:14.951: [1] TRUE
12:13:14.965: pdflatex  "skryptum.tex"
Running: pdflatex  "skryptum.tex" > /dev/null
12:13:15.211: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:15.212:  restricted \write18 enabled.
12:13:15.227: entering extended mode
12:13:15.229: (./skryptum.tex
12:13:15.230: LaTeX2e <2011/06/27>
12:13:15.230: Babel  and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:15.231: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:15.232: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:15.232: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 
ethiopic, farsi, finnis
12:13:15.233: h, french, friulan, galician, german, ngerman, 
swissgerman, monogreek, greek, h
12:13:15.233: ungarian, icelandic, assamese, bengali, gujarati, hindi, 
kannada, malayalam, ma
12:13:15.234: rathi, oriya, panjabi, tamil, telugu, indonesian, 
interlingua, irish, italian,
12:13:15.234: kurmanji, latin, latvian, lithuanian, mongolian, 
mongolianlmc, bokmal, nynorsk,
12:13:15.235:  polish, portuguese, romanian, romansh, russian, sanskrit, 
serbian, serbianc, s
12:13:15.236: lovak, slovenian, spanish, swedish, turkish, turkmen, 
ukrainian, uppersorbian,

12:13:15.236: welsh, loaded.
12:13:15.237:
12:13:16.309: pdflatex  "skryptum.tex"
12:13:16.503: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
12:13:16.504:  restricted \write18 enabled.
/Users/Shared/LyX/lyx-2.0.4/src/support/Systemcall.cpp(273): Systemcall: 
'pdflatex  "skryptum.tex"' finished with exit code 1


Running: pdflatex  "skryptum.tex" > /dev/null
12:13:16.520: entering extended mode
12:13:16.521: (./skryptum.tex
12:13:16.521: LaTeX2e <2011/06/27>
12:13:16.522: Babel  and hyphenation patterns for english, 
dumylang, nohyphenation, ge
12:13:16.523: rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, 
ancientgreek, ibycus, arabi
12:13:16.523: c, armenian, basque, bulgarian, catalan, pinyin, coptic, 
croatian, czech, danis
12:13:16.523: h, dutch, ukenglish, usenglishmax, esperanto, estonian, 

Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Michael Bach

Just a quick follow-up.

I gather from the log that R reads the file as UTF-8. I checked my System

$ locale

and the R

> Sys.getlocale()

Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...



Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
Does the knitr example file work? I forget how to get to example files on MacOS.

Mabye Yihui will have an idea of what's going on, but in the meantime
if you want to try something, you can try with the newest version of
LyX's knitr module that Yihui sent in a couple of days ago. To do
this, you can either

(1) apply the attached diff. It should succeed on 2.0.4 with a hunk offset.

or

(2) copy the other two files attached, to the correct places.

Don't forget to back up the original files.

Scott

On Sat, Sep 29, 2012 at 11:52 AM, Michael Bach  wrote:
> Just a quick follow-up.
>
> I gather from the log that R reads the file as UTF-8. I checked my System
>
> $ locale
>
> and the R
>
>> Sys.getlocale()
>
> Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...
>
diff --git a/lib/examples/knitr.lyx b/lib/examples/knitr.lyx
index ddbfe01..feab161 100644
--- a/lib/examples/knitr.lyx
+++ b/lib/examples/knitr.lyx
@@ -182,7 +182,7 @@ status collapsed
 
 \begin_layout Plain Layout
 
-http://yihui.github.com/knitr
+http://yihui.name/knitr
 \end_layout
 
 \end_inset
diff --git a/lib/layouts/knitr.module b/lib/layouts/knitr.module
index 694ae77..fe64359 100644
--- a/lib/layouts/knitr.module
+++ b/lib/layouts/knitr.module
@@ -1,7 +1,7 @@
 #\DeclareLyXModule[knitr->latex]{Rnw (knitr)}
 #DescriptionBegin
 #Uses the knitr package in R for dynamic report generation. This R package has 
to be installed for this module to work: install.packages('knitr'). Note it 
depends on R >= 2.14.1.
-#For more info see http://yihui.github.com/knitr
+#For more info see http://yihui.name/knitr
 #DescriptionEnd
 #Category: literate
 #Excludes: lilypond | sweave
diff --git a/lib/scripts/lyxknitr.R b/lib/scripts/lyxknitr.R
index 03150f2..7c029ea 100644
--- a/lib/scripts/lyxknitr.R
+++ b/lib/scripts/lyxknitr.R
@@ -11,7 +11,7 @@
 ## author Yihui Xie
 
 ## knitr is an alternative package to Sweave, and has more features
-## and flexibility; see https://yihui.github.com/knitr
+## and flexibility; see https://yihui.name/knitr
 
 ## Rscript $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r
 ## $$p the path of the output (temp dir)
@@ -31,18 +31,7 @@ options(encoding = .cmdargs[3])
 ## can put your data files there and functions like read.table() can
 ## work correctly without specifying the full path
 setwd(.cmdargs[4])
+opts_knit$set(root.dir = getwd())
 
-## copy the Rnw file to the current working directory if it does not exist
-.tmp.file = tempfile(); .rnw.file = basename(.cmdargs[1])
-.rnw.exists = file.exists(.rnw.file)
-if (.rnw.exists) file.rename(.rnw.file, .tmp.file)
-file.copy(.cmdargs[1], '.')
 ## run knit() to get .tex or .R
-knit(.rnw.file, tangle = 'tangle' %in% .cmdargs)
-
-setwd(.cmdargs[4])
-## remove the copied .Rnw if it did not exist, otherwise move the original one 
back
-if (.rnw.exists) file.rename(.tmp.file, .rnw.file) else unlink(.rnw.file)
-file.rename(basename(.cmdargs[2]), .cmdargs[2])  # move .tex to the temp dir
-rm(.tmp.file, .rnw.file, .rnw.exists)  # clean up these variables
-
+knit(.cmdargs[1], output = .cmdargs[2], tangle = 'tangle' %in% .cmdargs)


knitr.module
Description: Binary data


lyxknitr.R
Description: Binary data


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
I think this indicated the problem in your log:

12:13:14.670: Warning in readLines(input, warn = FALSE) :
12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'

But without a reproducible example, I'm afraid I cannot do anything,
especially I do not have Mac OS to test with.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 10:52 AM, Michael Bach  wrote:
> Just a quick follow-up.
>
> I gather from the log that R reads the file as UTF-8. I checked my System
>
> $ locale
>
> and the R
>
>> Sys.getlocale()
>
> Both are correctly set up as en_US.UTF-8. Just to rule that one out(?)...
>


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:34 PM, Yihui Xie  wrote:
> I think this indicated the problem in your log:
>
> 12:13:14.670: Warning in readLines(input, warn = FALSE) :
> 12:13:14.673:   invalid input found on input connection 'skryptum.Rnw'
>
> But without a reproducible example, I'm afraid I cannot do anything,
> especially I do not have Mac OS to test with.

I misunderstood. In his original email he stated that he is using Windows 7.
Sorry for the confusion.

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Yihui Xie
He sent me the message log without cc'ing the list, and I saw

12:13:14.353: Rscript --verbose --no-save --no-restore
"/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw"
"/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex"
UTF-8 "/Users/XYZ/Documents/..."

I think that is Mac OS, although in the first email it was Windows 7.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Sat, Sep 29, 2012 at 4:39 PM, Scott Kostyshak  wrote:
>
> I misunderstood. In his original email he stated that he is using Windows 7.
> Sorry for the confusion.
>
> Scott


Re: Knitr (Rnw) Rscript error log

2012-09-29 Thread Scott Kostyshak
On Sat, Sep 29, 2012 at 5:43 PM, Yihui Xie  wrote:
> He sent me the message log without cc'ing the list, and I saw
>
> 12:13:14.353: Rscript --verbose --no-save --no-restore
> "/Applications/LyX.app/Contents/Resources/scripts/lyxknitr.R"
> "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""skryptum.Rnw"
> "/var/folders/yx/tvnzczfx7c31c68jrddvlqgrgn/T/lyx_tmpdir.xJL523/lyx_tmpbuf3/""tex"
> UTF-8 "/Users/XYZ/Documents/..."
>
> I think that is Mac OS, although in the first email it was Windows 7.

Ah, yes I think I thought the same thing when I saw that. Glad I'm not
the only one that was confused.

Scott


Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Dear LyX Developers and Users,

I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
compiled the knitr-minimal.lyx example file and moved on to the
knitr-manual.lyx. I then get an error message that Rscript failed.

Can someone give me a hint on how to get a debug log of a failed Rscript call to
investigate? I am pretty sure my R environment is not set up correctly...

Best Regards,
Michael





Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 5:54 AM, Michael Bach pha...@gmail.com wrote:
 Dear LyX Developers and Users,

 I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
 compiled the knitr-minimal.lyx example file and moved on to the
 knitr-manual.lyx. I then get an error message that Rscript failed.

 Can someone give me a hint on how to get a debug log of a failed Rscript call 
 to
 investigate? I am pretty sure my R environment is not set up correctly...

Look in the terminal output. It might give you the error.

You could alternatively do File  Export  R/S code and then run/debug
the resulting file in R.

Also note that since version 0.7 :

  - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
  errors) along with the corresponding R code will be printed after `knit()`
  is done; this might help users figure out possible problems in R code
  quickly (#276)

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Hi Scott,

Thanks for responses.

 Look in the terminal output. It might give you the error.
 

I cannot find a terminal output view in LyX - checked all toolbars and View 
menu.

 You could alternatively do File  Export  R/S code and then run/debug
 the resulting file in R.
 

I tried this and after checking each line interactively in the R console and
commenting out some things in LyX files, e.g. packages that are not available in
R2.15.1, it runs through, but the LyX called Rscript does not.

 Also note that since version 0.7 :
 
   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
   errors) along with the corresponding R code will be printed after `knit()`
   is done; this might help users figure out possible problems in R code
   quickly (#276)
 

This is a good hint, I set it with:
opts_knit$set(verbose = TRUE)

inside the first code chunk, but I assume this prints to the R console if knit()
is called interactively, doesn't it? Anyway, I do not get any feedback on where
the error comes from

Michael






Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Yihui Xie
The first place to look at is View--View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Sep 26, 2012 at 10:16 AM, Michael Bach pha...@gmail.com wrote:
 Hi Scott,

 Thanks for responses.

 Look in the terminal output. It might give you the error.


 I cannot find a terminal output view in LyX - checked all toolbars and View 
 menu.

 You could alternatively do File  Export  R/S code and then run/debug
 the resulting file in R.


 I tried this and after checking each line interactively in the R console and
 commenting out some things in LyX files, e.g. packages that are not available 
 in
 R2.15.1, it runs through, but the LyX called Rscript does not.

 Also note that since version 0.7 :

   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
   errors) along with the corresponding R code will be printed after `knit()`
   is done; this might help users figure out possible problems in R code
   quickly (#276)


 This is a good hint, I set it with:
 opts_knit$set(verbose = TRUE)

 inside the first code chunk, but I assume this prints to the R console if 
 knit()
 is called interactively, doesn't it? Anyway, I do not get any feedback on 
 where
 the error comes from

 Michael






Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 12:25 PM, Yihui Xie x...@yihui.name wrote:
 The first place to look at is View--View Messages, as described in
 the troubleshooting section in Sweave manual (which applies to knitr
 as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Michael,

You might also be interested in setting an error hook (a command that
is run when an error occurs). Otherwise if your document exports fine
you might not realize that there could be an error (knitr will print
the error message to your latex document but it will appear to compile
just fine). For example,

knit_hooks$set(error = function(x, options) stop(x))

Scott


Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Dear LyX Developers and Users,

I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
compiled the knitr-minimal.lyx example file and moved on to the
knitr-manual.lyx. I then get an error message that Rscript failed.

Can someone give me a hint on how to get a debug log of a failed Rscript call to
investigate? I am pretty sure my R environment is not set up correctly...

Best Regards,
Michael





Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 5:54 AM, Michael Bach pha...@gmail.com wrote:
 Dear LyX Developers and Users,

 I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
 compiled the knitr-minimal.lyx example file and moved on to the
 knitr-manual.lyx. I then get an error message that Rscript failed.

 Can someone give me a hint on how to get a debug log of a failed Rscript call 
 to
 investigate? I am pretty sure my R environment is not set up correctly...

Look in the terminal output. It might give you the error.

You could alternatively do File  Export  R/S code and then run/debug
the resulting file in R.

Also note that since version 0.7 :

  - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
  errors) along with the corresponding R code will be printed after `knit()`
  is done; this might help users figure out possible problems in R code
  quickly (#276)

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Hi Scott,

Thanks for responses.

 Look in the terminal output. It might give you the error.
 

I cannot find a terminal output view in LyX - checked all toolbars and View 
menu.

 You could alternatively do File  Export  R/S code and then run/debug
 the resulting file in R.
 

I tried this and after checking each line interactively in the R console and
commenting out some things in LyX files, e.g. packages that are not available in
R2.15.1, it runs through, but the LyX called Rscript does not.

 Also note that since version 0.7 :
 
   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
   errors) along with the corresponding R code will be printed after `knit()`
   is done; this might help users figure out possible problems in R code
   quickly (#276)
 

This is a good hint, I set it with:
opts_knit$set(verbose = TRUE)

inside the first code chunk, but I assume this prints to the R console if knit()
is called interactively, doesn't it? Anyway, I do not get any feedback on where
the error comes from

Michael






Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Yihui Xie
The first place to look at is View--View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Sep 26, 2012 at 10:16 AM, Michael Bach pha...@gmail.com wrote:
 Hi Scott,

 Thanks for responses.

 Look in the terminal output. It might give you the error.


 I cannot find a terminal output view in LyX - checked all toolbars and View 
 menu.

 You could alternatively do File  Export  R/S code and then run/debug
 the resulting file in R.


 I tried this and after checking each line interactively in the R console and
 commenting out some things in LyX files, e.g. packages that are not available 
 in
 R2.15.1, it runs through, but the LyX called Rscript does not.

 Also note that since version 0.7 :

   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
   errors) along with the corresponding R code will be printed after `knit()`
   is done; this might help users figure out possible problems in R code
   quickly (#276)


 This is a good hint, I set it with:
 opts_knit$set(verbose = TRUE)

 inside the first code chunk, but I assume this prints to the R console if 
 knit()
 is called interactively, doesn't it? Anyway, I do not get any feedback on 
 where
 the error comes from

 Michael






Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 12:25 PM, Yihui Xie x...@yihui.name wrote:
 The first place to look at is View--View Messages, as described in
 the troubleshooting section in Sweave manual (which applies to knitr
 as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Michael,

You might also be interested in setting an error hook (a command that
is run when an error occurs). Otherwise if your document exports fine
you might not realize that there could be an error (knitr will print
the error message to your latex document but it will appear to compile
just fine). For example,

knit_hooks$set(error = function(x, options) stop(x))

Scott


Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Dear LyX Developers and Users,

I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
compiled the knitr-minimal.lyx example file and moved on to the
knitr-manual.lyx. I then get an error message that Rscript failed.

Can someone give me a hint on how to get a debug log of a failed Rscript call to
investigate? I am pretty sure my R environment is not set up correctly...

Best Regards,
Michael





Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 5:54 AM, Michael Bach  wrote:
> Dear LyX Developers and Users,
>
> I am using LyX 2.0.4 on Windows 7 with the knitr (Rnw) module. I successfully
> compiled the knitr-minimal.lyx example file and moved on to the
> knitr-manual.lyx. I then get an error message that Rscript failed.
>
> Can someone give me a hint on how to get a debug log of a failed Rscript call 
> to
> investigate? I am pretty sure my R environment is not set up correctly...

Look in the terminal output. It might give you the error.

You could alternatively do File > Export > R/S code and then run/debug
the resulting file in R.

Also note that since version 0.7 :

  - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
  errors) along with the corresponding R code will be printed after `knit()`
  is done; this might help users figure out possible problems in R code
  quickly (#276)

Scott


Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Michael Bach
Hi Scott,

Thanks for responses.

> Look in the terminal output. It might give you the error.
> 

I cannot find a terminal output view in LyX - checked all toolbars and View 
menu.

> You could alternatively do File > Export > R/S code and then run/debug
> the resulting file in R.
> 

I tried this and after checking each line interactively in the R console and
commenting out some things in LyX files, e.g. packages that are not available in
R2.15.1, it runs through, but the LyX called Rscript does not.

> Also note that since version 0.7 :
> 
>   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
>   errors) along with the corresponding R code will be printed after `knit()`
>   is done; this might help users figure out possible problems in R code
>   quickly (#276)
> 

This is a good hint, I set it with:
opts_knit$set(verbose = TRUE)

inside the first code chunk, but I assume this prints to the R console if knit()
is called interactively, doesn't it? Anyway, I do not get any feedback on where
the error comes from

Michael






Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Yihui Xie
The first place to look at is View-->View Messages, as described in
the troubleshooting section in Sweave manual (which applies to knitr
as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA


On Wed, Sep 26, 2012 at 10:16 AM, Michael Bach  wrote:
> Hi Scott,
>
> Thanks for responses.
>
>> Look in the terminal output. It might give you the error.
>>
>
> I cannot find a terminal output view in LyX - checked all toolbars and View 
> menu.
>
>> You could alternatively do File > Export > R/S code and then run/debug
>> the resulting file in R.
>>
>
> I tried this and after checking each line interactively in the R console and
> commenting out some things in LyX files, e.g. packages that are not available 
> in
> R2.15.1, it runs through, but the LyX called Rscript does not.
>
>> Also note that since version 0.7 :
>>
>>   - when `opts_knit$get('verbose')` is TRUE, logs (messages, warnings and
>>   errors) along with the corresponding R code will be printed after `knit()`
>>   is done; this might help users figure out possible problems in R code
>>   quickly (#276)
>>
>
> This is a good hint, I set it with:
> opts_knit$set(verbose = TRUE)
>
> inside the first code chunk, but I assume this prints to the R console if 
> knit()
> is called interactively, doesn't it? Anyway, I do not get any feedback on 
> where
> the error comes from
>
> Michael
>
>
>
>


Re: Knitr (Rnw) Rscript error log

2012-09-26 Thread Scott Kostyshak
On Wed, Sep 26, 2012 at 12:25 PM, Yihui Xie  wrote:
> The first place to look at is View-->View Messages, as described in
> the troubleshooting section in Sweave manual (which applies to knitr
> as well): https://github.com/downloads/yihui/lyx/sweave.pdf

Michael,

You might also be interested in setting an error hook (a command that
is run when an error occurs). Otherwise if your document exports fine
you might not realize that there could be an error (knitr will print
the error message to your latex document but it will appear to compile
just fine). For example,

knit_hooks$set(error = function(x, options) stop(x))

Scott