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!
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. 👍❤️❤️
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.
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?
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!
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?
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
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
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?
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
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.
@@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```
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)
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.
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.
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?
@@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.
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
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
@@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.
You are a productivity machine. I don't know how you make time for all these videos but thank you!
My pleasure! Thanks for watching 🤓
This is the best explanation ever! Great job!
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!
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. 👍❤️❤️
Wonderful - I’m glad you got something out of the video! 🤓
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.
Hah!
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?
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
@@Riffomonas I think that would be a great series.
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!
Great vid! How to activate the conda environment inside RStudio? So without calling RStudio from terminal.
I would love to know too!
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?
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
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
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?
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
Thank you for this.
My pleasure! I’m glad you found it useful 🤓
you can automatically create a .yaml file to share the environment using conda ```conda env export --name ENVNAME > envname.yml```
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.
@@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```
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)
anyone else - I just tried saving it in the general miniconda3/envs/ folder and it worked
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.
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.
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?
@@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.
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
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
@@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.