### Installing magrittr R Package Source: https://github.com/tidyverse/magrittr/blob/main/README.md Provides different methods to install the `magrittr` R package, including installing the full tidyverse suite, installing `magrittr` individually from CRAN, or installing the development version from GitHub using the `pak` package (or optionally `devtools`). Requires an R environment with internet access. ```R # The easiest way to get magrittr is to install the whole tidyverse: install.packages("tidyverse") # Alternatively, install just magrittr: install.packages("magrittr") # Or the development version from GitHub: # install.packages("devtools") pak::pak("tidyverse/magrittr") ``` -------------------------------- ### Building R Package Torch C++ Components Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This snippet shows the shell commands executed during the compilation and linking phase of installing the 'torch' R package from source. It includes multiple `g++` commands compiling C++ source files (`.cpp`) into object files (`.o`) and a final `g++` command linking these objects into a shared library (`torch.so`), along with Rscript calls for package installation tasks. It requires `g++` and the R build environment with `Rcpp`. ```Shell * installing *source* package ‘torch’ ... ** package ‘torch’ successfully unpacked and MD5 sums checked ** using staged installation ** libs g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c autograd.cpp -o autograd.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c contrib.cpp -o contrib.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c cuda.cpp -o cuda.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c device.cpp -o device.o In file included from device.cpp:2: torch_types.h:7: warning: "LANTERN_HOST_HANDLER" redefined 7 | #define LANTERN_HOST_HANDLER lantern_host_handler(); | In file included from device.cpp:1: lantern/lantern.h:35: note: this is the location of the previous definition 35 | #define LANTERN_HOST_HANDLER | In file included from device.cpp:1: lantern/lantern.h: In function ‘bool lanternInit(const string&, std::string*)’: lantern/lantern.h:4097:6: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without 4097 | bool lanternInit(const std::string &libPath, std::string *pError) | ^~~~~~~~~~~ g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c dimname_list.cpp -o dimname_list.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c dtype.cpp -o dtype.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gen-namespace.cpp -o gen-namespace.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c generator.cpp -o generator.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c indexing.cpp -o indexing.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c lantern.cpp -o lantern.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c layout.cpp -o layout.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c memory_format.cpp -o memory_format.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c nn_utils_rnn.cpp -o nn_utils_rnn.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c qscheme.cpp -o qscheme.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c quantization.cpp -o quantization.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c reduction.cpp -o reduction.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c save.cpp -o save.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c scalar.cpp -o scalar.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c storage.cpp -o storage.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c tensor.cpp -o tensor.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c tensor_list.cpp -o tensor_list.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c tensor_options.cpp -o tensor_options.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c utils.cpp -o utils.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c variable_list.cpp -o variable_list.o g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o torch.so RcppExports.o autograd.o contrib.o cuda.o device.o dimname_list.o dtype.o gen-namespace.o generator.o indexing.o lantern.o layout.o memory_format.o nn_utils_rnn.o qscheme.o quantization.o reduction.o save.o scalar.o storage.o tensor.o tensor_list.o tensor_options.o utils.o variable_list.o -L/usr/lib/R/lib -lR Renaming torch lib to torchpkg "/usr/lib/R/bin/Rscript" "../tools/renamelib.R" installing to /tmp/workdir/torch/old/torch.Rcheck/00LOCK-torch/00new/torch/libs ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices *** copying figures ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (torch) ``` -------------------------------- ### Installing R package with load error (precautionary Devel) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md This log shows the installation attempt for the 'precautionary' R package in a development environment. The installation fails during the lazy loading stage because the dependent package 'escalation' cannot be loaded due to its dependency 'trialr' being missing. ```Shell * installing *source* package ‘precautionary’ ... ** package ‘precautionary’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** demo ** exec ** inst ** byte-compile and prepare package for lazy loading Error: package or namespace load failed for ‘escalation’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): there is no package called ‘trialr’ Error: package ‘escalation’ could not be loaded Execution halted ERROR: lazy loading failed for package ‘precautionary’ * removing ‘/tmp/workdir/precautionary/new/precautionary.Rcheck/precautionary’ ``` -------------------------------- ### Ripe Package Installation Failure (R) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This R output shows the failure during the installation of the 'ripe' package from source, specifically during the 'byte-compile and prepare package for lazy loading' phase. The error message 'Error in get("is_pipe", asNamespace("magrittr")) : object 'is_pipe' not found' indicates that the package's R code attempts to access an internal object named 'is_pipe' from the 'magrittr' namespace using `get`, but this object is not found. This is likely due to changes in recent versions of 'magrittr' making 'is_pipe' unavailable or internal. ```R Error in get("is_pipe", asNamespace("magrittr")) : object 'is_pipe' not found ``` -------------------------------- ### Checking R Package Readiness - jstor CRAN Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Log output from an R CMD check run for the jstor package (CRAN version). It details numerous successful checks, including namespace, dependencies, installation, loading, and examples, indicating the package passed the standard R checks. ```R * using log directory ‘/tmp/workdir/jstor/old/jstor.Rcheck’ * using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-manual --no-build-vignettes’ * checking for file ‘jstor/DESCRIPTION’ ... OK * this is package ‘jstor’ version ‘0.3.9’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘jstor’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking R/sysdata.rda ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... ``` -------------------------------- ### Compiling R Package Source - mapdeck Devel Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Output from the installation process of the mapdeck package (Devel version) compiling C++ code. It shows g++ commands for compiling source files and ends with a fatal make error, likely due to insufficient disk space ('No space left on device') during compilation. ```Shell * installing *source* package ‘mapdeck’ ... ** package ‘mapdeck’ successfully unpacked and MD5 sums checked ** using staged installation ** libs g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c aggregate.cpp -o aggregate.o /tmp/ccZjU7ZO.s: Assembler messages: /tmp/ccZjU7ZO.s: Fatal error: can't close aggregate.o: No space left on device make: *** [/usr/lib/R/etc/Makeconf:177: aggregate.o] Error 1 ERROR: compilation failed for package ‘mapdeck’ * removing ‘/tmp/workdir/mapdeck/new/mapdeck.Rcheck/mapdeck’ ``` -------------------------------- ### Creating Functional Sequence in magrittr R Source: https://github.com/tidyverse/magrittr/blob/main/NEWS.md Demonstrates how to use the magrittr placeholder `.` as the starting point of a pipe to define a function. The resulting object `f` is a function that applies the subsequent pipe steps sequentially to its single argument. ```R f <- . %>% abs %>% mean(na.rm = TRUE) ``` -------------------------------- ### Execute R Script for Library Renaming (Shell) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md This shell command executes an R script located at `../tools/renamelib.R` using the R interpreter found at `/usr/lib/R/bin/Rscript`. This specific step is part of the 'torch' R package installation process and is used to rename the compiled shared library file (`torch.so`) to `torchpkg`. ```Shell "/usr/lib/R/bin/Rscript" "../tools/renamelib.R" ``` -------------------------------- ### Compiling R package C++ (mapdeck) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md This snippet displays the detailed commands used to compile the C++ source code of the 'mapdeck' R package. It includes compiler flags and include paths for various R/C++ libraries. The process ultimately fails with a "No space left on device" error during the compilation of 'point.cpp'. ```Shell * installing *source* package ‘mapdeck’ ... ** package ‘mapdeck’ successfully unpacked and MD5 sums checked ** using staged installation ** libs g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c aggregate.cpp -o aggregate.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c geojson.cpp -o geojson.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c mesh.cpp -o mesh.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c od.cpp -o od.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c path.cpp -o path.o g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DSTRICT_R_HEADERS -DBOOST_NO_AUTO_PTR -I"/usr/local/lib/R/site-library/BH/include" -I"/usr/local/lib/R/site-library/colourvalues/include" -I"/usr/local/lib/R/site-library/geojsonsf/include" -I"/usr/local/lib/R/site-library/geometries/include" -I"/usr/local/lib/R/site-library/jsonify/include" -I"/usr/local/lib/R/site-library/rapidjsonr/include" -I"/usr/local/lib/R/site-library/Rcpp/include" -I"/usr/local/lib/R/site-library/sfheaders/include" -I"/usr/local/lib/R/site-library/spatialwidget/include" -I../inst/include -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c point.cpp -o point.o /tmp/ccJov3g3.s: Assembler messages: /tmp/ccJov3g3.s: Fatal error: can't close point.o: No space left on device make: *** [/usr/lib/R/etc/Makeconf:177: point.o] Error 1 ERROR: compilation failed for package ‘mapdeck’ * removing ‘/tmp/workdir/mapdeck/old/mapdeck.Rcheck/mapdeck’ ``` -------------------------------- ### Defining Unary Function with Pipe R Source: https://github.com/tidyverse/magrittr/blob/main/README.md Illustrates how to create a simple unary function in R using the `magrittr` pipe operator (`%>%`) starting with the placeholder `.`. It shows that a pipeline starting with `.` effectively defines a function where `.` represents the input argument, and it's equivalent to a standard function definition chaining the operations. Requires the `magrittr` package. ```R f <- . %>% cos %>% sin # is equivalent to f <- function(.) sin(cos(.)) ``` -------------------------------- ### Checking R package dependencies (osmplotr Devel) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Output from an R package check for 'osmplotr' in a development environment. The check fails during the dependency verification step, indicating that the required package 'ggm' is not installed or available, preventing successful installation or use. ```Shell * using log directory ‘/tmp/workdir/osmplotr/new/osmplotr.Rcheck’ * using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-manual --no-build-vignettes’ * checking for file ‘osmplotr/DESCRIPTION’ ... OK * this is package ‘osmplotr’ version ‘0.3.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: ‘ggm’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### Checking R Package Dependencies - ggmsa Devel Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Log output from an R CMD check run for the ggmsa package (Devel version). It indicates an ERROR because the required package 'Biostrings' and suggested packages 'ggtree', 'seqmagick' were not available, preventing a complete check. ```R * using log directory ‘/tmp/workdir/ggmsa/new/ggmsa.Rcheck’ * using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-manual --no-build-vignettes’ * checking for file ‘ggmsa/DESCRIPTION’ ... OK * this is package ‘ggmsa’ version ‘0.0.4’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: ‘Biostrings’ Packages suggested but not available: 'ggtree', 'seqmagick' The suggested packages are required for a complete check. Checking can be attempted without them by setting the environment variable _R_CHECK_FORCE_SUGGESTS_ to a false value. See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### Calculating Item Discrimination with %>% Pipe (R) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This R snippet shows an example of using the `crt_iteman` function from the `rcrtan` package to calculate criterion-referenced item discrimination indices. It attempts to use the `magrittr` pipe (`%>%`) implicitly, which results in an error message 'no function to return from, jumping to top level'. This error suggests a problem with the pipe's internal mechanism or context when used in this specific function call within the testing environment. ```R crt_iteman(bh_depend, 2:31, 21, scale = 'raw') ``` -------------------------------- ### Using Cache with %C% Pipe (R) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This R snippet demonstrates caching random number generation using the `Cache` function from the `reproducible` package and its custom `%C%` pipe operator. It shows successful caching with the standard `Cache(func, args, ...)` syntax but fails when using the `%C%` pipe (`Cache(...) %C% func(...)`), resulting in an 'object 'split_chain' not found' error. This points to an issue with the definition or availability of internal components required by the `%C%` pipe within the package's environment. ```R tmpDir <- file.path(tempdir()) # Basic use ranNumsA <- Cache(rnorm, 10, 16, cacheRepo = tmpDir) # All same ranNumsB <- Cache(rnorm, 10, 16, cacheRepo = tmpDir) # recovers cached copy ranNumsC <- Cache(cacheRepo = tmpDir) %C% rnorm(10, 16) ``` -------------------------------- ### Compile C++ Source File for R Package (Shell) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md This shell command invokes the g++ compiler to compile a C++ source file (`.cpp`) into an object file (`.o`) as part of the R 'torch' package build process. It includes necessary include paths for R and Rcpp, specifies the C++ standard (gnu++11), enables position-independent code (`-fpic`), and sets various optimization, debugging, and security flags. ```Shell g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-jbaK_j/r-base-3.6.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o ``` -------------------------------- ### Checking R Package Dependencies - ggmsa CRAN Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Log output from an R CMD check run for the ggmsa package (CRAN version). It reports an ERROR due to missing required and suggested packages ('Biostrings', 'ggtree', 'seqmagick'), preventing the check from completing successfully. ```R * using log directory ‘/tmp/workdir/ggmsa/old/ggmsa.Rcheck’ * using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-manual --no-build-vignettes’ * checking for file ‘ggmsa/DESCRIPTION’ ... OK * this is package ‘ggmsa’ version ‘0.0.4’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: ‘Biostrings’ Packages suggested but not available: 'ggtree', 'seqmagick' The suggested packages are required for a complete check. Checking can be attempted without them by setting the environment variable _R_CHECK_FORCE_SUGGESTS_ to a false value. See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### Checking R package dependencies (osmplotr CRAN) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/failures.md Output from an R package check for 'osmplotr' on CRAN servers. Similar to the Devel check, it reports an ERROR because the package 'ggm', listed as a dependency, is not available in the CRAN environment being used for the check. ```Shell * using log directory ‘/tmp/workdir/osmplotr/old/osmplotr.Rcheck’ * using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-manual --no-build-vignettes’ * checking for file ‘osmplotr/DESCRIPTION’ ... OK * this is package ‘osmplotr’ version ‘0.3.2’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... ERROR Package required but not available: ‘ggm’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual. * DONE Status: 1 ERROR ``` -------------------------------- ### Adding Arcs to Datamaps using %>% Pipe (R) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This R snippet demonstrates how to add arcs to a datamaps object using the `add_arcs` function and the `magrittr` pipe (`%>%`). It sets up a data frame with geographical coordinates and stroke properties, then attempts to pipe this data into `datamaps` and subsequently into `add_arcs`. The code fails with an 'invalid 'envir' argument' error during evaluation within `add_arcs`, indicating a potential issue with how the pipe passes the environment or data. ```R states <- data.frame(ori.lon = c(-97.03720, -87.90446), ori.lat = c(32.89595, 41.97960), des.lon = c(-106.60919, -97.66987), des.lat = c(35.04022, 30.19453), strokeColor = c("blue", "red"), arcSharpness = c(2, 1)) states %>% datamaps(scope = "USA", default = "lightgray") %>% add_arcs(ori.lon, ori.lat, des.lon, des.lat, strokeColor) ``` -------------------------------- ### Using interlude with %>% Pipe in Dplyr Chain (R) Source: https://github.com/tidyverse/magrittr/blob/main/revdep/problems.md This R snippet demonstrates using the `interlude` function from the `tidytidbits` package within a `dplyr` pipe chain. The goal is to assign the value of column `b` to variable `x` at an intermediate step in the pipeline. The code executes the `dplyr` `mutate` calls successfully but fails at the `interlude` step with a 'subscript out of bounds' error related to accessing a 'stack'. This suggests an issue within the `interlude` function or its interaction with the pipe context. ```R x <- c() # now x exists in the calling env tibble(a=1, b=2) %>% mutate(b=a+3) %>% interlude(x <- .$b) %>% mutate(a=a+1) ``` -------------------------------- ### Using eager pipe `%>%` in magrittr R Source: https://github.com/tidyverse/magrittr/blob/main/tests/testthat/_snaps/pipe.md Demonstrates the sequential evaluation of the standard eager pipe in magrittr R. The initial value NULL is piped through functions f(), g(), and h() in order, producing output that reflects this sequence. Requires the magrittr package and defined functions f(), g(), and h(). ```R NULL %>% f() %>% g() %>% h() ``` -------------------------------- ### Using alternative pipe `%!>%` in magrittr R Source: https://github.com/tidyverse/magrittr/blob/main/tests/testthat/_snaps/pipe.md Illustrates the behavior of an alternative pipe operator `%!>%` in magrittr R. Unlike the standard eager pipe, this operator appears to process the pipeline or generate output in a different order, resulting in a reversed output sequence compared to the `%>%` pipe. Requires the magrittr package and defined functions f(), g(), and h(). ```R NULL %!>% f() %!>% g() %!>% h() ``` -------------------------------- ### Correct Conditional Logic in magrittr R Pipe Source: https://github.com/tidyverse/magrittr/blob/main/NEWS.md Provides the recommended alternative to using `return()` inside a magrittr pipe for conditional logic. Instead of `if (...) return(...)`, use a standard `if/else` structure within curly braces `{}` to control the flow and the value returned by the pipe step. ```R my_function <- function(x) { x %>% { if (.) { "true" } else { "false" } } } my_function(TRUE) #> [1] "true" ``` -------------------------------- ### Chaining Data Operations using Pipe Operator R Source: https://github.com/tidyverse/magrittr/blob/main/README.md Demonstrates the use of the `%>%` pipe operator in R to sequentially apply data manipulation functions (`read.csv`, `subset`, `transform`, `head`) to a dataset. It shows how to avoid intermediate variables and structure the operations from left-to-right, improving readability. Requires the `magrittr` package. ```R the_data <- read.csv('/path/to/data/file.csv') %>% subset(variable_a > x) %>% transform(variable_c = variable_a/variable_b) %>% head(100) ``` -------------------------------- ### Exposing Variables using Exposition Pipe R Source: https://github.com/tidyverse/magrittr/blob/main/README.md Demonstrates the use of the `%$%` exposition pipe operator in R. This operator passes the left-hand side object (typically a data frame) to the right-hand side expression, exposing its variables so they can be referenced directly by name without needing to use `data$variable` or `with(data, ...)`. Useful for functions that don't have a data argument. Requires the `magrittr` package. ```R iris %>% subset(Sepal.Length > mean(Sepal.Length)) %$% cor(Sepal.Length, Sepal.Width) #> [1] 0.3361992 data.frame(z = rnorm(100)) %$% ts.plot(z) ``` -------------------------------- ### Handling Errors/Warnings in magrittr R Pipe Source: https://github.com/tidyverse/magrittr/blob/main/NEWS.md Demonstrates the new lazy evaluation behavior in magrittr 2.0.0, which allows error and warning conditions from earlier steps in the pipe to be handled by functions in later steps, such as `try()` for errors or `suppressWarnings()` for warnings. ```R stop("foo") %>% try() warning("bar") %>% suppressWarnings() ``` -------------------------------- ### Trailing return() Exception in magrittr R Pipe Source: https://github.com/tidyverse/magrittr/blob/main/NEWS.md Illustrates a special case where using `return()` as the very last step in a magrittr pipe is allowed for backward compatibility. Note that this pattern only exits the pipeline itself, not the enclosing function scope. ```R 1 %>% identity() %>% return() ```