Re: [R] Changing global variables from functions

2010-03-23 Thread jtouyz
Thanks for the help, I've fixed the problem. -Josh Elliott -- View this message in context: http://n4.nabble.com/Changing-global-variables-from-functions-tp1595002p1679330.html Sent from the R help mailing list archive at Nabble.com. __

[R] Changing global variables from functions

2010-03-16 Thread jtouyz
Hey all, I'm relatively new to the R-environment. I'm having a bit of trouble with encapsulation. I have a globally declared variable that doesn't update it when I change it in a function. For example when I run the following function deckn-NULL deck1-1 #52 card deck deck-function() {

Re: [R] Changing global variables from functions

2010-03-16 Thread David Winsemius
On Mar 16, 2010, at 11:04 AM, jtouyz wrote: Hey all, I'm relatively new to the R-environment. I'm having a bit of trouble with encapsulation. I have a globally declared variable that doesn't update it when I change it in a function. For example when I run the following function

Re: [R] Changing global variables from functions

2010-03-16 Thread jtouyz
Hi David, Thank you for your response. Yes, num_decks was previously defined in my program, I apologize for the confusion as it is an integral value. This is only one portion of my program that is being used to simulate card counting in blackjack. The basic idea was to modify deckn without

Re: [R] Changing global variables from functions

2010-03-16 Thread David Winsemius
On Mar 16, 2010, at 2:43 PM, jtouyz wrote: Hi David, Thank you for your response. Yes, num_decks was previously defined in my program, I apologize for the confusion as it is an integral value. This is only one portion of my program that is being used to simulate card counting in

Re: [R] Changing global variables from functions

2010-03-16 Thread David Winsemius
On Mar 16, 2010, at 3:11 PM, David Winsemius wrote: On Mar 16, 2010, at 2:43 PM, jtouyz wrote: Hi David, Thank you for your response. Yes, num_decks was previously defined in my program, I apologize for the confusion as it is an integral value. This is only one portion of my program