From 4f9b072f7669087b39b2047b062cb465ca64984a Mon Sep 17 00:00:00 2001 From: Tim Dennis Date: Wed, 16 Mar 2016 15:21:26 -0700 Subject: [PATCH 1/2] correcting numbered list markdown --- 02-starting-with-data.Rmd | 6 +- 02-starting-with-data.html | 190 +++++++++++++++++++------------------ 2 files changed, 102 insertions(+), 94 deletions(-) diff --git a/02-starting-with-data.Rmd b/02-starting-with-data.Rmd index c37c363..d985469 100644 --- a/02-starting-with-data.Rmd +++ b/02-starting-with-data.Rmd @@ -67,9 +67,9 @@ head(metadata) ``` We've just done two very useful things. -1. We've read our data in to R, so now we can work with it in R -2. We've created a data frame (with the read.csv command) the -standard way R works with data. + +1. We've read our data in to R, so now we can work with it in R. +2. We've created a data frame (with the read.csv command) the standard way R works with data. # What are data frames? diff --git a/02-starting-with-data.html b/02-starting-with-data.html index ebc7b6f..a9c6c62 100644 --- a/02-starting-with-data.html +++ b/02-starting-with-data.html @@ -7,22 +7,23 @@ + Starting with data - + - - - - + + + + - - + + + +
+ + + + + + + + + + + +

What are data frames?

@@ -239,94 +291,50 @@

Factors

We can see the names of the multiple columns. And, we see that some say things like Factor w/ 30 levels

When we read in a file, any column that contains text is automatically assumed to be a factor. Once created, factors can only contain a pre-defined set values, known as levels. By default, R always sorts levels in alphabetical order.

For instance, we see that cit is a Factor w/ 3 levels, minus, plus and unknown.

- +## 1 4 2 2 +
barplot(table(exprmt))
+

+
exprmt <- factor(exprmt, levels=c("treat1", "treat2", "treat3", "control"))
+barplot(table(exprmt))
+

—>

+ + + From 4423986871d8d8d6fa471d8358214e848fb56c87 Mon Sep 17 00:00:00 2001 From: Tim Dennis Date: Thu, 17 Mar 2016 12:51:44 -0700 Subject: [PATCH 2/2] reverting html on change --- 02-starting-with-data.html | 190 ++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 99 deletions(-) diff --git a/02-starting-with-data.html b/02-starting-with-data.html index a9c6c62..ebc7b6f 100644 --- a/02-starting-with-data.html +++ b/02-starting-with-data.html @@ -7,23 +7,22 @@ - Starting with data - + - - - - + + + + - - + + - -
- - - - - - - - - - - -

What are data frames?

@@ -291,50 +239,94 @@

Factors

We can see the names of the multiple columns. And, we see that some say things like Factor w/ 30 levels

When we read in a file, any column that contains text is automatically assumed to be a factor. Once created, factors can only contain a pre-defined set values, known as levels. By default, R always sorts levels in alphabetical order.

For instance, we see that cit is a Factor w/ 3 levels, minus, plus and unknown.

-

<!–

-

You can check this by using the function levels(), and check the number of levels using nlevels():

-
levels(citrate)
-nlevels(citrate)
-

Sometimes, the order of the factors does not matter, other times you might want to specify the order because it is meaningful (e.g., “low”, “medium”, “high”) or it is required by particular type of analysis. Additionally, specifying the order of the levels allows to compare levels:

-
expression <- factor(c("low", "high", "medium", "high", "low", "medium", "high"))
+
+
+