Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiny mistake in the code #245

Closed
songhost-wc opened this issue Oct 6, 2016 · 4 comments
Closed

Tiny mistake in the code #245

songhost-wc opened this issue Oct 6, 2016 · 4 comments
Labels
discussion Ongoing, in order to reach an agreement

Comments

@songhost-wc
Copy link

http://swcarpentry.github.io/r-novice-inflammation/04-cond/
In the Making Choices module, the very last command before the last exercise:

analyze_all("inflammation*.csv")

Here, "inflammation_.csv" is inconsistent with previous commands. It should be changed to "inflammation._csv". I suppose it takes a regex, so the .* replaces for any number of characters after inflammation.

@jangari
Copy link

jangari commented Oct 6, 2016

Markdown gobbled the asterisks. The point here is that inflammation*.csv is expanded to inflammation plus any number of n, plus any character, plus csv.

This line should read analyze_all("inflammation.*csv").

Eg:

> filenames1 <- list.files(path = "data", pattern = "inflammation*.csv")
> filenames1
character(0)
> filenames1 <- list.files(path = "data", pattern = "inflammation.*csv")
> filenames1
 [1] "inflammation-01.csv" "inflammation-02.csv" "inflammation-03.csv" "inflammation-04.csv" "inflammation-05.csv" "inflammation-06.csv" "inflammation-07.csv"
 [8] "inflammation-08.csv" "inflammation-09.csv" "inflammation-10.csv" "inflammation-11.csv" "inflammation-12.csv"

@RMHogervorst
Copy link

correct.
the period (.) means any character. the star after the period means repeat zero or more times.
So .* means: [ any single character][matched zero or more times]

jangari added a commit to IntersectAustralia/r-novice-inflammation that referenced this issue Nov 26, 2016
@bbolker
Copy link
Contributor

bbolker commented Mar 28, 2017

I think this has been resolved?

rgaiacs pushed a commit to rgaiacs/swc-r-novice-inflammation that referenced this issue May 6, 2017
rgaiacs pushed a commit to rgaiacs/swc-r-novice-inflammation that referenced this issue May 6, 2017
Moving overview of existing lesson materials to Carpentries lesson.
@katrinleinweber katrinleinweber added discussion Ongoing, in order to reach an agreement regex labels Jan 31, 2018
@katrinleinweber
Copy link
Contributor

Fixed by 3ee4039, but improvement discussion in #337.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Ongoing, in order to reach an agreement
Projects
None yet
Development

No branches or pull requests

5 participants