Re: [R-pkg-devel] Rmarkdown vignette yields r inline warning on windows build [EXT]

2020-05-05 Thread Martin Maechler
> Matthew Young 
> on Mon, 4 May 2020 09:09:55 + writes:

> I progressively chopped bits out of the vignette till the
> error stopped to identify the error.  It was being caused
> by inline latex, where I had two %% marks.  I'm not really
> sure why this broke things, but removing it fixed it.

"fascinating" .. yes, unfortunately, the Rmarkdown related
engines (I suspect pandoc, but haven't thought or digged about it)
are clearly not bug free.

That's been my experience quite frequently when I "exaggerate"
in my use of LaTeX "tricks" in Rmarkdown documents ..

If somebody knows where exactly such cases should be sent, it
may help improving the situation.. I'm really no expert here.

Martin

> Thanks,
> Matthew

> On 02/05/2020, 16:54, "Uwe Ligges"
>  wrote:

> My wild guess is that 'r ' indicates there is an
> invisible char after the r that is not representable in
> the chosen encoding.

> Best, Uwe Ligges



> On 02.05.2020 01:12, Matthew Young wrote:
>> I’ve tried both ways (with and without a space after the
>> backtick) and get the same error.
>> 
>> From: Max Turgeon  Date:
>> Friday, 1 May 2020 at 20:39 To: Matthew Young
>> , "r-package-devel@r-project.org"
>>  Subject: Re: Rmarkdown
>> vignette yields r inline warning on windows build [EXT]
>> 
>> 
>> Since you're looking for suggestions and that's all I
>> have:
>> 
>> 
>> 
>> Could it be the space between the tick mark and the r?
>> For example, does replacing ` round` with `round` (and
>> all other instances) fix the issue?
>> 
>> 
>> Max Turgeon Assistant Professor Department of Statistics
>> Department of Computer Science University of Manitoba
>> maxturgeon.ca
>> 
[maxturgeon.ca]
>> 
>> 
>> 
>>  From: R-package-devel
>>  on behalf of
>> Matthew Young  Sent: May 1, 2020
>> 2:24:40 PM To: r-package-devel@r-project.org Subject:
>> [R-pkg-devel] Rmarkdown vignette yields r inline warning
>> on windows build
>> 
>> 
>> Caution: This message was sent from outside the
>> University of Manitoba.
>> 
>> 
>> I am trying to submit a package to CRAN that includes a
>> vignette built using rmarkdown.  It passes fine on the
>> machines I have access to (ubuntu and osx).  When I
>> submit to CRAN using the form, it passes the Debian
>> checks, but fails on windows with the following WARNING:
>> 
>> ! Missing $ inserted.   $ l.1030
>> 
>> You may need to add $ $ around a certain inline R
>> expression `r `
>> 
>> 
>> I’m really not sure what is causing this error or how to
>> debug it.  I do not have any inline r expressions in my
>> vignette (code here
>> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwIDaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=ES3UP2LbqvhOCSwVRP53v_p9EkdNJSwmYuIlfmKly28&s=R9IaPh1UjnNyLSsE8CxG_GorvzRQPg8160TkSZoRoac&e=
>> 
[github.com]).
>> I do have back-ticked expression such as `round`, but
>> they are not executed code.  Can anyone suggest what
>> might be causing this issue?
>> 
>> Many thanks,
>> 
>> Matthew
>> 
>> 
>> 
>> --
>> The Wellcome Sanger Institute is operated by Genome
>> Research Limited, a charity registered in England with
>> number 1021457 and a company registered in England with
>> number 2742969, whose registered office is 215 Eu...{{dropped:26}}

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Rmarkdown vignette yields r inline warning on windows build [EXT]

2020-05-05 Thread Duncan Murdoch

On 05/05/2020 10:30 a.m., Martin Maechler wrote:

Matthew Young
 on Mon, 4 May 2020 09:09:55 + writes:


 > I progressively chopped bits out of the vignette till the
 > error stopped to identify the error.  It was being caused
 > by inline latex, where I had two %% marks.  I'm not really
 > sure why this broke things, but removing it fixed it.

"fascinating" .. yes, unfortunately, the Rmarkdown related
engines (I suspect pandoc, but haven't thought or digged about it)
are clearly not bug free.

That's been my experience quite frequently when I "exaggerate"
in my use of LaTeX "tricks" in Rmarkdown documents ..

If somebody knows where exactly such cases should be sent, it
may help improving the situation.. I'm really no expert here.


We don't have anything to send, so it's hard to say where to send it.

Put together a minimal reproducible example, and it'll probably be easy 
to work out whether it's R, R Markdown, knitr, Pandoc, or LaTeX that has 
the bug.


(Naturally I suspect it's not R, and past experience makes me think it's 
not LaTeX, but there are still three other possibilities in the list.)


Duncan Murdoch



Martin

 > Thanks,
 > Matthew

 > On 02/05/2020, 16:54, "Uwe Ligges"
 >  wrote:

 > My wild guess is that 'r ' indicates there is an
 > invisible char after the r that is not representable in
 > the chosen encoding.
 
 > Best, Uwe Ligges
 
 
 
 > On 02.05.2020 01:12, Matthew Young wrote:

 >> I’ve tried both ways (with and without a space after the
 >> backtick) and get the same error.
 >>
 >> From: Max Turgeon  Date:
 >> Friday, 1 May 2020 at 20:39 To: Matthew Young
 >> , "r-package-devel@r-project.org"
 >>  Subject: Re: Rmarkdown
 >> vignette yields r inline warning on windows build [EXT]
 >>
 >>
 >> Since you're looking for suggestions and that's all I
 >> have:
 >>
 >>
 >>
 >> Could it be the space between the tick mark and the r?
 >> For example, does replacing ` round` with `round` (and
 >> all other instances) fix the issue?
 >>
 >>
 >> Max Turgeon Assistant Professor Department of Statistics
 >> Department of Computer Science University of Manitoba
 >> maxturgeon.ca
 >> 
[maxturgeon.ca]
 >>
 >>
 >>
 >>  From: R-package-devel
 >>  on behalf of
 >> Matthew Young  Sent: May 1, 2020
 >> 2:24:40 PM To: r-package-devel@r-project.org Subject:
 >> [R-pkg-devel] Rmarkdown vignette yields r inline warning
 >> on windows build
 >>
 >> 
 >> Caution: This message was sent from outside the
 >> University of Manitoba.
 >> 
 >>
 >> I am trying to submit a package to CRAN that includes a
 >> vignette built using rmarkdown.  It passes fine on the
 >> machines I have access to (ubuntu and osx).  When I
 >> submit to CRAN using the form, it passes the Debian
 >> checks, but fails on windows with the following WARNING:
 >>
 >> ! Missing $ inserted.   $ l.1030
 >>
 >> You may need to add $ $ around a certain inline R
 >> expression `r `
 >>
 >>
 >> I’m really not sure what is causing this error or how to
 >> debug it.  I do not have any inline r expressions in my
 >> vignette (code here
 >> 
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwIDaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=ES3UP2LbqvhOCSwVRP53v_p9EkdNJSwmYuIlfmKly28&s=R9IaPh1UjnNyLSsE8CxG_GorvzRQPg8160TkSZoRoac&e=
 >> 
[github.com]).
 >> I do have back-ticked expression such as `round`, but
 >> they are not executed code.  Can anyone suggest what
 >> might be causing this issue?
 >>
 >> Many thanks,
 >>
 >> Matthew
 >>
 >>
 >>
 >> --
 >> The Wellcome Sanger Institute is operated by Genome
 >> Research Limited, a charity registered in England with
 >> number 1021457 and a company registered in England with
 >> number 2742969, whose registered office is 215 Eu...{{dropped:26}}

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/l

[R-pkg-devel] Using Rcpp to set up a package

2020-05-05 Thread James Owen Ramsay, Dr.
I’m working on max OS-X 10.15.3, using R 4.0.0, and updated Xcode as well as 
updated tools:

Here’s my setup of a package called Data2LD2. (An update of an existing package 
Data2LD already on Iran):

code_files = c("~/Documents/R/Data2LDRcpp/R/Atensorfn.R",
  "~/Documents/R/Data2LDRcpp/R/BAtensorfn.R",
  "~/Documents/R/Data2LDRcpp/R/Btensorfn.R",
  "~/Documents/R/Data2LDRcpp/R/checkModel.R",
  "~/Documents/R/Data2LDRcpp/R/Data2LD.opt.R",
  "~/Documents/R/Data2LDRcpp/R/Data2LD.R",
  "~/Documents/R/Data2LDRcpp/R/fun.explinear.R",
  "~/Documents/R/Data2LDRcpp/R/fun.Dexplinear.R",
  "~/Documents/R/Data2LDRcpp/R/getForceterm.R",
  "~/Documents/R/Data2LDRcpp/R/getHomoTerm.R",
  "~/Documents/R/Data2LDRcpp/R/inprod.TPbasis.R",
  "~/Documents/R/Data2LDRcpp/R/make.Fterm.R",
  "~/Documents/R/Data2LDRcpp/R/make.Xterm.R",
  "~/Documents/R/Data2LDRcpp/R/make.Variable.R",
  "~/Documents/R/Data2LDRcpp/R/modelList2Vec.R",
  "~/Documents/R/Data2LDRcpp/R/modelVec2List.R",
  "~/Documents/R/Data2LDRcpp/R/printMatrix.R",
  "~/Documents/R/Data2LDRcpp/R/printModel.R")

cpp_files = c("~/Documents/R/Data2LDRcpp/src/DASarrayFnCpp",
 "~/Documents/R/Data2LDRcpp/src/DBSarrayFnCpp",
 "~/Documents/R/Data2LDRcpp/src/DRarrayFnCpp",
 "~/Documents/R/Data2LDRcpp/src/loopJuanCpp",
 "~/Documents/R/Data2LDRcpp/src/RmatFnCpp",
 "~/Documents/R/Data2LDRcpp/src/SmatFnCpp")

Rcpp.package.skeleton(name="Data2LD2", 
 code_files=code_files,
 cpp_files =cpp_files,
 author="James Ramsay",
 maintainer="James Ramsay",
 force=TRUE)

Here’s the bad news from R CMD check:

Error: package or namespace load failed for ‘Data2LD2’ in dyn.load(file, 
DLLpath = DLLpath, ...):
unable to load shared object 
'/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so':
 
dlopen(/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so,
 6): Symbol not found: _DASarrayFnCpp
 Referenced from: 
/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
 Expected in: flat namespace
in 
/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/jimramsay/Documents/R/Data2LD2.Rcheck/Data2LD2’

I’m getting this failure after many iterations of this setup, this being the 
simplest and most direct that I know.

Sure would like some help (or some sympathy at least)

Jim Ramsay
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Using Rcpp to set up a package

2020-05-05 Thread Dirk Eddelbuettel


Jim,

This is not the list for Rcpp discussions, as the package and its
documentation have been saying for a decade you should subscribe
to the rcpp-devel list.

Allow me to add one item:

On 5 May 2020 at 19:58, James Owen Ramsay, Dr. wrote:
| I’m working on max OS-X 10.15.3, using R 4.0.0, and updated Xcode as well as 
updated tools:
| 
| Here’s my setup of a package called Data2LD2. (An update of an existing 
package Data2LD already on Iran):
| 
| code_files = c("~/Documents/R/Data2LDRcpp/R/Atensorfn.R",
|   "~/Documents/R/Data2LDRcpp/R/BAtensorfn.R",
|   "~/Documents/R/Data2LDRcpp/R/Btensorfn.R",
|   "~/Documents/R/Data2LDRcpp/R/checkModel.R",
|   "~/Documents/R/Data2LDRcpp/R/Data2LD.opt.R",
|   "~/Documents/R/Data2LDRcpp/R/Data2LD.R",
|   "~/Documents/R/Data2LDRcpp/R/fun.explinear.R",
|   "~/Documents/R/Data2LDRcpp/R/fun.Dexplinear.R",
|   "~/Documents/R/Data2LDRcpp/R/getForceterm.R",
|   "~/Documents/R/Data2LDRcpp/R/getHomoTerm.R",
|   "~/Documents/R/Data2LDRcpp/R/inprod.TPbasis.R",
|   "~/Documents/R/Data2LDRcpp/R/make.Fterm.R",
|   "~/Documents/R/Data2LDRcpp/R/make.Xterm.R",
|   "~/Documents/R/Data2LDRcpp/R/make.Variable.R",
|   "~/Documents/R/Data2LDRcpp/R/modelList2Vec.R",
|   "~/Documents/R/Data2LDRcpp/R/modelVec2List.R",
|   "~/Documents/R/Data2LDRcpp/R/printMatrix.R",
|   "~/Documents/R/Data2LDRcpp/R/printModel.R")
| 
| cpp_files = c("~/Documents/R/Data2LDRcpp/src/DASarrayFnCpp",
|  "~/Documents/R/Data2LDRcpp/src/DBSarrayFnCpp",
|  "~/Documents/R/Data2LDRcpp/src/DRarrayFnCpp",
|  "~/Documents/R/Data2LDRcpp/src/loopJuanCpp",
|  "~/Documents/R/Data2LDRcpp/src/RmatFnCpp",
|  "~/Documents/R/Data2LDRcpp/src/SmatFnCpp")
| 
| Rcpp.package.skeleton(name="Data2LD2", 
|  code_files=code_files,
|  cpp_files =cpp_files,
|  author="James Ramsay",
|  maintainer="James Ramsay",
|  force=TRUE)

I have created many packages using Rcpp.package.skeleton(), but I usually do
NOT supply lists of files. I would consider starting with an empty package,
and adding files as you go along.  For a deeper look it usually helps us most
to actually _see_ the code so if it is in public repo, tell us.

| Here’s the bad news from R CMD check:
| 
| Error: package or namespace load failed for ‘Data2LD2’ in dyn.load(file, 
DLLpath = DLLpath, ...):
| unable to load shared object 
'/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so':
|  
dlopen(/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so,
 6): Symbol not found: _DASarrayFnCpp
|  Referenced from: 
/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
|  Expected in: flat namespace

We've seen that error but I don't recall from the top of my head where this
leads.

Overall, I would expect this to be simple to fix. Let's lay out the files as
expect, let's run `compileAttributes()` (if you use Rcpp Attributes as one
should) and let's take it from there.

But let's maybe have that discussion over at rcpp-devel.

Best,  Dirk


| in 
/Users/jimramsay/Documents/R/Data2LD2.Rcheck/00LOCK-Data2LD2/00new/Data2LD2/libs/Data2LD2.so
| Error: loading failed
| Execution halted
| ERROR: loading failed
| * removing ‘/Users/jimramsay/Documents/R/Data2LD2.Rcheck/Data2LD2’
| 
| I’m getting this failure after many iterations of this setup, this being the 
simplest and most direct that I know.
| 
| Sure would like some help (or some sympathy at least)
| 
| Jim Ramsay
| __
| R-package-devel@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel