[R] beginner questions: objects and scripts

2004-10-14 Thread Terry Mu
hi,

I got some questions on using R,

1. How do I check and edit definition of an object?

for example,

x - 1:100

then after a while I want to check how x is defined.

list(x) or whatever functions I know only list its
content, but I want to see its definition, without
scrolling up and down, and edit it like fixing a
function.

2. How to save my work in current session as a nice
script?

again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?

Thanks,
Terry

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner questions: objects and scripts

2004-10-14 Thread Douglas Bates
Terry Mu wrote:
hi,
I got some questions on using R,
1. How do I check and edit definition of an object?
for example,
 

x - 1:100
   

then after a while I want to check how x is defined.
list(x) or whatever functions I know only list its
content, but I want to see its definition, without
scrolling up and down, and edit it like fixing a
function.
 

str(x)
gives a concise description of the structure of x
2. How to save my work in current session as a nice
script?
again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?
 

Many people use the ESS (Emacs Speaks Statistics) package for Emacs or 
XEmacs for this.  Although starting with Emacs or XEmacs is not simple, 
John Fox and others have written introductory guides for Windows users.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner questions: objects and scripts

2004-10-14 Thread Duncan Murdoch
On Thu, 14 Oct 2004 07:00:01 -0700 (PDT), Terry Mu
[EMAIL PROTECTED] wrote :

hi,

I got some questions on using R,

1. How do I check and edit definition of an object?

for example,

x - 1:100

then after a while I want to check how x is defined.

list(x) or whatever functions I know only list its
content, but I want to see its definition, without
scrolling up and down, and edit it like fixing a
function.

You can use history() to see the past history of commands, but there's
no automatic way to find the command that produced x.

2. How to save my work in current session as a nice
script?

again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?

history() is very good for that.  

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner questions: objects and scripts

2004-10-14 Thread Mike Prager

[...]How to save my work in current session as a nice
script?
again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?[...]
Many people use the ESS (Emacs Speaks Statistics) package for Emacs or 
XEmacs for this.[...]

I would add that (under Windows, and I would assume under other OS) you can 
use any programming editor to develop the R commands, and then copy and 
paste them into the R session.  Under Windows, the Tinn-R editor is much 
simpler than Emacs, and has some useful features for R users: line 
numbering, syntax coloring, and the ability to submit all or part of the 
edited text to R easily. http://tinn.solarvoid.com/


--
Michael Prager
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516  USA
http://shrimp.ccfhrb.noaa.gov/~mprager/
NOTE: Opinions expressed are personal, not official. No government
endorsement of any product is made or implied.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner questions: objects and scripts

2004-10-14 Thread Mike Prager
At 10/14/2004 10:45 AM Thursday, you wrote:
[...]How to save my work in current session as a nice
script?
again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?[...]
Many people use the ESS (Emacs Speaks Statistics) package for Emacs or 
XEmacs for this.[...]

I would add that (under Windows, and I would assume under other OS) you 
can use any programming editor to develop the R commands, and then copy 
and paste them into the R session.  Under Windows, the Tinn-R editor is 
much simpler than Emacs, and has some useful features for R users: line 
numbering, syntax coloring, and the ability to submit all or part of the 
edited text to R easily. http://tinn.solarvoid.com/
Oops!  Correct URL is  http://www.sciviews.org/Tinn-R/
MHP

NOTE: Opinions expressed are personal, not official. No government
endorsement of any product is made or implied.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] beginner questions: objects and scripts

2004-10-14 Thread Kjetil Brinchmann Halvorsen
Terry Mu wrote:
hi,
I got some questions on using R,
1. How do I check and edit definition of an object?
for example,
 

x - 1:100
   

You should'nt really redefine assignment, but something like
- - function(xyz4, value) {
 v - deparse(substitute(value))
 xname - deparse(substitute(xyz4))
 res - value
 comment(res) - v
 assign(xname, value=res, inherits=TRUE)
}
and then
 -(x, abs(sin(3*pi/2)))
 x
[1] 1
 comment(x)
[1] abs(sin(3 * pi/2))
You could even redefine - to be -, but don't
Probably better to use the history mechanism.
Kjetil
then after a while I want to check how x is defined.
list(x) or whatever functions I know only list its
content, but I want to see its definition, without
scrolling up and down, and edit it like fixing a
function.
2. How to save my work in current session as a nice
script?
again, I want to save objects as they are defined, not
numbers, other than copy / paste. I tried dump(), etc.
In another word, how do you work with R?
Thanks,
Terry
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 


--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
  --  Mahdi Elmandjra
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Beginner questions

2003-06-09 Thread Uwe Ligges
Michele Grassi wrote:
 
 Hi,
 when i create a new variable e.g var-c(1,2,3,...), how
 can i delete one or more osservation?

See An Introduction to R, Section 2.7.

 When i draw my scatterplot,i want to identify, in the
 graph,some point whit x,y coordinates. How can i do it?

See An Introduction to R, Section 12.3.

 Thanks.
 Michele.


Please read the manuals!

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help