Re: [R] Function won't permanently assign values to a vector

2011-08-28 Thread Daniel Malter
It will greatly help if you provide a self-contained example, as requested in the posting guide. Most of the times this will in fact lead to you figuring out your problem yourself, but if not it will greatly enhance your chances that we can help you in a meaningful, unambiguous way. Best, Daniel

Re: [R] Function won't permanently assign values to a vector

2011-08-28 Thread R. Michael Weylandt
Two things: It's just a guess as to what your problem is, but functions in R don't usually act on the object that is passed to them, but rather a copy thereof: if you want to keep the values calculated within the function, that's usually done with an assignment statement combined with the function

[R] Function won't permanently assign values to a vector

2011-08-28 Thread DimmestLemming
I'm somewhat new to R, but I've had a lot of experience in Java. I'm working on a function that takes data from a data frame, does some math and assigns the values to a vector. Pretty simple. I plan to merge the vector with the data frame when I'm done. The vector is called offense1 (there will e