Download presentation
Presentation is loading. Please wait.
Published byLucas Wilkins Modified over 9 years ago
1
Data Objects in R Vector1 dimensionAll elements have the same data types Data types: numeric, character logic, factor Matrix2 dimensions Array2 or more dimensions Data frame2 dimensionstable-like data object allowing different data types for different columns ListCollection of data objects, each element of a list is a data object
2
Manipulating Data Objects Creating c(), rep(), seq() numeric(),character(),factor(),logical() matrix(), array(), data.frame(), list() Saving Loading save(), load() (internal data file ) Importing Exporting read.table(), write.table() (external data file) Converting as.numeric(),as.character(),as.factor(),as.logical() as.matrix(), as.array(), as.data.frame(), as.list() Naming Indexing Selecting names(), clonames(), rownames() [ i ] (for vector), [ i, j] (for matrix and data frame), [ i, j, k, …] (for array), [ [ k ] ] (for list) j, k, can be integer or character or logical index Combining c(), paste(), cbind(), rbind(), merge() Sorting order() Misc. class(), length(), dim(), nrow(), ncol() ………
3
How to get help in R? Go to http://www.r-project.org/ and read onlinehttp://www.r-project.org/ If you know the function name, type help(the name) in R, e.g. help(anova) If you just know the topic and don’t know the exact function name(s), type help.search(“the topic”) in R, e.g. help.search(“Fisher exact test”) Google it …
4
How to run R? Interactive mode (run code after entering R) Entering RWindows: click R icon MS-DOS: type R Linux: type R After entering Type and run code line by line Or type and paste and run multiple lines Or type source(“your code file”) Batch mode (run code without entering R) Only for MS-DOS or Linux Type R –no-save < your_code_file &
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.