search for: getoffense1

Displaying 1 result from an estimated 1 matches for "getoffense1".

2011 Aug 28
2
Function won't permanently assign values to a vector
...vector. Pretty simple. I plan to merge the vector with the data frame when I'm done. The vector is called offense1 (there will eventually be 2). I declared it on its own, outside of the function. Right now its values are the same as its indices: 1, 2, 3... Then I plugged it into the function: getOffense1(1:20, offense1). 1:20 is the range of offense1 that will be worked upon. Everything about the function works: It generates the correct values and plugs them into the vector. I checked with print statements. The problem is that when the function ends, offense1 is unchanged. All the values it takes...