2 Replies Latest reply on Dec 11, 2017 12:13 PM by Vikibytes

    How to use R Packages?

    Vikibytes

      Hi team,

      I want to use R as a programming language. I am able to use Base R functions but I need to use some other libraries as well.

      Is there any way to use other R packages like Caret, dplyr?

       

      Regards,

      Vikas

        • 1. Re: How to use R Packages?
          Ratheesh_Intel

          Hi Vikas,

             

               Thanks for reaching out to us, We are very happy to help you.

           

               Please go through the steps mentioned below.

               1. Setting up R in your work environment

                    a) Edit your bash_profile using the command : vi ~/.bash_profile

                    b) Export the PATH variable as last line in the file as  : export PATH=/glob/development-tools/R/bin/:$PATH and save the file name

           

                   

                    c) Refresh the bash_profile using the command : . .bash_profile

                2. Make sure R environment is all set in your work environment by simply typing R in the console

                   

                  3. Use the command below to install the required package

                         a) install.packages('<package-name>')

                              eg : install.packages('caret')

                                  

                          b) When the prompt loads the available repositories containing the R packages please select One among them ( Recommended is 1 : 0-Cloud [https])

                             

                             

                    4.  Package installation may take much time since we need to install all the dependency packages along with the package we mentioned.

                         Once it is done please make use of the command mentioned below to import the package

                                   a) library('<package name>')

                                            eg : library('caret')

                                            

           

                             I think this will solve your problem

           

           

          Thanks & Regards

          Ratheesh A

                        

          1 of 1 people found this helpful
          • 2. Re: How to use R Packages?
            Vikibytes

            Thanks Ratheesh!