Skip to content

Commit 285a72f

Browse files
author
StephenElston
committed
Edited text
1 parent 72db531 commit 285a72f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Module01/01-08-Functions.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"metadata": {},
66
"source": [
77
"# Functions\n",
8-
"So far in this course we've explored equations that perform algebraic operations to produce one or more results. A *function* is a way of encapsulating an operation that takes an input and produces exactly one ouput.\n",
8+
"So far in this course we've explored equations that perform algebraic operations to produce one or more results. A *function* is a way of encapsulating an operation that takes an input and produces exactly one output.\n",
99
"\n",
1010
"For example, consider the following function definition:\n",
1111
"\n",
@@ -17,7 +17,7 @@
1717
"\n",
1818
"\\begin{equation}f(3) = 11\\end{equation}\n",
1919
"\n",
20-
"You've already seen a few examples of Python functions, which are defined using the **def** keyword. However, the strict definition of an algebraic function is that it must return a single value. Here's an example of defining and using a Python function that meets this criteria:"
20+
"You've already seen a few examples of R functions, which are defined using the **def** keyword. However, the strict definition of an algebraic function is that it must return a single value. Here's an example of defining and using a R function that meets this criteria:"
2121
]
2222
},
2323
{
@@ -60,7 +60,7 @@
6060
"\n",
6161
"\\begin{equation}y = f(x) - 1\\end{equation}\n",
6262
"\n",
63-
"To calculate a value for ***y***, we take the ***f*** of ***x*** and subtract 1. So assuming that ***f*** is defined as previously, given an ***x*** value of 4, this equation returns a ***y*** value of **17** (*f*(4) returns 4<sup>2</sup> + 2, so 16 + 2 = 18; and then the equation subtracts 1 to give us 17). Here it is in Python:"
63+
"To calculate a value for ***y***, we take the ***f*** of ***x*** and subtract 1. So assuming that ***f*** is defined as previously, given an ***x*** value of 4, this equation returns a ***y*** value of **17** (*f*(4) returns 4<sup>2</sup> + 2, so 16 + 2 = 18; and then the equation subtracts 1 to give us 17). Here it is in R:"
6464
]
6565
},
6666
{
@@ -232,7 +232,7 @@
232232
"\n",
233233
"When plotting a function line that marks the end of a continuous range, the end of the line is shown as a circle, which is filled if the function includes the value at that point, and unfilled if it does not.\n",
234234
"\n",
235-
"Here's the Python to plot function ***h***:"
235+
"Here's the R to plot function ***h***:"
236236
]
237237
},
238238
{
@@ -298,7 +298,7 @@
298298
"\\begin{equation}\\{x \\in \\rm I\\!R\\;\\;|\\;\\; 0 \\lt x \\lt 5 \\}\\end{equation}\n",
299299
"\\begin{equation}\\{x \\in \\rm I\\!R\\;\\;|\\;\\; (0,5) \\}\\end{equation}\n",
300300
"\n",
301-
"Here's function ***j*** in Python:"
301+
"Here's function ***j*** in R:"
302302
]
303303
},
304304
{
@@ -363,7 +363,7 @@
363363
"\n",
364364
"Note that this does not include all real numbers, it only includes 0 and 100.\n",
365365
"\n",
366-
"When we use Python to plot this function, note that it only makes sense to plot a scatter plot showing the individual values returned, there is no line in between because the function is not continuous between the values within the domain. "
366+
"When we use R to plot this function, note that it only makes sense to plot a scatter plot showing the individual values returned, there is no line in between because the function is not continuous between the values within the domain. "
367367
]
368368
},
369369
{
@@ -422,7 +422,7 @@
422422
"\n",
423423
"\\begin{equation}\\{p(x) \\in \\rm I\\!R\\;\\;|\\;\\; p(x) \\ge 1 \\}\\end{equation}\n",
424424
"\n",
425-
"Let's create and plot the function for a range of ***x*** values in Python:"
425+
"Let's create and plot the function for a range of ***x*** values in R:"
426426
]
427427
},
428428
{
@@ -478,7 +478,7 @@
478478
"mimetype": "text/x-r-source",
479479
"name": "R",
480480
"pygments_lexer": "r",
481-
"version": "3.4.1"
481+
"version": "3.5.0"
482482
}
483483
},
484484
"nbformat": 4,

0 commit comments

Comments
 (0)