Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 11th, 2005, 1:13 PM   #1
quantalfred
Newbie
 
Join Date: Jan 2005
Posts: 21
Rep Power: 0 quantalfred is on a distinguished road
Question A question on R/Splus

Is there any difference between "=" and "<-"?

Say if I want to set x to 5, I can write x=5, or x<-5.

Now if I want to add 5 to x, I can write x=x+5 or x<-x+5.

So could I just use "=" instead of "<-" in all cases? Or is there any reason for using "<-" instead of "="?
quantalfred is offline   Reply With Quote
Old Jun 11th, 2005, 3:17 PM   #2
Gilward Kukel
Newbie
 
Join Date: Jun 2005
Location: Vienna, Austria
Posts: 15
Rep Power: 0 Gilward Kukel is on a distinguished road
In the help files they say:
Quote:
The operators <- and = assign into the environment in which they are evaluated. The <- can be used anywhere, but the = is only allowed at the top level (that is, in the complete expression typed by the user) or as one of the subexpressions in a braced list of expressions.
But I don't know what it means.
Gilward Kukel is offline   Reply With Quote
Old Jun 12th, 2005, 11:09 AM   #3
quantalfred
Newbie
 
Join Date: Jan 2005
Posts: 21
Rep Power: 0 quantalfred is on a distinguished road
Me either. I think an example may help.
quantalfred is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:14 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC