Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Rafael Pereira
Thank you for the clarification,  Uwe Ligges.

best,

Rafael Pereira

On Mon, Dec 2, 2019 at 4:36 PM Uwe Ligges 
wrote:

> OK, but this note did not lead to a rejection (and the mail we sent did
> not even include the Note you apparently cited from the check.log)
>
> The actual issues are:
>
>
>Found the following (possibly) invalid URLs:
>  URL: https://cran.r-project.org/web/packages/geobr/index.html
>From: README.md
>  NEWS.md
>Status: 200
>Message: OK
>CRAN URL not in canonical form
>
>  URL:
> https://cran.r-project.org/web/packages/geobr/vignettes/intro_to_geobr.html
>From: README.md
>Status: 200
>Message: OK
>CRAN URL not in canonical form
>
>  The canonical URL of the CRAN page for a package is
>https://CRAN.R-project.org/package=pkgname
>
>
> Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-ix86+x86_64
> Check: for hidden files and directories, Result: NOTE
>Found the following hidden files and directories:
>  .travis.yml
>These were most likely included in error. See section 'Package
>structure' in the 'Writing R Extensions' manual.
>
>
>
> Best,
> Uwe Ligges
>
>
>
>
> On 02.12.2019 18:46, Rafael Pereira wrote:
> > Thanks for the heads up, Ivan. In any case, I’ll change the encoding of
> the database.
> >
> > Uwe, I’m faxing this issue in the geobr package
> >
> > Rafael H.M. Pereira
> >
> >
> >> On 2 Dec 2019, at 13:39, Uwe Ligges 
> wrote:
> >>
> >>
> >>
> >>> On 02.12.2019 15:29, peter dalgaard wrote:
> >>> Dunno if it helps, but the NOTE is about "checking data", which, as
> far as I can decipher the code, means that it is looking at datasets in the
> data/ directory. So I suspect that looking at *.R files is not going to be
> the right thing to do.
> >>> -pd
>  On 2 Dec 2019, at 14:57 , Rafael Pereira 
> wrote:
> 
>  Hi all,
> 
>  I am trying to update my R package on CRAN but I am being requested
> to fix
>  this NOTE:
> 
>  checking data for non-ASCII characters ... NOTE Note: found 58 marked
>  Latin-1 strings
> >>
> >> Have we really asked you to fix these?
> >> Which packages is this?
> >>
> >> Best,
> >> Uwe Ligges
> >>
> >>
> >>>
>  I have used to code below to identify my scripts that have strings
> using
>  non-ASCII characters. The problem is that in most cases these
> non-ASCII
>  characters are used in the documentation of functions, so I cannot
> simply
>  convert their encoding using iconv() for example
> 
>  # Find scripts using non-ASCII characters
>    f <- list.files(pattern = "*.R", recursive = T)
>    r <- lapply(f, tools::showNonASCIIfile)
> 
>  I've tried (1) reopening and (2) resaving those scripts with UTF-8
>  encoding, (3) setting UTF-8 as the default encoding of the project,
> but
>  nothing seems to fix this issue. Any suggestions?
> 
>  obs. I've posted this question on SO
> 
> https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages
> 
>  best,
> 
>  Rafael Pereira
> 
>  [[alternative HTML version deleted]]
> 
>  __
>  R-package-devel@r-project.org mailing list
>  https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Uwe Ligges
OK, but this note did not lead to a rejection (and the mail we sent did 
not even include the Note you apparently cited from the check.log)


The actual issues are:


  Found the following (possibly) invalid URLs:
URL: https://cran.r-project.org/web/packages/geobr/index.html
  From: README.md
NEWS.md
  Status: 200
  Message: OK
  CRAN URL not in canonical form

URL: 
https://cran.r-project.org/web/packages/geobr/vignettes/intro_to_geobr.html

  From: README.md
  Status: 200
  Message: OK
  CRAN URL not in canonical form

The canonical URL of the CRAN page for a package is
  https://CRAN.R-project.org/package=pkgname


Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-ix86+x86_64
Check: for hidden files and directories, Result: NOTE
  Found the following hidden files and directories:
.travis.yml
  These were most likely included in error. See section 'Package
  structure' in the 'Writing R Extensions' manual.



Best,
Uwe Ligges




On 02.12.2019 18:46, Rafael Pereira wrote:

Thanks for the heads up, Ivan. In any case, I’ll change the encoding of the 
database.

Uwe, I’m faxing this issue in the geobr package

Rafael H.M. Pereira



On 2 Dec 2019, at 13:39, Uwe Ligges  wrote:




On 02.12.2019 15:29, peter dalgaard wrote:
Dunno if it helps, but the NOTE is about "checking data", which, as far as I 
can decipher the code, means that it is looking at datasets in the data/ directory. So I 
suspect that looking at *.R files is not going to be the right thing to do.
-pd

On 2 Dec 2019, at 14:57 , Rafael Pereira  wrote:

Hi all,

I am trying to update my R package on CRAN but I am being requested to fix
this NOTE:

checking data for non-ASCII characters ... NOTE Note: found 58 marked
Latin-1 strings


Have we really asked you to fix these?
Which packages is this?

Best,
Uwe Ligges





I have used to code below to identify my scripts that have strings using
non-ASCII characters. The problem is that in most cases these non-ASCII
characters are used in the documentation of functions, so I cannot simply
convert their encoding using iconv() for example

# Find scripts using non-ASCII characters
  f <- list.files(pattern = "*.R", recursive = T)
  r <- lapply(f, tools::showNonASCIIfile)

I've tried (1) reopening and (2) resaving those scripts with UTF-8
encoding, (3) setting UTF-8 as the default encoding of the project, but
nothing seems to fix this issue. Any suggestions?

obs. I've posted this question on SO
https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages

best,

Rafael Pereira

[[alternative HTML version deleted]]

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


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


Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Rafael Pereira
Thanks for the heads up, Ivan. In any case, I’ll change the encoding of the 
database. 

Uwe, I’m faxing this issue in the geobr package 

Rafael H.M. Pereira


> On 2 Dec 2019, at 13:39, Uwe Ligges  wrote:
> 
> 
> 
>> On 02.12.2019 15:29, peter dalgaard wrote:
>> Dunno if it helps, but the NOTE is about "checking data", which, as far as I 
>> can decipher the code, means that it is looking at datasets in the data/ 
>> directory. So I suspect that looking at *.R files is not going to be the 
>> right thing to do.
>> -pd
>>> On 2 Dec 2019, at 14:57 , Rafael Pereira  wrote:
>>> 
>>> Hi all,
>>> 
>>> I am trying to update my R package on CRAN but I am being requested to fix
>>> this NOTE:
>>> 
>>> checking data for non-ASCII characters ... NOTE Note: found 58 marked
>>> Latin-1 strings
> 
> Have we really asked you to fix these?
> Which packages is this?
> 
> Best,
> Uwe Ligges
> 
> 
>> 
>>> I have used to code below to identify my scripts that have strings using
>>> non-ASCII characters. The problem is that in most cases these non-ASCII
>>> characters are used in the documentation of functions, so I cannot simply
>>> convert their encoding using iconv() for example
>>> 
>>> # Find scripts using non-ASCII characters
>>>  f <- list.files(pattern = "*.R", recursive = T)
>>>  r <- lapply(f, tools::showNonASCIIfile)
>>> 
>>> I've tried (1) reopening and (2) resaving those scripts with UTF-8
>>> encoding, (3) setting UTF-8 as the default encoding of the project, but
>>> nothing seems to fix this issue. Any suggestions?
>>> 
>>> obs. I've posted this question on SO
>>> https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages
>>> 
>>> best,
>>> 
>>> Rafael Pereira
>>> 
>>>[[alternative HTML version deleted]]
>>> 
>>> __
>>> R-package-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel

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


Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Uwe Ligges




On 02.12.2019 15:29, peter dalgaard wrote:

Dunno if it helps, but the NOTE is about "checking data", which, as far as I 
can decipher the code, means that it is looking at datasets in the data/ directory. So I 
suspect that looking at *.R files is not going to be the right thing to do.

-pd


On 2 Dec 2019, at 14:57 , Rafael Pereira  wrote:

Hi all,

I am trying to update my R package on CRAN but I am being requested to fix
this NOTE:

checking data for non-ASCII characters ... NOTE Note: found 58 marked
Latin-1 strings


Have we really asked you to fix these?
Which packages is this?

Best,
Uwe Ligges





I have used to code below to identify my scripts that have strings using
non-ASCII characters. The problem is that in most cases these non-ASCII
characters are used in the documentation of functions, so I cannot simply
convert their encoding using iconv() for example

# Find scripts using non-ASCII characters
  f <- list.files(pattern = "*.R", recursive = T)
  r <- lapply(f, tools::showNonASCIIfile)

I've tried (1) reopening and (2) resaving those scripts with UTF-8
encoding, (3) setting UTF-8 as the default encoding of the project, but
nothing seems to fix this issue. Any suggestions?

obs. I've posted this question on SO
https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages

best,

Rafael Pereira

[[alternative HTML version deleted]]

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




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


Re: [R-pkg-devel] Compiler warning using C versions of base R integrate function

2019-12-02 Thread Devin Incerti
Thank you, Tomas, that is very helpful.

On Thu, Nov 28, 2019 at 4:41 AM Tomas Kalibera 
wrote:

> On 11/21/19 7:25 PM, Devin Incerti wrote:
> > Hi,
> >
> > I'm attempting to submit a very minor update to my package where I
> replaced
> > a deprecated C++ function with an alternative. However, I'm receiving an
> > unrelated warning "*array subscript -1 is outside array bounds of ‘double
> > [52]’ [-Warray-bounds] *" on Debian during the CRAN pre-tests. I do not
> > receive this warning on my local OS X, Ubuntu 16.04 (on Travis-CI), with
> > Win-builder, or with R-hub builder. I also did not receive this warning
> on
> > previous submissions to CRAN, but it does now show up on the most recent
> CRAN
> > checks
> > <
> http://s.bl-1.com/h/cH9zB21r?url=https://cran.r-project.org/web/checks/check_results_hesim.html
> >
> > .
> >
> > The warning is related to the header file integrate.h
> > <
> http://s.bl-1.com/h/cH9zB6Qt?url=https://github.com/hesim-dev/hesim/blob/master/inst/include/hesim/Rbase/integrate.h
> >,
> > which is just integrate.c
> > <
> http://s.bl-1.com/h/cH9zBCpw?url=https://github.com/wch/r-source/blob/5a156a0865362bb8381dcd69ac335f5174a4f60c/src/appl/integrate.c
> >
> > from
> > R source with function pointers replaced by C++ functors. These
> integration
> > functions are needed so that the package can integrate at the C++ level.
> >
> > I don't know how to avoid this warning. Is it perhaps related to the
> > particular version of GCC used during the CRAN checks. Any thoughts or
> > suggestions would be much appreciated.
> >
> > Thank you!
>
> The warning is generated by GCC when inlining the function rdqelg(), I
> can reproduce it with the integrate.c we have in R, but only if I add
> "inline" to rdqelg() definition (GCC 6 and newer - on Ubuntu but that
> should not matter). The inliner knows the callsite, so it knows that
> what is being passed is an array (and not an arbitrary pointer), and
> hence it emits the warning. It is not smart enough to know that the
> first element of the new "array" will (unless there is a bug) never be
> used. When not inlining and the function is compiled independently from
> its callsites, it assumes it is a pointer, and hence there is no warning.
>
> The code is automatically converted from Fortran, maybe these pointer
> decrements in function prologues are to adjust to Fortran 1-based array
> indexing. If you must use this modified copy of integrate.c from R,
> perhaps a quick hack to get rid of the warning would be to avoid the
> "inline" keywords in declarations of functions like rdqelg(). In a
> perfect world, the code would be rewritten to more idiomatic C (not just
> to avoid these decrements). Or perhaps the Fortran original could be used.
>
> Tomas
>
> > ()
> >
> > Devin
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>
>

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Ivan Krylov
On Mon, 2 Dec 2019 10:57:51 -0300
Rafael Pereira  wrote:

> checking data for non-ASCII characters ... NOTE Note: found 58 marked
> Latin-1 strings
> 
> I have used to code below to identify my scripts that have strings
> using non-ASCII characters. 

I don't think it's about non-ASCII in source code; it's about Latin-1
strings in the package data:

git clone https://github.com/ipeaGIT/geobr
cd geobr/data
R
load('grid_state_correspondence_table.RData')
sum(
 unlist(
  lapply(grid_state_correspondence_table, Encoding)
 ) == 'latin1'
)
# [1] 58

What I'm not sure of is *how* this NOTE should be fixed. "Writing R
extensions" §1.6.3 provides advice on UTF-8 strings in the R code, not
data; §5.15 only says that strings *could* be marked as Latin-1 or
UTF-8 (but doesn't say what *should* be done); finally,
tools:::.check_package_datasets seems to produce NOTEs about Latin-1,
UTF-8 and strings marked as bytes.

-- 
Best regards,
Ivan

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


Re: [R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread peter dalgaard
Dunno if it helps, but the NOTE is about "checking data", which, as far as I 
can decipher the code, means that it is looking at datasets in the data/ 
directory. So I suspect that looking at *.R files is not going to be the right 
thing to do.

-pd

> On 2 Dec 2019, at 14:57 , Rafael Pereira  wrote:
> 
> Hi all,
> 
> I am trying to update my R package on CRAN but I am being requested to fix
> this NOTE:
> 
> checking data for non-ASCII characters ... NOTE Note: found 58 marked
> Latin-1 strings
> 
> I have used to code below to identify my scripts that have strings using
> non-ASCII characters. The problem is that in most cases these non-ASCII
> characters are used in the documentation of functions, so I cannot simply
> convert their encoding using iconv() for example
> 
> # Find scripts using non-ASCII characters
>  f <- list.files(pattern = "*.R", recursive = T)
>  r <- lapply(f, tools::showNonASCIIfile)
> 
> I've tried (1) reopening and (2) resaving those scripts with UTF-8
> encoding, (3) setting UTF-8 as the default encoding of the project, but
> nothing seems to fix this issue. Any suggestions?
> 
> obs. I've posted this question on SO
> https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages
> 
> best,
> 
> Rafael Pereira
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


[R-pkg-devel] Fix non-ASCII characters in R packages

2019-12-02 Thread Rafael Pereira
Hi all,

I am trying to update my R package on CRAN but I am being requested to fix
this NOTE:

checking data for non-ASCII characters ... NOTE Note: found 58 marked
Latin-1 strings

I have used to code below to identify my scripts that have strings using
non-ASCII characters. The problem is that in most cases these non-ASCII
characters are used in the documentation of functions, so I cannot simply
convert their encoding using iconv() for example

# Find scripts using non-ASCII characters
  f <- list.files(pattern = "*.R", recursive = T)
  r <- lapply(f, tools::showNonASCIIfile)

I've tried (1) reopening and (2) resaving those scripts with UTF-8
encoding, (3) setting UTF-8 as the default encoding of the project, but
nothing seems to fix this issue. Any suggestions?

obs. I've posted this question on SO
https://stackoverflow.com/questions/59139923/fix-non-ascii-characters-in-r-packages

best,

Rafael Pereira

[[alternative HTML version deleted]]

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