Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

rcpp

R install.packages returns “failed to create lock directory”

January 6, 2023 by Tarik

On NFS file systems it is sometimes not obvious what things you have to close. The best way to avoid this is to use the –no-lock argument on the command line, i.e.: R CMD INSTALL –no-lock <pkg> From within R, you can do this from within your command using: install.packages(“Rcpp”, dependencies = TRUE, INSTALL_opts=”–no-lock”)

Categories r Tags package, r, rcpp Leave a comment

Where can I learn how to write C code to speed up slow R functions? [closed]

December 23, 2022 by Tarik

Well there is the good old Use the source, Luke! — R itself has plenty of (very efficient) C code one can study, and CRAN has hundreds of packages, some from authors you trust. That provides real, tested examples to study and adapt. But as Josh suspected, I lean more towards C++ and hence Rcpp. … Read more

Categories r Tags r, rcpp Leave a comment

Speed up the loop operation in R

October 16, 2022 by Tarik

Biggest problem and root of ineffectiveness is indexing data.frame, I mean all this lines where you use temp[,]. Try to avoid this as much as possible. I took your function, change indexing and here version_A dayloop2_A <- function(temp){ res <- numeric(nrow(temp)) for (i in 1:nrow(temp)){ res[i] <- i if (i > 1) { if ((temp[i,6] … Read more

Categories performance Tags loops, performance, r, r-faq, rcpp Leave a comment
Newer posts
← Previous Page1 Page2

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa