How to create a conda or mamba environment for R programming to enhance reproducibility (CC230)

Поделиться
HTML-код
  • Опубликовано: 21 авг 2024
  • НаукаНаука

Комментарии • 33

  • @stretch8390
    @stretch8390 2 года назад +6

    You are a productivity machine. I don't know how you make time for all these videos but thank you!

    • @Riffomonas
      @Riffomonas  2 года назад

      My pleasure! Thanks for watching 🤓

  • @arslantariqable
    @arslantariqable 2 года назад +3

    I knew the conda environment and its usefulness regarding tools installation, but I didn't know about its use for reproducibility for data analysis.
    Thanks for giving such great information. Keep it up. 👍❤️❤️

    • @Riffomonas
      @Riffomonas  2 года назад

      Wonderful - I’m glad you got something out of the video! 🤓

  • @exotoxinslab
    @exotoxinslab Год назад

    This is one of the best videos for reproducibility I have seen! 🥳 Thank you so much! I was about to give up the use of several programming languages in our projects, because a lot of blogs report that R is not compatible with Conda environments 🙄. And thank you for the warning about mixing renv with conda... I was about to do that!

  • @MLesp
    @MLesp 5 месяцев назад

    This is the best explanation ever! Great job!

  • @dmalarekable
    @dmalarekable 2 года назад +2

    It is great that you show us not only how to analize the data in RStudio but also more complicated things like environments and version control. Thank you for that.
    I wrote a few custom functions for my microbial data analyses that I use with different datasets and I think that it would be interesting to see how to make custom R package and post it online. Or maybe there is another way to use custom functions in different projects in R?

    • @Riffomonas
      @Riffomonas  2 года назад +3

      I love integrating different concepts! I’ve thought about putting up a package through a series. Let me see what I can come up with

    • @kylelima6768
      @kylelima6768 2 года назад

      @@Riffomonas I think that would be a great series.

  • @marbacc
    @marbacc Год назад +1

    Thank you for the information.
    By the way I stopped and paused the video on 7:02 and forgot to close it. After a few hours I come back and I thought I was watching Mr. Robot.

  • @caseyj1144
    @caseyj1144 Год назад +3

    you can automatically create a .yaml file to share the environment using conda ```conda env export --name ENVNAME > envname.yml```

    • @Riffomonas
      @Riffomonas  Год назад +1

      Thanks Casey! Yeah that's available. I find that is a less desirable approach because the output file is so verbose. When I just ran it the yml file was 350+ lines long! I prefer the compact format where I can quickly look at what is being installed. Your suggested approach is great if you don't plan on actually looking at the contents of the file.

    • @charleslehnen9636
      @charleslehnen9636 Год назад

      @@Riffomonas not sure if this is an identical output from the one produced by CaseyJ's method or not, but I always use ```conda list --export > requirements.txt```

  • @tolga1292
    @tolga1292 9 месяцев назад

    Great vid! How to activate the conda environment inside RStudio? So without calling RStudio from terminal.

    • @Riffomonas
      @Riffomonas  5 месяцев назад +1

      I would love to know too!

  • @SriramaBhamidipati
    @SriramaBhamidipati 2 года назад +1

    Thank you for this.

    • @Riffomonas
      @Riffomonas  2 года назад

      My pleasure! I’m glad you found it useful 🤓

  • @zhaoxiang3998
    @zhaoxiang3998 Год назад

    Very clear video. Just one question, if we are not recommended to install packages in R, everytime we need one package we need to quit R to install it via mamba? then the data analysis process can always be interrupted? any solution for this?

  • @user-rf9ow8ck2l
    @user-rf9ow8ck2l Месяц назад

    One of the frustrating limitations of the conda approach for R is that only a fraction of the packages in CRAN are compiled and installable via conda. Other packages are not in CRAN and its not clear how to install those via conda. Any thoughts on this?

    • @Riffomonas
      @Riffomonas  Месяц назад

      I have found that the major packages are available in one of the conda collections. It's not a horrible process to contribute a conda package if you need to. This SO link is somewhat helpful stackoverflow.com/questions/52061664/install-r-package-from-github-using-conda

  • @TURALOWEN
    @TURALOWEN Год назад

    Thank you for the video! Quick question: whenever I try to create env with both tidyverse and tidymodels, it says "Found conflicts! Looking for incompatible packages.
    This can take several minutes. Press CTRL-C to abort." and then tries to solve it, but never manages to solve it. Do you have a solution for this? Thank you!

  • @ahmed007Jaber
    @ahmed007Jaber 2 года назад +1

    Hey Pat, I am having this issue and wonder what you suggest.
    been experiencing a weird issue. when I am using regex with arabic text and mutate a column I am getting nulls
    the issue I used the same approach with the same data set on my other laptop and it worked like a charm
    an addition to this grepl works fine in the faulty laptop
    any ideas?
    I am trying to figure out a way that copy:
    rstudio confirgrations
    locale configrations
    and implement those into my "faulty" laptop

    • @Riffomonas
      @Riffomonas  2 года назад

      Sorry I’m not really sure. A google search got me this which I wonder if it will be helpful stackoverflow.com/questions/66586955/r-using-str-detect-function-with-arabic-text-or-other-right-to-left-languages

  • @caseyj1144
    @caseyj1144 Год назад

    I'm a bit lost on what directory the .Rprofile file should be in to correct the issue with tidyverse. (Also, I am working on a Windows computer and writing out the notes that are different if you do want to make a version for Windows I'd be happy to send them)

    • @caseyj1144
      @caseyj1144 Год назад

      anyone else - I just tried saving it in the general miniconda3/envs/ folder and it worked

    • @Riffomonas
      @Riffomonas  Год назад +1

      I'd think the .Rprofile file should be in the project root directory. Putting it in miniconda3/envs/ won't be portable if you share your code with someone else.

  • @filhodaanaedozizin4331
    @filhodaanaedozizin4331 Год назад

    Thank you, this is very useful indeed. Is there a way to add RStudio into dependencies? I tried with "rstudio-desktop" but it gave me "nothing provides requested rstudio-desktop". Same message when I tried to define the python version as "python=2.7" under dependencies.

    • @Riffomonas
      @Riffomonas  Год назад

      Are you possibly using a windows computer? It looks like the rstudio-desktop conda package only works on mac or linux. I suspect most people use a different IDE from RStudio if they're using conda environments anaconda.org/conda-forge/rstudio-desktop For python can you maybe try removing the version number and see what version it selects based on the other dependencies?

    • @filhodaanaedozizin4331
      @filhodaanaedozizin4331 Год назад

      @@Riffomonas thanks! I'm using Mac (M1) and don't have any RStudio installed either. The rstudio-desktop should have worked, but for whatever reason it didn't. Full disclosure, this is a brand new laptop and I installed miniconda. It could be the I have something missing in my laptop, but the error message doesn't say that. For python, if I don't give the version number it will use the (base) version.

    • @filhodaanaedozizin4331
      @filhodaanaedozizin4331 Год назад

      Would it make sense for me to activate my R env and, then, install RStudio from the downloadable file from their website? It's not critical that I define it in the yml dependencies, but it needs to run with what's installed in the R env

    • @Riffomonas
      @Riffomonas  Год назад +1

      I don't recommend using renv with conda. To get Rstudio to use your conda environment, you can go to your terminal and navigate to your project directory. From there, you can type "open project.Rproj" or "open my_file.R" and Rstudio will launch using your environment. To double check, you can run .libPaths() at the R prompt and you should see the path to your environment

    • @filhodaanaedozizin4331
      @filhodaanaedozizin4331 Год назад

      @@Riffomonas thanks again. Because I'm using Apple M1 silicon, I (painfully) learned that I first need to install miniforge (miniconda and anaconda apparently won't work properly), then I have to create env that run with compatibility with Intel osx-64 (CONDA_SUBDIR=osx-64 mamba env create -f config_env_r.yml). By following these steps, my M1 Macbook doesn't have compatibility issues with packages developed for Intel chip.