|
30 | 30 | "\n",
|
31 | 31 | "## Conditional Subsetting\n",
|
32 | 32 | "\n",
|
33 |
| - "We have already looked at slicing subsets, where we knew the indexs of the rows or columns of the entries we wanted. \n", |
34 |
| - "There may be times when, instead we want to select rows based on a specific condition. This would require a conditional \n", |
35 |
| - "statement. Conditional commands check if criteria is met and return either TRUE or FALSE in response.\n", |
| 33 | + "We have already looked at slicing subsets, where we knew the indexes of the rows or columns of the entries we wanted. \n", |
| 34 | + "There may be times when, instead, we want to select rows based on a specific condition. This would require a conditional \n", |
| 35 | + "statement. Conditional commands check if criteria are met and return either TRUE or FALSE in response.\n", |
36 | 36 | "\n",
|
37 | 37 | "Let's find which rows of ```iris``` have a ```Sepal.Length``` less than 7.\n"
|
38 | 38 | ]
|
|
290 | 290 | "id": "c35c5cdc-bc64-4f4c-a495-89257bbfd26d",
|
291 | 291 | "metadata": {},
|
292 | 292 | "source": [
|
293 |
| - "Using all.equal() is similar to identical(), but allows for some tolerance in how similar values can be. For example, we may want to check two numbers with lots of decimal places, but only need them to be within 0.01 of each other. Therefore we can give a tolerance of 0.01" |
| 293 | + "Using all.equal() is similar to identical(), but allows for some tolerance in how similar values can be. For example, we may want to check two numbers with lots of decimal places, but only need them to be within 0.01 of each other. Therefore, we can give a tolerance of 0.01." |
294 | 294 | ]
|
295 | 295 | },
|
296 | 296 | {
|
|
433 | 433 | "id": "593373fb-b274-4eec-a8b0-9a3755c3f0c2",
|
434 | 434 | "metadata": {},
|
435 | 435 | "source": [
|
436 |
| - "We can use objects or parts of objects to select rows and columns within [ ] using the \"%in%\". " |
| 436 | + "We can use objects or parts of objects to select rows and columns within [ ] using \"%in%\". " |
437 | 437 | ]
|
438 | 438 | },
|
439 | 439 | {
|
|
785 | 785 | "source": [
|
786 | 786 | "## Paste\n",
|
787 | 787 | "\n",
|
788 |
| - "The function ```paste()``` is a way to concatenating together vectors. It can be applied to a characters or numbers, \n", |
| 788 | + "The function ```paste()``` is a way of concatenating vectors together. It can be applied to a characters or numbers, \n", |
789 | 789 | "vector and column(s) of a data frame or matrix. You can define what you want the separator to be (sep =), or use \n",
|
790 |
| - "```paste0()``` or ```paste()``` with the argument sep = \"\" for no space. You can also prodvide a string as an argument\n", |
| 790 | + "```paste0()``` or ```paste()``` with the argument sep = \"\" for no space. You can also provide a string as an argument\n", |
791 | 791 | "to add the same component to a character or vector."
|
792 | 792 | ]
|
793 | 793 | },
|
|
1005 | 1005 | "## Generating a sequence of numbers\n",
|
1006 | 1006 | "\n",
|
1007 | 1007 | "To generate regular sequences, we can use ```seq()```. We provide it a value to start from (from =), and where to \n",
|
1008 |
| - "end (to =) abd then a value to increase by (by =)." |
| 1008 | + "end (to =) and then a value to increase by (by =)." |
1009 | 1009 | ]
|
1010 | 1010 | },
|
1011 | 1011 | {
|
|
0 commit comments