diff --git a/day_1_exercise/D1.3e_reading_in_and_data_inspection/index.html b/day_1_exercise/D1.3e_reading_in_and_data_inspection/index.html index 9f42b22..69e1aa2 100644 --- a/day_1_exercise/D1.3e_reading_in_and_data_inspection/index.html +++ b/day_1_exercise/D1.3e_reading_in_and_data_inspection/index.html @@ -452,7 +452,10 @@
sep = " "
) as an argument in the function.
+For example, if we have text file where the columns are separated by commas (comma-separated values or comma-delimited), you could use the function read.csv
. However, if the data are separated by a different delimiter in a text file (e.g. ":", ";", " ", "\t"), you could use the generic read.table
function and specify the delimiter (sep = " "
) as an argument in the function.
+Note: The
+"\t"
delimiter is shorthand for tab.
In the above table we refer to base R functions as being contained in the "utils" package. In addition to base R functions, we have also listed functions from some other packages that can be used to import data, specifically the "readr" package that installs when you install the "tidyverse" suite of packages.
In addition to plain text files, you can also import data from other statistical analysis packages and Excel using functions from different packages.
Indexing [ ]
can be used to extract values from a dataset as we saw earlier, but we can also use it to rearrange our data values.
teaching_team <- c("Jihe", "Mary", "Meeta", "Radhika", "Will", "Emma")
+teaching_team <- c("Jihe", "Mary", "Meeta", "Radhika", "Will", "Emma", "Heather", "Elizabeth", "Noor", "Upen")
-
+
Remember that we can return values in a vector by specifying it's position or index:
Similarly, we can extract all of the values and reorder them:
# Extracting all values and reordering them
-teaching_team[c(5, 4, 6, 2, 1, 3)]
+teaching_team[c(5, 4, 10, 6, 9, 2, 8, 1, 7, 3)]
If we want to save our results, we need to assign to a variable:
# Saving the results to a variable
-reorder_teach <- teaching_team[c(5, 4, 6, 2, 1, 3)]
+reorder_teach <- teaching_team[c(5, 4, 10, 6, 9, 2, 8, 1, 7, 3)]
Exercise
@@ -529,7 +529,7 @@ Reordering genomic data us
3. Changing default colorsa separate lesson about using color palettes from the package RColorBrewer, if you are interested.
+
- 2024-08-09
+ 2024-10-07
diff --git a/day_3_exercise/D3.2e_boxplot_exercise/index.html b/day_3_exercise/D3.2e_boxplot_exercise/index.html
index 4bdda7c..882e371 100644
--- a/day_3_exercise/D3.2e_boxplot_exercise/index.html
+++ b/day_3_exercise/D3.2e_boxplot_exercise/index.html
@@ -443,7 +443,7 @@ We have a separate lesson about using color palettes from the package RColorBrewer, if you are interested.
You are not restricted to using colors by writing them out as character vectors. You have the choice of a lot of colors in R, and you can do so by using their hexadecimal code. For example, "#FF0000" would be red and "#00FF00" would be green similarly, #FFFFFF
would be white and #000000
would be black. click here for more information about color palettes in R.
OPTIONAL Exercise: