Skip to content

Commit

Permalink
fixes 292
Browse files Browse the repository at this point in the history
  • Loading branch information
ytakemon committed Oct 2, 2024
1 parent ff44a81 commit 4752cd1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions episodes/03-basics-factors-dataframes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,15 @@ these columns, as well as mean, median, and interquartile ranges. Many of the
other variables (e.g. `sample_id`) are treated as characters data (more on this
in a bit).

There is a lot to work with, so we will subset the first three columns into a
new data frame using the `data.frame()` function. To subset/index a two dimensional
variable, we need to define them on the appropriate side of the brackets. The left
hand side of the comma indicates the rows you want to subset, and the right is the
column position (e.g. ["row index", "column index"]).
There is a lot to work with, so we will subset the columns into a new data frame using
the `data.frame()` function. To subset/index a two dimensional variable, we need to
define them on the appropriate side of the brackets. The left hand side of the comma
indicates the rows you want to subset, and the right is the column position
(e.g. ["row index", "column index"]).

Let's put the columns 1, 2, 3, and 6 into a new data frame called subset:

```{r, purl=FALSE}
## put the first three columns of variants into a new data frame called subset
## Notice that we are wrapping the numbers in a c() function, to indicate a vector
## in the right hand side of the comma.
subset <- data.frame(variants[, c(1:3, 6)])
Expand Down

0 comments on commit 4752cd1

Please sign in to comment.