Skip to content

Commit 8616117

Browse files
committed
markdown source builds
Auto-generated via `{sandpaper}` Source : 3d5460c Branch : main Author : Naupaka Zimmerman <[email protected]> Time : 2024-12-09 23:12:53 +0000 Message : Merge pull request #304 from ytakemon/rbasics_issues Working pull request to address remaining rbasics issues
1 parent 1424311 commit 8616117

File tree

4 files changed

+1094
-6
lines changed

4 files changed

+1094
-6
lines changed

01-r-basics.md

+30-5
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,27 @@ In the 'Environment' window you will also get a table:
144144
The 'Environment' window allows you to keep track of the objects you have
145145
created in R.
146146

147+
148+
::::::::::::::::::::::::::::::::::::::::: callout
149+
150+
## Tip: Use of white space for readability
151+
152+
The white spaces surrounding the assignment operator `<-` in the example
153+
above (`first_value <- 1`) are unnecessary. However, including them does make your code
154+
easier to read. There are several style guides you can follow, and choosing
155+
one is up to you, but consistency is key!
156+
157+
A style guide we recommend is the Tidyverse [style guide](https://style.tidyverse.org/).
158+
159+
As they say:
160+
161+
"Good coding style is like correct punctuation: you can manage without it, butitsuremakesthingseasiertoread."
162+
163+
::::::::::::::::::::::::::::::::::::::::::::::::::
164+
165+
166+
167+
147168
::::::::::::::::::::::::::::::::::::::: challenge
148169

149170
## Exercise: Create some objects in R
@@ -193,8 +214,9 @@ Here are some important details about naming objects in R.
193214
a colored highlight or RStudio gives you a suggested autocompletion you have
194215
chosen a name that has a reserved meaning.
195216
- **Use the recommended assignment operator**: In R, we use '\<- ' as the
196-
preferred assignment operator. '=' works too, but is most commonly used in
197-
passing arguments to functions (more on functions later). There is a shortcut
217+
preferred assignment operator, which is recommended by the Tidyverse
218+
[style guide](https://style.tidyverse.org/) discussed above. '=' works too, but is most
219+
commonly used in passing arguments to functions (more on functions later). There is a shortcut
198220
for the R assignment operator:
199221
- Windows execution shortcut: <KBD>Alt</KBD>\+<KBD>\-</KBD>
200222
- Mac execution shortcut: <KBD>Option</KBD>\+<KBD>\-</KBD>
@@ -900,16 +922,19 @@ the vector you are searching:
900922
# current value of 'snp_genes':
901923
# chr [1:7] "OXTR" "ACTN3" "AR" "OPRM1" "CYP1A1" NA "APOA5"
902924

903-
# test to see if "ACTN3" or "APO5A" is in the snp_genes vector
925+
# test to see if "ACTN3", "APO5A", or "actn3" is in the snp_genes vector
904926
# if you are looking for more than one value, you must pass this as a vector
905927

906-
c("ACTN3","APOA5") %in% snp_genes
928+
c("ACTN3","APOA5", "actn3") %in% snp_genes
907929
```
908930

909931
``` output
910-
[1] TRUE TRUE
932+
[1] TRUE TRUE FALSE
911933
```
912934

935+
Notice that the gene "actn3" is FALSE? This is because character vectors are case sensitive, so
936+
keep this in mind when subsetting and selecting values from a character vector.
937+
913938
::::::::::::::::::::::::::::::::::::::::: callout
914939

915940
## Tip: What's the difference between the `%in% and the `==` operators?

config.yaml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#------------------------------------------------------------
2+
# Values for this lesson.
3+
#------------------------------------------------------------
4+
5+
# Which carpentry is this (swc, dc, lc, or cp)?
6+
# swc: Software Carpentry
7+
# dc: Data Carpentry
8+
# lc: Library Carpentry
9+
# cp: Carpentries (to use for instructor training for instance)
10+
# incubator: The Carpentries Incubator
11+
carpentry: 'dc'
12+
13+
# Overall title for pages.
14+
title: 'Intro to R and RStudio for Genomics'
15+
16+
# Date the lesson was created (YYYY-MM-DD, this is empty by default)
17+
created: '2018-03-12'
18+
19+
# Comma-separated list of keywords for the lesson
20+
keywords: 'software, data, lesson, The Carpentries'
21+
22+
# Life cycle stage of the lesson
23+
# possible values: pre-alpha, alpha, beta, stable
24+
life_cycle: 'beta'
25+
26+
# License of the lesson materials (recommended CC-BY 4.0)
27+
license: 'CC-BY 4.0'
28+
29+
# Link to the source repository for this lesson
30+
source: 'https://github.com/datacarpentry/genomics-r-intro'
31+
32+
# Default branch of your lesson
33+
branch: 'main'
34+
35+
# Who to contact if there are any issues
36+
37+
38+
# Navigation ------------------------------------------------
39+
#
40+
# Use the following menu items to specify the order of
41+
# individual pages in each dropdown section. Leave blank to
42+
# include all pages in the folder.
43+
#
44+
# Example -------------
45+
#
46+
# episodes:
47+
# - introduction.md
48+
# - first-steps.md
49+
#
50+
# learners:
51+
# - setup.md
52+
#
53+
# instructors:
54+
# - instructor-notes.md
55+
#
56+
# profiles:
57+
# - one-learner.md
58+
# - another-learner.md
59+
60+
# Order of episodes in your lesson
61+
episodes:
62+
- 00-introduction.Rmd
63+
- 01-r-basics.Rmd
64+
- 02-data-prelude.Rmd
65+
- 03-basics-factors-dataframes.Rmd
66+
- 04-bioconductor-vcfr.Rmd
67+
- 05-dplyr.Rmd
68+
- 06-data-visualization.Rmd
69+
- 07-r-help.Rmd
70+
71+
# Information for Learners
72+
learners:
73+
74+
# Information for Instructors
75+
instructors:
76+
77+
# Learner Profiles
78+
profiles:
79+
80+
# Customisation ---------------------------------------------
81+
#
82+
# This space below is where custom yaml items (e.g. pinning
83+
# sandpaper and varnish versions) should live
84+
85+
86+
url: 'https://datacarpentry.github.io/genomics-r-intro'
87+
analytics: carpentries
88+
lang: en

md5sum.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"config.yaml" "b91cd97fa3b408bd1ac0a00e67ab3219" "site/built/config.yaml" "2024-12-03"
55
"index.md" "7f9c30e6487338a0c3f8ecc4018873ab" "site/built/index.md" "2024-12-03"
66
"episodes/00-introduction.Rmd" "03f55a33cafd3e5f3b407315c509a389" "site/built/00-introduction.md" "2024-12-03"
7-
"episodes/01-r-basics.Rmd" "b45f835c7d4314da15066f1f2cb86b21" "site/built/01-r-basics.md" "2024-12-03"
7+
"episodes/01-r-basics.Rmd" "01744c322b706b658550627e5a7fa4c3" "site/built/01-r-basics.md" "2024-12-09"
88
"episodes/02-data-prelude.Rmd" "ab2b1fd3cdaae919f9e409f713a0a8ad" "site/built/02-data-prelude.md" "2024-12-03"
99
"episodes/03-basics-factors-dataframes.Rmd" "0bb7c8d7807eea75f14ce8ca3d22febf" "site/built/03-basics-factors-dataframes.md" "2024-12-03"
1010
"episodes/04-bioconductor-vcfr.Rmd" "10eb69b4697d7ecb9695d36c0d974208" "site/built/04-bioconductor-vcfr.md" "2024-12-03"

0 commit comments

Comments
 (0)