Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

R Programming: Getting Help In R

472 views

Published on

In this tutorial, you will learn the various methods of getting help for data analysis in R.

Published in: Data & Analytics
  • Be the first to comment

R Programming: Getting Help In R

  1. 1. www.r-squared.in/git-hub R2 Academy R Programming Getting Help In R
  2. 2. R2 AcademyCourse Material Slide 2 All the material related to this course are available at our website Slides can be viewed at SlideShare Scripts can be downloaded from GitHub Videos can be viewed on our Youtube Channel
  3. 3. R2 AcademyIntroduction Slide 3 Often, we get stuck while doing some analysis as either we do not know the appropriate function or the syntax. In this tutorial, we explore the various options a new user of the R language has when (s)he are confused or clueless. The methods we discuss can be broadly categorised into two sections: ● Built-in help system. ● Online information In the first section, we will discuss a bunch of functions that will allow us access to the built in help system of R. In the second section, we will look at various online sources that can supplement the built in system.
  4. 4. R2 Academy Slide 4 Built In Help System
  5. 5. R2 AcademyOutline Slide 5 In this section, we will explore the following built in functions: ● help.start() ● help() ● ? ● ?? ● help.search() ● demo() ● example() ● vignette() ● browseVignettes() ● apropos()
  6. 6. R2 Academyhelp.start() Slide 6 Description The help.start() function opens the documentation page in your browser. Here you can find manuals, reference and other materials. Syntax help.start()
  7. 7. Description The help() function returns documentation related to functions and data sets. ? is a shortcut for the help() function and returns the same information. Syntax help(topic_name) ?topic_name Example help(mean) ?mean R2 Academyhelp() Slide 7
  8. 8. Description The help.search() function will search for the specified topic in all sources of documentation and return those that match the search string. ?? is a shortcut for the help.search() function and returns the same information. Syntax help.search("topic_name") ??topic_name Example help.search("regression") ??regression R2 Academyhelp.search() Slide 8
  9. 9. R2 Academydemo() Slide 9 Description demo() function displays an interactive demonstration of certain topics provided in each R package. Typing demo() in the console will open a new window which will list the demos available in all the R packages installed.
  10. 10. R2 Academydemo() Slide 10 Syntax demo(topic_name) Example demo(scoping)
  11. 11. R2 Academyexample() Slide 11 Description example() function displays examples of the specified topic, if available. Syntax example("topic_name") Example example("mean")
  12. 12. R2 Academy Slide 12 Package Documentation
  13. 13. R2 Academylibrary() Slide 13 Description Access the documentation of a package using help inside the library function. Syntax library(help = "topic_name") Example library(help = "ggplot2") Note: The package need not be installed for accessing the documentation.
  14. 14. R2 Academyvignette() Slide 14 Description A vignette is a long form guide to a R package. You can access the vignettes available by using the vignette() function. It will open a new window with a list of vignettes available in the installed packages. Syntax vignette()
  15. 15. R2 Academyvignette() Slide 15 Syntax vignette("topic_name", package = "package_name") Example vignette("databases", package = "dplyr")
  16. 16. R2 AcademybrowseVignettes() Slide 16 browseVignettes() function is another way to access the vignettes in installed packages. It will list the vignettes in each package along with links to the web page and the R code for each vignette.
  17. 17. R2 Academyapropos() Slide 17 Description apropos() will return all the objects in the search list that match the specified topic. Syntax apropos("topic_name") Example apropos("glm")
  18. 18. R2 AcademyRSiteSearch() Slide 18 Description RSiteSearch() will search for the specified topic in help pages, vignettes and task views using the search engine at http://search.r- project.com and return the result in a browser. Syntax RSiteSearch("topic_name") Example RSiteSearch("glm")
  19. 19. R2 Academy Slide 19 Online Resources
  20. 20. R2 Academyrseek Slide 20 Description rseek is a meta search engine created by Sasha Goodman. It will return web pages that contain information related to the R topic specified. It narrows done the search and helps in locating materials related to R on the web.
  21. 21. R2 AcademyR-Bloggers Slide 21 R-Bloggers is a blog aggregator that collects content from R bloggers across the globe. It aggregates blogs written only in english. This is the first place you want to visit if you need any information regarding R and data analysis. It has content on wide range of topics and the latest content is delivered to your inbox if you subscribe. If you have a blog about R, you can share it on R-Blogger.
  22. 22. R2 AcademyStack Overflow Slide 22 Stack Overflow is a great place to visit if you are stuck with R code. Someone might have encountered the same or similar problem and shared the solution which you can use for your analysis. In case you do not find a solution, you can ask for help by providing a reproducible example of your analysis along with the codes. If you can't share the data, create a dummy data similar to what you have so that others can reproduce your analysis and provide solutions.
  23. 23. R2 AcademyNext Steps... Slide 23 In the next module: → Install/Load Packages → Update/Remove Packages → Install Packages from → GitHub → rForge → Bioconductor
  24. 24. R2 Academy Slide 24 Visit Rsquared Academy for tutorials on: → R Programming → Business Analytics → Data Visualization → Web Applications → Package Development → Git & GitHub

×