[R] Building Packages.

Jorgen Harmse JH@rm@e @end|ng |rom roku@com
Wed Mar 20 20:02:57 CET 2024


I was thinking of making it Open Source, but I haven’t yet. It’s mostly a collection of small utility functions (more oxygen comments than actual code). I built the package on my Windows machine a few months ago, but my Mac first wouldn’t install roygen2 & devtools and now (with the latest version of R) won’t install the tarball that they create. (A work-around that I might try again is to build the package under Windows and ship the tarball to my Mac.)

Regards,
Jorgen.

Example:

#' Adjust number of columns used in printing

#'

#' Use \code{\link{options}} to determine the current number of columns, increment

#' or decrement, and pass the result as \code{width} in a second call to \code{options}.

#'

#' @param dw signed amount by which to increment the number of columns

#'

#' @return a list with the old value of \code{options('width')}

#'

#' @export



width <- function(dw) options(width = options('width')[[1L]] + as.integer(dw))


From: Duncan Murdoch <murdoch.duncan using gmail.com>
Date: Wednesday, March 20, 2024 at 12:09
To: Jorgen Harmse <JHarmse using roku.com>, Ivan Krylov <ikrylov using disroot.org>, Jorgen Harmse via R-help <r-help using r-project.org>
Subject: [EXTERNAL] Re: [R] Building Packages.
Is the source for your package online somewhere?

Duncan Murdoch

On 20/03/2024 1:00 p.m., Jorgen Harmse via R-help wrote:
> Thank you, but I think I was already using utils.
>
> Regards,
> Jorgen.
>
>
>> environment(install.packages)
>
> <environment: namespace:utils>
>
>> utils::install.packages('/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz',type='source',repos=NULL)
>
> Error in library(jhBase) : there is no package called �jhBase�
>
> Execution halted
>
> Warning in utils::install.packages("/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz",  :
>
>    installation of package �/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz� had non-zero exit status
>
>
> From: Ivan Krylov <ikrylov using disroot.org>
> Date: Wednesday, March 20, 2024 at 11:14
> To: Jorgen Harmse via R-help <r-help using r-project.org>
> Cc: Jorgen Harmse <JHarmse using roku.com>
> Subject: [EXTERNAL] Re: [R] Building Packages.
> � Wed, 20 Mar 2024 16:02:27 +0000
> Jorgen Harmse via R-help <r-help using r-project.org> �����:
>
>>> install.packages(tar,type='source',repos=NULL)
>>
>> Error in library(jhBase) : there is no package called �jhBase�
>>
>> Execution halted
>>
>> Warning in install.packages(tar, type = "source", repos = NULL) :
>>
>>    installation of package
>> �/Users/jharmse/Library/CloudStorage/OneDrive-RokuInc/jhBase_1.0.1.tar.gz�
>> had non-zero exit status
>
> Using RStudio? It happens to override install.packages with a function
> that doesn't quite handle file paths. Try utils::install.packages(tar,
> type = "source", repos = NULL).
>
> --
> Best regards,
> Ivan
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list