List of R functions: Difference between revisions
Jump to navigation
Jump to search
(new page for finding R functions) |
mNo edit summary |
||
| Line 10: | Line 10: | ||
! functionality | ! functionality | ||
|----- | |----- | ||
| c | | c() | ||
| "combine" elements to a vector | | "combine" elements to a vector | ||
|----- | |----- | ||
| array | | array() | ||
| creates arrays | | creates arrays | ||
|----- | |----- | ||
| data.frame | | data.frame() | ||
| creates data.frames | | creates data.frames | ||
|----- | |----- | ||
| list | | list() | ||
| creates lists | | creates lists | ||
|----- | |----- | ||
| mean | | mean() | ||
| mean of the elements of the input vector | | mean of the elements of the input vector | ||
|----- | |----- | ||
| sd | | sd() | ||
| standard deviation of the elements of the input vector | | standard deviation of the elements of the input vector | ||
|----- | |----- | ||
| cor | | cor() | ||
| correlation | | correlation | ||
|----- | |----- | ||
| quantile | | quantile() | ||
| quantiles | | quantiles | ||
|----- | |----- | ||
| read.table | | read.table() | ||
| reads delimited text files | | reads delimited text files | ||
|----- | |----- | ||
| write.table | | write.table() | ||
| writes delimited text files | | writes delimited text files | ||
|----- | |----- | ||
| save | | save() | ||
| save R objects | | save R objects | ||
|----- | |----- | ||
| load | | load() | ||
| load R objects | | load R objects | ||
|----- | |----- | ||
| apply, tapply, lapply | | apply(), tapply(), lapply() | ||
| functions for applying functions over set margins, apply is for arrays, tapply for data.frames and lapply for lists | | functions for applying functions over set margins, apply is for arrays, tapply for data.frames and lapply for lists | ||
|----- | |----- | ||
| merge | | merge() | ||
| merges two data.frames, equivalent of SQL joins | | merges two data.frames, equivalent of SQL joins | ||
|----- | |----- | ||
| order | | order() | ||
| sorts data by given factors, output is an indexing vector | | sorts data by given factors, output is an indexing vector | ||
|----- | |----- | ||
| library | | library() | ||
| loads packages | | loads packages | ||
|} | |||
== Workspace and help == | |||
{|{{prettytable}} | |||
|+ '''Some basic R functions''' | |||
! function name | |||
! functionality | |||
|----- | |||
| getwd() | |||
| get working directory | |||
|----- | |||
| setwd(dir) | |||
| set working directory to ''dir'' | |||
|----- | |||
| help(topic), ?topic | |||
| get help on ''topic'', usually function name | |||
|----- | |||
| help.search("keyword") | |||
| search for help | |||
|----- | |||
| help.start() | |||
| HTML help start page | |||
|----- | |||
| demo() | |||
| list available demonstrations | |||
|----- | |||
| save(..., file), load(file) | |||
| save and load objects | |||
|----- | |||
| savehistory(file), loadhistory(file) | |||
| save and load command history | |||
|----- | |||
| source(file) | |||
| execute commands from ''file'' | |||
|----- | |||
| list.files(dir), dir(dir) | |||
| list files in directory ''dir'' | |||
|----- | |||
| q() | |||
| quit R | |||
|} | |} | ||
Revision as of 11:20, 3 May 2011
This page is a encyclopedia article.
The page identifier is Op_en5140 |
|---|
| Moderator:Nobody (see all) Click here to sign up. |
| This page is a stub. You may improve it into a full page. |
| Upload data
|
This page contains listings of some R functions and commands by category.
Basics
| function name | functionality |
|---|---|
| c() | "combine" elements to a vector |
| array() | creates arrays |
| data.frame() | creates data.frames |
| list() | creates lists |
| mean() | mean of the elements of the input vector |
| sd() | standard deviation of the elements of the input vector |
| cor() | correlation |
| quantile() | quantiles |
| read.table() | reads delimited text files |
| write.table() | writes delimited text files |
| save() | save R objects |
| load() | load R objects |
| apply(), tapply(), lapply() | functions for applying functions over set margins, apply is for arrays, tapply for data.frames and lapply for lists |
| merge() | merges two data.frames, equivalent of SQL joins |
| order() | sorts data by given factors, output is an indexing vector |
| library() | loads packages |
Workspace and help
| function name | functionality |
|---|---|
| getwd() | get working directory |
| setwd(dir) | set working directory to dir |
| help(topic), ?topic | get help on topic, usually function name |
| help.search("keyword") | search for help |
| help.start() | HTML help start page |
| demo() | list available demonstrations |
| save(..., file), load(file) | save and load objects |
| savehistory(file), loadhistory(file) | save and load command history |
| source(file) | execute commands from file |
| list.files(dir), dir(dir) | list files in directory dir |
| q() | quit R |
Statistical tests
| function name | functionality |
|---|---|
| t.test | en:Student's t-test |
| aov | en:Analysis of variance |