Select Page

Data Aggregation

Data aggregation is the function where values of muttiple rows are grouped together. Hereunder the same data as in previous post. T1 T2 T3 T4 Group 4 8 12 1 3 11 14 1 1 2 7 7 5 16 4 19 13 9 13 4 1 18 20 15 4 13 20 14 19 2 9 4 16...

Read More

Basic Functions for Dataset

Dataset The dataset consist 5 variables. The T1,T2,T3 and T4 are the results on a test with marks from 1 to 20. The 5th column/variable is the group where testresult is from. T1 T2 T3 T4 Group 4 8 12 1 3 11 14 1 1 2 7 7 5 16 4...

Read More

R Data Formats

R DATA File Formats 2 main formats : RDATA RDS Why choose the propriety R data format Pros: it preserves data formats reduces file size Cons: propriety file format : not to be read in Excel for instance   One Object (RDS)...

Read More

Export Data Files

CSV Comma Delimited Writing Comma Delimited file (CSV) > write.csv(csvdata,”C:/DataFolder/csvdata.csv”)   TAB DELIMITED Writing a tab-delimited text file > write.table(txtdata,...

Read More

Import Data in R

CSV Comma Delimited Cases First row has no headers > mycsvdata <- read.csv(“c:/smallsize.csv”, header = FALSE) First row has headers > mycsvdata <- read.csv(“c:/smallsize.csv”, header = TRUE)...

Read More

Data Structures

VECTORS A vector is a object that contains a set of elements. x <- c(10,20,30,25,78) sizes <- (“XS”,”S”,”M”,”L”,”XL”) Examples on functions one can apply : frequency on vectors  ⇒ table(sizes) mean on vectors  ⇒ mean(x)...

Read More

Basics of R Programming

Equations Put your equation after the “>”-prompt > 7 + 15 – ( 2 * 4 ) The result is given after the [1]-indicator [1] 14 Operators Assigning a value towards a object is done by either “<-”...

Read More
Loading