Skip to main content

What I did to use git with Rstudio on Ubuntu 16.04 and Elementary OS Loki.


This article was updated on July 7 2018.

Before installing anything I signed up on https://github.com/ and created my R-ANALYTICS repository:


Now the installation and setup.

1. I installed git on Ubuntu, from a terminal window:

$ sudo apt-get update
$ sudo apt-get install git

2.- I configured git:

I did this through the git config command.
I provided my name and email address because git embeds this information into each commit.
Open a terminal and run:

$ git config --global user.name "Your Name" --> This is part of your link: https://github.com/LaranIkal, you see, my name is LaranIkal
$ git config --global user.email "youremail@domain.com"

To see all of the configuration items just type:

$ git config --list

As a note, it is saved to a file called ~/.gitconfig in your home folder.

Steps In Rstudio:


1.- Checking/Setting Rstudio right configuration to use Git/SVN: Menu→Tools→Global Options
Select GIT/SVN tab at the end of the below screen shot is the sample.

Now check the values:

My git executable is in:
laranikal@Analytics:/usr/bin$ ls -ltr git
-rwxr-xr-x 1 root root 1866896 oct 4 13:22 git

svn is not there but, Rstudio ise setup like that and since I am using git, I do not care about svn.
laranikal@Analytics:/usr/bin$ ls -ltr svn
ls: cannot access 'svn': No such file or directory



On Elementary OS Loki, I got the window below, so everything was done without any additional configuration, the thing is that rstudio detected git automatically:





3.- Now I created my project:

Note. To import a created project is the same process, it is just that the project files are already created and they are imported into your project folder.


On Rstudio go to File→ New Project

The next screen is showed, select Version Control:


Select git on the next screen:


Switch to the browser to get the https address of my project:


Clicking on the small icon
to the right will copy the address to the clipboard.


Now I pasted it to my new project repository URL:
The project directory name was setup automatically after pasting the URL.
The last step was to browse to the folder I wanted to clone my git repository into and clicked Create Project button.

Now I created new files:


Then I committed them: Menu → Tools → Version Control → Commit 

Select the document to be committed, enter a commit message and click the Commit button to the right:
This will commit to the local git repository on the hard drive.




Click close button on the right up side. And close the commit window.





Now it is needed to push the changes to git site.
Open a terminal window in the project local folder, type git push command and press enter:

After pressing enter git asks for user and password and, commit changes:


After this I can see my changes in my git repository on the web browser:



As additional information, I just found this site that may be helpful for the R users:

http://happygitwithr.com



Enjoy it!!!.

Carlos Kassab




Popular posts from this blog

UPDATED: Using R and H2O to identify product anomalies during the manufacturing process.

Note.  This is an update to article:  http://laranikalranalytics.blogspot.com/2019/03/using-r-and-h2o-to-identify-product.html - It has some updates but also code optimization from  Yana Kane-Esrig(  https://www.linkedin.com/in/ykaneesrig/ ) , as she mentioned in a message: The code you posted has two nested for() {} loops. It took a very long time to run. I used just one for() loop. It was much faster   Here her original code: num_rows=nrow(allData) for(i in 1:ncol(allData)) {   temp = allData [,i]   cat( "Processing column:", i, ", number missing:", sum( is.na(temp)), "\n" )    temp_mising =is.na( allData[, i])    temp_values = allData[,i][! temp_mising]    temp_random = sample(temp_values, size = num_rows, replace = TRUE)      temp_imputed = temp   temp_imputed[temp_mising]= temp_random [temp_mising]   # describe(temp_imputed)   allData [,i] = temp_imputed      cat( "Processed column:", i, ", number missing:", sum( is.na(allData [,i

Using R and H2O Isolation Forest to identify product anomalies during the manufacturing process.

Note.  - This article  has some improvements from  Yana Kane-Esrig(  https://www.linkedin.com/in/ykaneesrig/  ) , mentioned in this article:  http://laranikalranalytics.blogspot.com/2021/03/updated-using-r-and-h2o-to-identify.html Introduction: We will identify anomalous units on the production line by using measurements data from testing stations and Isolation Forest model. Anomalous products are not failures, anomalies are units close to measurement limits, so we can display maintenance warnings before the station starts to make scrap. Before starting we need the next software installed and working: -  R language installed. -  H2O open source framework. - Java 8 ( For H2O ). Open JDK:  https://github.com/ojdkbuild/contrib_jdk8u-ci/releases -  R studio. Get your data. About the data: Since I cannot use my real data, for this article I am using  SECOM Data Set from UCI Machine Learning Repository      I downloaded SECOM data to /tmp How many records?:  Traini

Installing our R development environment on Ubuntu 20.04

  Step 1: Install R,  Here the link with instructions:  How to instal R on Ubuntu 20.04 Adding the steps I followed because sometimes the links become unavailable: Add GPG key: $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 Output: Executing: /tmp/apt-key-gpghome.NtZgt0Un4R/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 gpg: key 51716619E084DAB9: public key "Michael Rutter " imported gpg: Total number processed: 1 gpg: imported: 1 Add repository: $ sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' Output: Hit:1 https://deb.opera.com/opera-stable stable InRelease Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease Hit:3 http://archive.canonical.com/ubuntu focal InRelease