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

Question for session 1 #3

Open
byunggyu-casper opened this issue Nov 5, 2016 · 2 comments
Open

Question for session 1 #3

byunggyu-casper opened this issue Nov 5, 2016 · 2 comments

Comments

@byunggyu-casper
Copy link

At the step 3 for solving question 'Which cantons are neither mostly Protestant nor mostly Catholic?'

swiss$CatholicCat[swiss$CatholicCat=='(0,25]'] <- 'Protestant'

You used different kinds of bracket for ranging numbers, such as '(0,25]'.
I thought it could be typo but found you are right!!!
Why do we need to use this akward combination of different bracket? (] and quatation as well?

Best,
Casper

@byunggyu-casper
Copy link
Author

At the step 5 for solving question 'Which cantons are neither mostly Protestant nor mostly Catholic?'

swiss[c(4,45:47),]

Why command doesn't work without comma between ) and ]

Best,
Casper

@BenjaminGaiser
Copy link
Owner

BenjaminGaiser commented Nov 6, 2016

The odd bracket denominations are from the command 'cut' that I use to create the different categories. If you run the cut command and immediately afterwards 'head(df$var)', then it'll show you.

The comma afterwards is to separate arguments for row and column. I'll talk about this tomorrow for a bit. But for now: it chooses row 4, 45, 46, and 47 for all columns (if you do not specify anything after the comma, then the default is to use all columns).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants