Importing and sorting the data in R

Most of the datasets come in TSV/CSV/XLXS format. For the XLXS format we first converted it to CSV using Excel's Save As.

Importing table data:

data <- read.table(file.choose(), sep = '\t', header = TRUE)

This will open up a modal in which we can choose the file. The dataframe will be named data and we can access it later by just typing data. This piece is for loading TSV(Tab separated) files, hence sep = '\t'. For CSV files we need to change it to sep = ','(Comma Separated).

Filtering data:

new_data <- filter(data, condition)

Here filter will return a new dataframe that contains only the entries that satisfy the condition. For example, if data has a column titled brain_avg and condition is brain_avg > 5000, then new_data will contain only the rows from the original dataframe that have brain_avg > 5000

Sorting data:

sorted_data <- arrange(data, brain_avg)

This will sort the data by brain_avg and save it to sorted_data. We can add extra conditions at the end if we want.