r:getting_started
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| r:getting_started [2016/09/07 16:31] – [Getting help from functions] hkimscil | r:getting_started [2021/03/02 09:48] (current) – [A trial] hkimscil | ||
|---|---|---|---|
| Line 22: | Line 22: | ||
| | Suse | R-base | | Suse | R-base | ||
| Use the system’s package manager to download and install the package. Normally, you will need the root password or sudo privileges; otherwise, ask a system administrator to perform the installation. | Use the system’s package manager to download and install the package. Normally, you will need the root password or sudo privileges; otherwise, ask a system administrator to perform the installation. | ||
| + | ====== Rstudio ====== | ||
| + | [[https:// | ||
| + | [[https:// | ||
| ====== Starting R ====== | ====== Starting R ====== | ||
| Line 33: | Line 36: | ||
| __Linux or Unix__ | __Linux or Unix__ | ||
| * Start the R program from the shell prompt using the R command (uppercase R). | * Start the R program from the shell prompt using the R command (uppercase R). | ||
| + | ====== A trial ====== | ||
| + | < | ||
| + | library(NRAIA) | ||
| + | detach(package: | ||
| + | </ | ||
| + | < | ||
| + | summary(trees) | ||
| + | boxplot(trees) | ||
| + | pair(trees) | ||
| + | </ | ||
| + | < | ||
| + | plot(dist~speed, | ||
| + | m.cars <- lm(dist ~ speed, data=cars) | ||
| + | m.cars | ||
| + | summary(m.cars) | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | summary(chickwts) | ||
| + | boxplot(weight~feed, | ||
| + | anova(lm(weight~feed, | ||
| + | m.chck <- aov(weight~feed, | ||
| + | m.chck | ||
| + | summary(m.chck) | ||
| + | </ | ||
| + | ---- | ||
| + | [[:t-test]] | ||
| + | [[:ANOVA]] | ||
| + | [[: | ||
| + | [[: | ||
| + | [[: | ||
| + | [[:Multiple regression]] | ||
| + | ---- | ||
| ====== Entering commands ====== | ====== Entering commands ====== | ||
| < | < | ||
| Line 110: | Line 146: | ||
| < | < | ||
| < | < | ||
| + | < | ||
| + | |||
| + | mean> x <- c(0:10, 50) | ||
| + | |||
| + | mean> xm <- mean(x) | ||
| + | |||
| + | mean> c(xm, mean(x, trim = 0.10)) | ||
| + | [1] 8.75 5.50 | ||
| + | </ | ||
| + | |||
| + | see [[https:// | ||
| + | |||
| + | < | ||
| + | Murder Assault UrbanPop Rape | ||
| + | 7.42 167.60 66.20 20.16 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Murder Assault UrbanPop Rape | ||
| + | 7.42 167.60 66.20 20.16 | ||
| + | </ | ||
| + | see [[https:// | ||
| + | |||
| + | ====== Searching via Keywords ====== | ||
| + | < | ||
| + | * A typical pattern is a function name or keyword. | ||
| + | * Notice that it must be enclosed in quotation marks. | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | ====== Getting help on a package ====== | ||
| + | < | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | Error: could not find function " | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Installing package into ‘D:/ | ||
| + | (as ‘lib’ is unspecified) | ||
| + | --- Please select a CRAN mirror for use in this session --- | ||
| + | trying URL ' | ||
| + | Content type ' | ||
| + | downloaded 313 KB | ||
| + | |||
| + | package ‘tseries’ successfully unpacked and MD5 sums checked | ||
| + | |||
| + | The downloaded binary packages are in | ||
| + | C: | ||
| + | > help(package=" | ||
| + | > | ||
| + | </ | ||
| + | {{help.package.jpg}} | ||
| + | ====== Searching the Web for help ====== | ||
| + | < | ||
| + | ====== Finding Relevant Functions and Packages ====== | ||
| + | * Visit the list of task views at http:// | ||
| + | * Visit [[http:// | ||
| + | * To find relevant functions, visit http:// | ||
r/getting_started.1473235287.txt.gz · Last modified: by hkimscil
