[R-pkg-devel] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Hi All,

I'm trying to generate a `tar.gz` file on a Mac for R package submission to
CRAN but am having issues.

I'm using `devtools`, specifically `build()` and `install()`.

My package relies on compiled code via `Rcpp/RcppArmadillo`.

build("HACSim_OO")
── R CMD build
─
✔  checking for file ‘/Users/jarrettphillips/Desktop/HAC
simulation/HACSim_OO/DESCRIPTION’ ...
─  preparing ‘HACSim’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to process help pages
 ---
─  installing *source* package ‘HACSim’ ...
   ** using staged installation
   ** libs
   clang++ -arch arm64 -std=gnu++11 -
I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
 
-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
-I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2  -Wall
-pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
   clang++ -arch arm64 -std=gnu++11
-I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
 
-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
-I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2  -Wall
-pedantic -fdiagnostics-color=always -c accumulate.cpp -o accumulate.o
   clang++ -arch arm64 -std=gnu++11 -dynamiclib
-Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module
-multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib
-L/opt/R/arm64/lib -o HACSim.so RcppExports.o accumulate.o
-L/Library/Frameworks/R.framework/Resources/lib -lRlapack
-L/Library/Frameworks/R.framework/Resources/lib -lRblas
-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1
-L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lquadmath
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
   ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
   ld: warning: directory not found for option
'-L/opt/R/arm64/gfortran/lib'
   ld: library not found for -lgfortran
   clang: error: linker command failed with exit code 1 (use -v to see
invocation)
   make: *** [HACSim.so] Error 1
   ERROR: compilation failed for package ‘HACSim’
─  removing
‘/private/var/folders/r4/xm5blbcd2tn06tjv00lm1c78gn/T/RtmpN4uaYR/Rinstdf4219594de/HACSim’
 ---
ERROR: package installation failed
Error in `(function (command = NULL, args = character(),
error_on_status = TRUE, …`:
! System command 'R' failed
 ---
 Exit status: 1
 stdout & stderr: 
 ---
Type .Last.error to see the more details.

`clang` is installed (since I am able to run the code within my package)
and I've verified by typing `gcc` in the Mac Terminal. I've also installed
`Homebrew` and `gfortran`, verifying via typing in the Terminal.

Any idea on what's going on how to fix the issue(s)?

Thanks!

Cheers,

Jarrett

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Hi Duncan,

I actually installed gfortran from

https://github.com/fxcoudert/gfortran-for-macOS/releases

but I can instead install from the URL you provide.

Hopefully this fixes the problem.

I will respond here if there are still issues.

Thanks.

Cheers,

Jarrett


On Tue, May 16, 2023 at 12:39 PM Duncan Murdoch 
wrote:

> On 16/05/2023 12:07 p.m., Jarrett Phillips wrote:
> > Hi All,
> >
> > I'm trying to generate a `tar.gz` file on a Mac for R package submission
> to
> > CRAN but am having issues.
> >
> > I'm using `devtools`, specifically `build()` and `install()`.
> >
> > My package relies on compiled code via `Rcpp/RcppArmadillo`.
> >
> >  build("HACSim_OO")
> >  ── R CMD build
> > ─
> >  ✔  checking for file ‘/Users/jarrettphillips/Desktop/HAC
> > simulation/HACSim_OO/DESCRIPTION’ ...
> >  ─  preparing ‘HACSim’:
> >  ✔  checking DESCRIPTION meta-information ...
> >  ─  cleaning src
> >  ─  installing the package to process help pages
> >   ---
> >  ─  installing *source* package ‘HACSim’ ...
> > ** using staged installation
> > ** libs
> > clang++ -arch arm64 -std=gnu++11 -
> > I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
> >
>  
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
> >
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
> > -I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2  -Wall
> > -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
> > clang++ -arch arm64 -std=gnu++11
> > -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
> >
>  
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
> >
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
> > -I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2  -Wall
> > -pedantic -fdiagnostics-color=always -c accumulate.cpp -o accumulate.o
> > clang++ -arch arm64 -std=gnu++11 -dynamiclib
> > -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module
> > -multiply_defined suppress
> -L/Library/Frameworks/R.framework/Resources/lib
> > -L/opt/R/arm64/lib -o HACSim.so RcppExports.o accumulate.o
> > -L/Library/Frameworks/R.framework/Resources/lib -lRlapack
> > -L/Library/Frameworks/R.framework/Resources/lib -lRblas
> > -L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1
> > -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lquadmath
> > -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
> > -Wl,CoreFoundation
> > ld: warning: directory not found for option
> > '-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
> > ld: warning: directory not found for option
> > '-L/opt/R/arm64/gfortran/lib'
> > ld: library not found for -lgfortran
> > clang: error: linker command failed with exit code 1 (use -v to
> see
> > invocation)
> > make: *** [HACSim.so] Error 1
> > ERROR: compilation failed for package ‘HACSim’
> >  ─  removing
> >
> ‘/private/var/folders/r4/xm5blbcd2tn06tjv00lm1c78gn/T/RtmpN4uaYR/Rinstdf4219594de/HACSim’
> >   ---
> >  ERROR: package installation failed
> >  Error in `(function (command = NULL, args = character(),
> > error_on_status = TRUE, …`:
> >  ! System command 'R' failed
> >   ---
> >   Exit status: 1
> >   stdout & stderr: 
> >   ---
> >  Type .Last.error to see the more details.
> >
> > `clang` is installed (since I am able to run the code within my package)
> > and I've verified by typing `gcc` in the Mac Terminal. I've also
> installed
> > `Homebrew` and `gfortran`, verifying via typing in the Terminal.
> >
> > Any idea on what's going on how to fix the issue(s)?
>
> You don't say how you installed gfortran, but it sounds as though you
> installed Homebrew's build of it.  You should install the tools as
> available from https://mac.r-project.org/tools/.
>
> Duncan Murdoch
>
>

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Installing from the URL you provide, as well as doing R CMD build HACSim as
suggested by @JeffNewmiller fails.

When trying the latter solution, I get the same error as the one provided
in my original post.

Any thoughts?





On Tue, May 16, 2023 at 12:52 PM Jarrett Phillips <
phillipsjarre...@gmail.com> wrote:

> Hi Duncan,
>
> I actually installed gfortran from
>
> https://github.com/fxcoudert/gfortran-for-macOS/releases
>
> but I can instead install from the URL you provide.
>
> Hopefully this fixes the problem.
>
> I will respond here if there are still issues.
>
> Thanks.
>
> Cheers,
>
> Jarrett
>
>
> On Tue, May 16, 2023 at 12:39 PM Duncan Murdoch 
> wrote:
>
>> On 16/05/2023 12:07 p.m., Jarrett Phillips wrote:
>> > Hi All,
>> >
>> > I'm trying to generate a `tar.gz` file on a Mac for R package
>> submission to
>> > CRAN but am having issues.
>> >
>> > I'm using `devtools`, specifically `build()` and `install()`.
>> >
>> > My package relies on compiled code via `Rcpp/RcppArmadillo`.
>> >
>> >  build("HACSim_OO")
>> >  ── R CMD build
>> > ─
>> >  ✔  checking for file ‘/Users/jarrettphillips/Desktop/HAC
>> > simulation/HACSim_OO/DESCRIPTION’ ...
>> >  ─  preparing ‘HACSim’:
>> >  ✔  checking DESCRIPTION meta-information ...
>> >  ─  cleaning src
>> >  ─  installing the package to process help pages
>> >   ---
>> >  ─  installing *source* package ‘HACSim’ ...
>> > ** using staged installation
>> > ** libs
>> > clang++ -arch arm64 -std=gnu++11 -
>> > I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
>> >
>>  
>> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
>> >
>> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
>> > -I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2
>> -Wall
>> > -pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
>> > clang++ -arch arm64 -std=gnu++11
>> > -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
>> >
>>  
>> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
>> >
>> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
>> > -I/opt/R/arm64/include-fPIC  -falign-functions=64 -Wall -g -O2
>> -Wall
>> > -pedantic -fdiagnostics-color=always -c accumulate.cpp -o accumulate.o
>> > clang++ -arch arm64 -std=gnu++11 -dynamiclib
>> > -Wl,-headerpad_max_install_names -undefined dynamic_lookup
>> -single_module
>> > -multiply_defined suppress
>> -L/Library/Frameworks/R.framework/Resources/lib
>> > -L/opt/R/arm64/lib -o HACSim.so RcppExports.o accumulate.o
>> > -L/Library/Frameworks/R.framework/Resources/lib -lRlapack
>> > -L/Library/Frameworks/R.framework/Resources/lib -lRblas
>> > -L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1
>> > -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lquadmath
>> > -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
>> > -Wl,CoreFoundation
>> > ld: warning: directory not found for option
>> > '-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
>> > ld: warning: directory not found for option
>> > '-L/opt/R/arm64/gfortran/lib'
>> > ld: library not found for -lgfortran
>> > clang: error: linker command failed with exit code 1 (use -v to
>> see
>> > invocation)
>> > make: *** [HACSim.so] Error 1
>> > ERROR: compilation failed for package ‘HACSim’
>> >  ─  removing
>> >
>> ‘/private/var/folders/r4/xm5blbcd2tn06tjv00lm1c78gn/T/RtmpN4uaYR/Rinstdf4219594de/HACSim’
>> >   ---
>> >  ERROR: package installation failed
>> >  Error in `(function (command = NULL, args = character(),
>> > error_on_status = TRUE, …`:
>> >  ! System command 'R' failed
>> >   ---
>> >   Exit status: 1
>> >   stdout & stderr: 
>> >   ---
>> >  Type .Last.error to see the more details.
>> >
>> > `clang` is installed (since I am able to run the code within my package)
>> > and I've verified by typing `gcc` in the Mac Terminal. I've also
>> installed
>> > `Homebrew` and `gfortran`, verifying via typing in the Terminal.
>> >
>> > Any idea on what's going on how to fix the issue(s)?
>>
>> You don't say how you installed gfortran, but it sounds as though you
>> installed Homebrew's build of it.  You should install the tools as
>> available from https://mac.r-project.org/tools/.
>>
>> Duncan Murdoch
>>
>>

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
On Tue, May 16, 2023 at 2:00 PM Jarrett Phillips 
wrote:

> Yes, in addition to doing what @DirkEddelbuettel suggests. I keep getting
> the same error...
>
> On Tue, May 16, 2023 at 1:47 PM Duncan Murdoch 
> wrote:
>
>> On 16/05/2023 1:14 p.m., Jarrett Phillips wrote:
>> > Installing from the URL you provide, as well as doing R CMD
>> build HACSim
>> > as suggested by @JeffNewmiller fails.
>> >
>> > When trying the latter solution, I get the same error as the one
>> > provided in my original post.
>> >
>> > Any thoughts?
>>
>> Did you try Serguei's suggestion?
>>
>> On 16/05/2023 12:32 p.m., Serguei Sokol wrote:
>>  > Try to add in /src/Makevars:
>>  >
>>  > PKG_LIBS=$(FLIBS)
>>
>

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Strange... the GitHub repo is up to date and that's what I'm trying to
bundle up for a CRAN update. So, I'm thinking it's some kind of a system
issue (I recently purchased a new MacBook Pro)..

I'll investigate.

Thanks!

On Tue, May 16, 2023 at 2:09 PM Duncan Murdoch 
wrote:

> I don't know what the issue would be.  I just tried
>
>remotes::install_github("jphill01/HACSim.R")
>
> and it worked fine, but I think that's not the same version that you are
> working with.
>
> Duncan Murdoch
>
> On 16/05/2023 2:01 p.m., Jarrett Phillips wrote:
> >
> >
> > On Tue, May 16, 2023 at 2:00 PM Jarrett Phillips
> > mailto:phillipsjarre...@gmail.com>> wrote:
> >
> > Yes, in addition to doing what @DirkEddelbuettel suggests. I keep
> > getting the same error...
> >
> > On Tue, May 16, 2023 at 1:47 PM Duncan Murdoch
> > mailto:murdoch.dun...@gmail.com>> wrote:
> >
> > On 16/05/2023 1:14 p.m., Jarrett Phillips wrote:
> >  > Installing from the URL you provide, as well as doing R CMD
> > build HACSim
> >  > as suggested by @JeffNewmiller fails.
> >  >
> >  > When trying the latter solution, I get the same error as the
> one
> >  > provided in my original post.
> >  >
> >  > Any thoughts?
> >
> > Did you try Serguei's suggestion?
> >
> > On 16/05/2023 12:32 p.m., Serguei Sokol wrote:
> >   > Try to add in /src/Makevars:
> >   >
> >   > PKG_LIBS=$(FLIBS)
> >
>
>

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Hi Dirk,

I wonder if my problem is related to the question you posed about the CRAN
macOS builders being down. If it is, then according to @Simon Urbanek, this
should be resolved in a few hours.

Can you confirm?

Thanks.

Cheers,

Jarrett

On Tue, May 16, 2023 at 1:11 PM Dirk Eddelbuettel  wrote:

>
> On 16 May 2023 at 18:32, Serguei Sokol wrote:
> | Try to add in /src/Makevars:
> |
> | PKG_LIBS=$(FLIBS)
>
> Good catch. For every RcppArmadillo package we recommend (and inject if you
> use the RcppArmadillo.package.skeleton() helper) (and omit the earlier
> comment lines)
>
>   PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
>   PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
>
> Source file (with addded comments) is at
>
> https://github.com/RcppCore/RcppArmadillo/blob/master/inst/skeleton/Makevars
> or in your friendly neighborhood RcppArmadillo installation as
> system.file("skeleton", "Makevars", package="RcppArmadillo")
>
> Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>

[[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] Problems with devtools::build() in R

2023-05-16 Thread Jarrett Phillips
Actually, no, only locally… but so far all proposed solutions have failed.

On Tue, May 16, 2023 at 7:11 PM Dirk Eddelbuettel  wrote:

>
> Hi Jarrett
>
> On 16 May 2023 at 19:06, Jarrett Phillips wrote:
> | I wonder if my problem is related to the question you posed about the
> CRAN
> | macOS builders being down. If it is, then according to @Simon Urbanek,
> this
> | should be resolved in a few hours.
> |
> | Can you confirm?
>
> Oh, maybe -- were you trying at Simon's macbuilder? I thought you were
> doing
> this locally on your machine.  If it was Simon's and if that box had
> hickups
> then yes that could indeed be related.
>
> Dirk
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>

[[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] Problems with devtools::build() in R

2023-05-17 Thread Jarrett Phillips
Hi Ivan,

Yes, I can build a Fortran program successfully.

cat >hello.f90 < wrote:

> Can you build a Fortran program? I.e., does the following work?
>
> cat >hello.f90 < program hello
>  print *, 'Hello world'
> end program
> EOF
> gfortran -o hello hello.f90 && ./hello
>
> Does `which gfortran` confirm that it's the executable you expect it to
> be?
>
> What does `gfortran -print-search-dirs` say about the locations for its
> files? (Where does -lgfortran actually live?)
>
> What does your file.path(R.home('etc'), 'Makeconf') say about the
> library paths?
>
> (Using `R CMD build` to build the package doesn't help either, right? If
> yes, a faster way of reproducing the problem would be to run the
> following command:
>
> PKG_CPPFLAGS=-I/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include
> \
>  R CMD SHLIB *cpp
>
> ...in the src directory of your package, instead of waiting for R CMD
> build to try to install the resulting source package and fail.)
>
> --
> Best regards,
> Ivan
>

[[alternative HTML version deleted]]

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


[R-pkg-devel] SHLIB_OPENMP_*FLAGS in Makefiles

2019-04-15 Thread Jarrett Phillips
In checking my R package via devtools::check and devtools::check_built, I
received the following NOTE which I am unsure how to fix. My package
contains compiled code (via Rcpp). Within my .cpp file I have the following
line:

#define ARMA_DONT_PRINT_OPENMP_WARNING

Is this the issue?

checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... NOTE
  src/Makevars: SHLIB_OPENMP_CXXFLAGS is included in PKG_CXXFLAGS but
not in PKG_LIBS
  src/Makevars: SHLIB_OPENMP_CFLAGS is included in PKG_LIBS but
linking is by C++
  src/Makevars.win: SHLIB_OPENMP_CXXFLAGS is included in PKG_CXXFLAGS
but not in PKG_LIBS
  src/Makevars.win: SHLIB_OPENMP_CFLAGS is included in PKG_LIBS but
linking is by C++


Thanks.

[[alternative HTML version deleted]]

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


[R-pkg-devel] What constitutes insufficient merit of an r package?

2019-04-25 Thread Jarrett Phillips
Hello,

When submitting a package to the Comprehensive R Archive Network (CRAN),
one requirement for eventual acceptance is novelty of the package and its
workings (i.e., functions, etc.).

That is, a package's contribution cannot be trivial.

The flowchart found here explains things pictorially:

https://github.com/edgararuiz/cran-stages

Many R packages contain functions found in other packages. These functions
are not necessarily distinct from those in older R packages.

*What then is meant by 'sufficient merit' of an incoming R package?*

I realize this question is likely to be opinion-based, but it is one that
grabbed my attention nonetheless.


Thanks.

Cheers,

Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] False Positive WARNING in devtools::check_built

2019-05-03 Thread Jarrett Phillips
Hello,


I have run devtools::check_built() on my package tarball to ensure the
presence of no ERRORS/WARNINGS or NOTES. The below WARNING was found:


W  checking for unstated dependencies in examples ...

   Warning: parse error in file 'HACSim-Ex.R':

   197:17: unexpected symbol

   196: # user prompted to select appropriate FASTA file of

   197: aligned/trimmed DNA

^


My documentation doesn't run up to line 197. All documentation is below 100
lines in length.


Prior to a small fix (changing \dontrun to \donttest), my package had zero
WARNINGS, ERRORS and NOTES.


The WARNING seems to stem from the 'DNA' reference within the comment.


Is the above WARNING a false positive?


i recently updated to R 3.5.3, could this have caused this issue?



Thanks!



Cheers,


Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] Writing to files without altering working directory in R package

2019-05-03 Thread Jarrett Phillips
Hello,

My R package has a function with an argument to specify whether numerical
results should be outputted to a CSV file.

CRAN policy stipulates verbatim that

Packages should not write in the user’s home filespace (including
clipboards), nor anywhere else on the file system apart from the R
session’s temporary directory (or during installation in the location
pointed to by TMPDIR: and such usage should be cleaned up). Installing into
the system’s R installation (e.g., scripts to its bin directory) is not
allowed.

I know I should use tempdir() within my package function, but I've not seen
any examples on how this is best done within existing R packages.

Within my package documentation examples for my function, I have the lines:

 \dontshow{.oldwd <- setwd(tempdir())}

... some R code ...

\dontshow{setwd(.oldwd)}

but I have been informed that this is not the accepted way.

Any ideas from the community on how do do this properly?


Thanks for the help!

Cheers,

Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] noLD error in CRAN checks in package 'HACSim'

2019-05-15 Thread Jarrett Phillips
Hello,

My package has recently been posted to CRAN, however, there is an
additional issue of noLD on tests on x86_64 Linux with R-devel.

I haven't yet received an email from CRAN maintainers on resolving the
issue.

However, I would like to submit an updated package version with improved
documentation and thought that I could fix this error as well.

Any ideas on how to solve the below problem?

I suspect it has something to do with numerical precision of estimates.

-

* checking examples ... ERROR
Running examples in ‘HACSim-Ex.R’ failed
The error most likely occurred in:

> ### Name: HAC.simrep
> ### Title: Run a simulation of haplotype accumulation curves for
> ###   hypothetical or real species
> ### Aliases: HAC.simrep
>
> ### ** Examples
>
>
>   ## Simulate hypothetical species ##
>
>   N <- 100 # total number of sampled individuals
>   Hstar <- 10 # total number of haplotypes
>   probs <- rep(1/Hstar, Hstar) # equal haplotype frequency distribution
>
>   HACSObj <- HACHypothetical(N = N, Hstar = Hstar , probs = probs,
+   filename = "output") # outputs a CSV file called "output.csv"
>
>   ## Simulate hypothetical species - subsampling ##
>   HACSObj <- HACHypothetical(N = N, Hstar = Hstar, probs = probs,
+   perms = 1000, p = 0.95, subsample = TRUE, prop = 0.25,
+   conf.level = 0.95, filename = "output")
>
>   ## Simulate hypothetical species and all paramaters changed - subsampling ##
>   HACSObj <- HACHypothetical(N = N, Hstar = Hstar, probs = probs,
+   perms = 1, p = 0.90, subsample = TRUE, prop = 0.15, conf.level = 0.95,
+   filename = "output")
>
>   HAC.simrep(HACSObj) # runs a simulation

 Simulating haplotype accumulation...


  |
  |
  |   0%Error in HAC.sim(N = envr$N, Hstar = envr$Hstar, probs =
envr$probs, perms = envr$perms,  :
  probs must sum to 1
Calls: HAC.simrep -> HAC.sim
Execution halted
* checking PDF version of manual ... OK
* DONE

Status: 1 ERROR
See
  ‘/data/gannet/ripley/R/packages/tests-noLD/HACSim.Rcheck/00check.log’
for details.


Thanks.


Cheers,

Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] Check Results ERROR on Windows R release

2019-05-17 Thread Jarrett Phillips
Hello,

On submitting an update of my R package (HACSim), checks fail on
r-release-windows-ix86+x86_64


The updated package, in addition to improving on documentation, also fixes
a noLD error by replacing

if (sum(probs) == 1) {
   stop("probs must sum to 1")
}

with the less strict

if (!isTRUE(all.equal(1, sum(probs), tolerance =
.Machine$double.eps^0.25))) {
  stop("probs must sum to 1")
}

On viewing the check details, the following was noted:


** byte-compile and prepare package for lazy loading

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
versionCheck = vI[[j]]) :
  there is no package called 'dplyr'
Calls:  ... loadNamespace -> withRestarts -> withOneRestart
-> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package 'HACSim'


I don't know why the dplyr package creeps in, as I don't list it in my
NAMESPACE file.

Any idea on what could be going on here?


Thanks.

Cheers,

Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] (Not) Reporting minimum R version in DESCRIPTION Depends Field

2019-07-26 Thread Jarrett Phillips
Hello,

Numerous CRAN packages report minimum R versions within the Depends field
of the DESCRIPTION file.

Is this reporting always necessary?

Hadley Wickham's book "R Packages" states:

"You can also use Depends to require a specific version of R, e.g. Depends: R
(>= 3.0.1) . As with packages, it’s a good idea to play it safe and require
a version greater than or equal to the version you’re currently using.
devtools::create()  will do this for you."

devtools::check() doesn't warn about not specifying R version, so I am just
curious.


Thanks.

Cheers,

Jarrett

[[alternative HTML version deleted]]

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


[R-pkg-devel] dir() function use in R packages

2020-03-04 Thread Jarrett Phillips
Hi All,

I am updating my R package that is currently on CRAN.

I am looking to have my main package function iterate through some files in
a directory, but am having some issues.  In my function, I do the following
(I might switch to 'replicate()' instead since non-preallocated for loops
can be very slow):

file.names <- dir(path, pattern = ".fas")
for (i in 1:length(file.names)) {
   # read in DNA sequences using 'pegas' package
  seqs <- read.dna(file = file.names[i], format = "fasta")
}

However, I am uncertain how my function should handle the 'path' argument
to dir(). I could provide 'path' as an explicit argument to my function,
but is there a less direct way?

What I'm after is something like 'file.choose()', except for a folder,
rather than a file.

Has anyone implemented something similar in their R packages?

Thanks!

[[alternative HTML version deleted]]

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


[R-pkg-devel] Lost Braces in R Markdown File

2025-04-09 Thread Jarrett Phillips
Hello!

I recently ran R CMD CHECK via devtools::check_built() on my CRAN package
'VLF'. See: https://cran.r-project.org/web/checks/check_results_VLF.html.

The notes I received pertain to the below, but I am unsure exactly how to
resolve the issue after googling a bit. Any ideas?

Thanks.

Cheers,

Jarrett

-

Version: 1.1
Check: Rd files
Result: NOTE
  checkRd: (-1) aminoAcidFun.Rd:37: Lost braces
  37 | \item{ownVLFreduced}{ownVLFMatrix}{A matrix containing only
those specimen that have VLFs as well as the amino acids at the
positions that contain VLFs and NAs in all other positions of the
sequence.  Only appears if own is not NULL.}
 |   ^
  checkRd: (-1) vlfFun.Rd:36: Lost braces
  36 | \item{ownVLFreduced}{ownVLFMatrix}{A matrix containing only
those specimen that have VLFs as well as the nucleotides at the
positions that contain VLFs and NAs in all other positions of the
sequence.  Only appears if own is not NULL.}
 |

[[alternative HTML version deleted]]

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