RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:04 PM

I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
scott@wws-1j1dnk1:~$ pdflatex --version
pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
kpathsea version 6.0.1

Does this happen to packageVersion() only?

Also with packageDescription(). But I've compiled many knitr documents that 
have used many packages and functions and this is the first time that I have 
this problem. If I wrap packageVersion as follows then it works fine:
as.character(packageVersion('knitr'))

Can you send me the .tex file that is produced when you export the .lyx file I 
sent to latex (pdflatex)? If they are the same and it works for you then the 
problem must be my pdflatex. If they are different then the problem is 
something else.

Thanks,

Scott

Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

Does this happen to packageVersion() only?

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, Jun 2, 2012 at 7:27 PM, Scott Kostyshak skost...@princeton.edu wrote:
 LyX gives me an error when I have the R command `packageVersion` in a knitr
 chunk. Attached is a mwe .lyx that gives an error for me. I get this error
 on current trunk and on 2.0.3 when exporting or viewing as pdf (pdflatex).
 Exporting to latex (pdflatex) and then running pdflatex manually produces
 the pdf as expected but exits with error code 1 (even though no indication
 of a problem is given in the terminal which I find to be strange).

 I'm pasted the relevant part of the error from the log below and attached
 are the .lyx file, the .tex file that is produced when exported to latex
 (pdflatex) and the .log file.

 LaTeX Font Info:    Font shape `T1/cmtt/bx/n' in size 10 not available
 (Font)  Font shape `T1/cmtt/m/n' tried instead on input line
 400.
 ! Undefined control sequence.
 argument ^^M## [1] '
   0.5'^^M
 l.405 \end{verbatim}

 The control sequence at the end of the top line
 of your error message was never \def'ed. If you have
 misspelled it (e.g., `\hobx'), type `I' and the correct
 spelling (e.g., `I\hbox'). Otherwise just continue,
 and I'll forget about whatever was undefined.

 ! Undefined control sequence.
 argument ^^M## [1] '0.5'
   ^^M
 l.405 \end{verbatim}

 Any ideas?

 Thanks,

 Scott


Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I believe this is because R uses sQuote() to print package versions
which introduces curly quotes (non-ASCII characters).

 packageVersion('knitr')
[1] ‘0.5’

Unfortunately sQuote() was hard-coded in the printing function, so
there is no direct way to get rid of the two curly quotes, and you
have to use as.character(), or packageDescription('knitr',
fields='Version')

 getAnywhere(print.numeric_version)
A single object matching ‘print.numeric_version’ was found
It was found in the following places
  package:base
  registered S3 method for print from namespace base
  namespace:base
with value

function (x, ...)
{
y - as.character(x)
if (!length(y))
writeLines(gettext(0 elements))
else print(noquote(ifelse(is.na(y), NA_character_, sQuote(y))),
...)
invisible(x)
}
bytecode: 0x1a26bf8
environment: namespace:base


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, Jun 2, 2012 at 8:32 PM, Scott Kostyshak skost...@princeton.edu wrote:
 From: Yihui Xie [xieyi...@gmail.com]
 Sent: Saturday, June 02, 2012 8:04 PM

I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

 I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
 scott@wws-1j1dnk1:~$ pdflatex --version
 pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
 kpathsea version 6.0.1

Does this happen to packageVersion() only?

 Also with packageDescription(). But I've compiled many knitr documents that 
 have used many packages and functions and this is the first time that I have 
 this problem. If I wrap packageVersion as follows then it works fine:
 as.character(packageVersion('knitr'))

 Can you send me the .tex file that is produced when you export the .lyx file 
 I sent to latex (pdflatex)? If they are the same and it works for you then 
 the problem must be my pdflatex. If they are different then the problem is 
 something else.

 Thanks,

 Scott


RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:39 PM

I believe this is because R uses sQuote() to print package versions
which introduces curly quotes (non-ASCII characters).

Unfortunately sQuote() was hard-coded in the printing function, so
there is no direct way to get rid of the two curly quotes, and you
have to use as.character(), or packageDescription('knitr',
fields='Version')

Ah, that makes sense. Well thanks for investigating this for me. I feel more 
comfortable at least knowing what's going on.

Scott

RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:04 PM

I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
scott@wws-1j1dnk1:~$ pdflatex --version
pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
kpathsea version 6.0.1

Does this happen to packageVersion() only?

Also with packageDescription(). But I've compiled many knitr documents that 
have used many packages and functions and this is the first time that I have 
this problem. If I wrap packageVersion as follows then it works fine:
as.character(packageVersion('knitr'))

Can you send me the .tex file that is produced when you export the .lyx file I 
sent to latex (pdflatex)? If they are the same and it works for you then the 
problem must be my pdflatex. If they are different then the problem is 
something else.

Thanks,

Scott

Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

Does this happen to packageVersion() only?

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, Jun 2, 2012 at 7:27 PM, Scott Kostyshak skost...@princeton.edu wrote:
 LyX gives me an error when I have the R command `packageVersion` in a knitr
 chunk. Attached is a mwe .lyx that gives an error for me. I get this error
 on current trunk and on 2.0.3 when exporting or viewing as pdf (pdflatex).
 Exporting to latex (pdflatex) and then running pdflatex manually produces
 the pdf as expected but exits with error code 1 (even though no indication
 of a problem is given in the terminal which I find to be strange).

 I'm pasted the relevant part of the error from the log below and attached
 are the .lyx file, the .tex file that is produced when exported to latex
 (pdflatex) and the .log file.

 LaTeX Font Info:    Font shape `T1/cmtt/bx/n' in size 10 not available
 (Font)  Font shape `T1/cmtt/m/n' tried instead on input line
 400.
 ! Undefined control sequence.
 argument ^^M## [1] '
   0.5'^^M
 l.405 \end{verbatim}

 The control sequence at the end of the top line
 of your error message was never \def'ed. If you have
 misspelled it (e.g., `\hobx'), type `I' and the correct
 spelling (e.g., `I\hbox'). Otherwise just continue,
 and I'll forget about whatever was undefined.

 ! Undefined control sequence.
 argument ^^M## [1] '0.5'
   ^^M
 l.405 \end{verbatim}

 Any ideas?

 Thanks,

 Scott


Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I believe this is because R uses sQuote() to print package versions
which introduces curly quotes (non-ASCII characters).

 packageVersion('knitr')
[1] ‘0.5’

Unfortunately sQuote() was hard-coded in the printing function, so
there is no direct way to get rid of the two curly quotes, and you
have to use as.character(), or packageDescription('knitr',
fields='Version')

 getAnywhere(print.numeric_version)
A single object matching ‘print.numeric_version’ was found
It was found in the following places
  package:base
  registered S3 method for print from namespace base
  namespace:base
with value

function (x, ...)
{
y - as.character(x)
if (!length(y))
writeLines(gettext(0 elements))
else print(noquote(ifelse(is.na(y), NA_character_, sQuote(y))),
...)
invisible(x)
}
bytecode: 0x1a26bf8
environment: namespace:base


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, Jun 2, 2012 at 8:32 PM, Scott Kostyshak skost...@princeton.edu wrote:
 From: Yihui Xie [xieyi...@gmail.com]
 Sent: Saturday, June 02, 2012 8:04 PM

I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

 I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
 scott@wws-1j1dnk1:~$ pdflatex --version
 pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
 kpathsea version 6.0.1

Does this happen to packageVersion() only?

 Also with packageDescription(). But I've compiled many knitr documents that 
 have used many packages and functions and this is the first time that I have 
 this problem. If I wrap packageVersion as follows then it works fine:
 as.character(packageVersion('knitr'))

 Can you send me the .tex file that is produced when you export the .lyx file 
 I sent to latex (pdflatex)? If they are the same and it works for you then 
 the problem must be my pdflatex. If they are different then the problem is 
 something else.

 Thanks,

 Scott


RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:39 PM

I believe this is because R uses sQuote() to print package versions
which introduces curly quotes (non-ASCII characters).

Unfortunately sQuote() was hard-coded in the printing function, so
there is no direct way to get rid of the two curly quotes, and you
have to use as.character(), or packageDescription('knitr',
fields='Version')

Ah, that makes sense. Well thanks for investigating this for me. I feel more 
comfortable at least knowing what's going on.

Scott

RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:04 PM

>I cannot reproduce the problem. It compiles successfully with TeXLive
>2011 under Ubuntu. Can anyone else reproduce it?

I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
scott@wws-1j1dnk1:~$ pdflatex --version
pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
kpathsea version 6.0.1

>Does this happen to packageVersion() only?

Also with packageDescription(). But I've compiled many knitr documents that 
have used many packages and functions and this is the first time that I have 
this problem. If I wrap packageVersion as follows then it works fine:
as.character(packageVersion('knitr'))

Can you send me the .tex file that is produced when you export the .lyx file I 
sent to latex (pdflatex)? If they are the same and it works for you then the 
problem must be my pdflatex. If they are different then the problem is 
something else.

Thanks,

Scott

Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I cannot reproduce the problem. It compiles successfully with TeXLive
2011 under Ubuntu. Can anyone else reproduce it?

Does this happen to packageVersion() only?

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, Jun 2, 2012 at 7:27 PM, Scott Kostyshak  wrote:
> LyX gives me an error when I have the R command `packageVersion` in a knitr
> chunk. Attached is a mwe .lyx that gives an error for me. I get this error
> on current trunk and on 2.0.3 when exporting or viewing as pdf (pdflatex).
> Exporting to latex (pdflatex) and then running pdflatex manually produces
> the pdf as expected but exits with error code 1 (even though no indication
> of a problem is given in the terminal which I find to be strange).
>
> I'm pasted the relevant part of the error from the log below and attached
> are the .lyx file, the .tex file that is produced when exported to latex
> (pdflatex) and the .log file.
>
> LaTeX Font Info:    Font shape `T1/cmtt/bx/n' in size <10> not available
> (Font)  Font shape `T1/cmtt/m/n' tried instead on input line
> 400.
> ! Undefined control sequence.
>  ^^M## [1] '
>   0.5'^^M
> l.405 \end{verbatim}
>
> The control sequence at the end of the top line
> of your error message was never \def'ed. If you have
> misspelled it (e.g., `\hobx'), type `I' and the correct
> spelling (e.g., `I\hbox'). Otherwise just continue,
> and I'll forget about whatever was undefined.
>
> ! Undefined control sequence.
>  ^^M## [1] '0.5'
>   ^^M
> l.405 \end{verbatim}
>
> Any ideas?
>
> Thanks,
>
> Scott


Re: knitr problem with packageVersion R function

2012-06-02 Thread Yihui Xie
I believe this is because R uses sQuote() to print package versions
which introduces curly quotes (non-ASCII characters).

> packageVersion('knitr')
[1] ‘0.5’

Unfortunately sQuote() was hard-coded in the printing function, so
there is no direct way to get rid of the two curly quotes, and you
have to use as.character(), or packageDescription('knitr',
fields='Version')

> getAnywhere(print.numeric_version)
A single object matching ‘print.numeric_version’ was found
It was found in the following places
  package:base
  registered S3 method for print from namespace base
  namespace:base
with value

function (x, ...)
{
y <- as.character(x)
if (!length(y))
writeLines(gettext("<0 elements>"))
else print(noquote(ifelse(is.na(y), NA_character_, sQuote(y))),
...)
invisible(x)
}




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, Jun 2, 2012 at 8:32 PM, Scott Kostyshak  wrote:
> From: Yihui Xie [xieyi...@gmail.com]
> Sent: Saturday, June 02, 2012 8:04 PM
>
>>I cannot reproduce the problem. It compiles successfully with TeXLive
>>2011 under Ubuntu. Can anyone else reproduce it?
>
> I am using Ubuntu (64-bit) 12.04 with TeXLive 2011 and pdflatex version:
> scott@wws-1j1dnk1:~$ pdflatex --version
> pdfTeX 3.1415926-2.3-1.40.12 (TeX Live 2011)
> kpathsea version 6.0.1
>
>>Does this happen to packageVersion() only?
>
> Also with packageDescription(). But I've compiled many knitr documents that 
> have used many packages and functions and this is the first time that I have 
> this problem. If I wrap packageVersion as follows then it works fine:
> as.character(packageVersion('knitr'))
>
> Can you send me the .tex file that is produced when you export the .lyx file 
> I sent to latex (pdflatex)? If they are the same and it works for you then 
> the problem must be my pdflatex. If they are different then the problem is 
> something else.
>
> Thanks,
>
> Scott


RE: knitr problem with packageVersion R function

2012-06-02 Thread Scott Kostyshak
From: Yihui Xie [xieyi...@gmail.com]
Sent: Saturday, June 02, 2012 8:39 PM

>I believe this is because R uses sQuote() to print package versions
>which introduces curly quotes (non-ASCII characters).

>Unfortunately sQuote() was hard-coded in the printing function, so
>there is no direct way to get rid of the two curly quotes, and you
>have to use as.character(), or packageDescription('knitr',
>fields='Version')

Ah, that makes sense. Well thanks for investigating this for me. I feel more 
comfortable at least knowing what's going on.

Scott