> cars #Display one of the datasets: see ?car for more information > library(datasets) #Load the datasets package (actually, it has probably been loaded already) the "datasets" package is installed by default and provides useful example data Once you have installed a package, you can load it into R at any time by using the library() function. There is a central place (called "CRAN") from where you can download most additional packages. ![]() To make a package available to R, you need to download it and install it somewhere on your system. Packages are, for example, which allow you to analyse genetic data, to interface to geographical information systems, for economic analysis, and so forth. However, one of the strengths of R is the variety of additional packages that are available. In total, the default packages allow you to do a considerable amount of statistics. These include the "base" package (which is where the max() and sqrt() functions are defined), the "utils" package (which is where RSiteSearch() and citation() are defined), the "graphics" package (which allows plots to be generated), and the "stats" package (which provides a broad range of statistical functionality). Some packages should always be available within R, and a number of these are automatically loaded at the start of an R session. ![]() To use the contents of a package, it must be made available to R, then loaded into your R session. For example, Figure 1.1 is based on data from the "datasets" package. These are actually provided by a variety of separate packages. The strength and depth of R comes from the various functions and other objects which are provided for your use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |