1
1
### Introduction
2
2
3
3
This second programming assignment will require you to write an R
4
- function is able to cache potentially time-consuming computations. For
4
+ function that is able to cache potentially time-consuming computations. For
5
5
example, taking the mean of a numeric vector is typically a fast
6
6
operation. However, for a very long vector, it may take too long to
7
7
compute the mean, especially if it has to be computed repeatedly (e.g.
8
8
in a loop). If the contents of a vector are not changing, it may make
9
9
sense to cache the value of the mean so that when we need it again, it
10
10
can be looked up in the cache rather than recomputed. In this
11
- Programming Assignment will take advantage of the scoping rules of the R
11
+ Programming Assignment you will take advantage of the scoping rules of the R
12
12
language and how they can be manipulated to preserve state inside of an
13
13
R object.
14
14
@@ -17,7 +17,7 @@ R object.
17
17
In this example we introduce the ` <<- ` operator which can be used to
18
18
assign a value to an object in an environment that is different from the
19
19
current environment. Below are two functions that are used to create a
20
- special object that stores a numeric vector and cache's its mean.
20
+ special object that stores a numeric vector and caches its mean.
21
21
22
22
The first function, ` makeVector ` creates a special "vector", which is
23
23
really a list containing a function to
@@ -64,8 +64,8 @@ function.
64
64
65
65
### Assignment: Caching the Inverse of a Matrix
66
66
67
- Matrix inversion is usually a costly computation and their may be some
68
- benefit to caching the inverse of a matrix rather than compute it
67
+ Matrix inversion is usually a costly computation and there may be some
68
+ benefit to caching the inverse of a matrix rather than computing it
69
69
repeatedly (there are also alternatives to matrix inversion that we will
70
70
not discuss here). Your assignment is to write a pair of functions that
71
71
cache the inverse of a matrix.
0 commit comments