echo output to screen

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

echo output to screen

Chun-Ying Lee
Hi all,
 
  I want to echo output to screen before next step,
like the following when i type library(pkname),

>library(pkname)

a few description about the package
........

>
>
>

how should I do to get this?
Thanks in advanced!!


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: echo output to screen

Uwe Ligges
Chun-Ying Lee wrote:

> Hi all,
>  
>   I want to echo output to screen before next step,
> like the following when i type library(pkname),
>
>
>>library(pkname)
>
>
> a few description about the package
> ........
>
>
>>
>>
>
> how should I do to get this?

?cat

Uwe Ligges

> Thanks in advanced!!
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

echo output to screen

Chun-Ying Lee
On Thu, 09 Feb 2006 10:02:49 +0100, Uwe Ligges wrote

> Chun-Ying Lee wrote:
> > Hi all,
> >  
> >   I want to echo output to screen before next step,
> > like the following when i type library(pkname),
> >
> >
> >>library(pkname)
> >
> >
> > a few description about the package
> > ........
> >
> >
> >>
> >>
> >
> > how should I do to get this?
>
> ?cat
I know the use of "cat"

but I mean that the description appear automatically
when I type library(pkname)

>
> Uwe Ligges
>
> > Thanks in advanced!!
> >
> >


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: echo output to screen

Uwe Ligges
Chun-Ying Lee wrote:

> On Thu, 09 Feb 2006 10:02:49 +0100, Uwe Ligges wrote
>
>>Chun-Ying Lee wrote:
>>
>>>Hi all,
>>>
>>>  I want to echo output to screen before next step,
>>>like the following when i type library(pkname),
>>>
>>>
>>>
>>>>library(pkname)
>>>
>>>
>>>a few description about the package
>>>........
>>>
>>>
>>>
>>>>
>>>how should I do to get this?
>>
>>?cat
>
>
> I know the use of "cat"
>
> but I mean that the description appear automatically
> when I type library(pkname)

See ?.onAttach (or ?.First.lib if you do not use a NAMESPACE).

Uwe Ligges


>
>>Uwe Ligges
>>
>>
>>>Thanks in advanced!!
>>>
>>>
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: echo output to screen

Romain François
In reply to this post by Chun-Ying Lee
Le 09.02.2006 10:09, Chun-Ying Lee a écrit :

>On Thu, 09 Feb 2006 10:02:49 +0100, Uwe Ligges wrote
>  
>
>>Chun-Ying Lee wrote:
>>    
>>
>>>Hi all,
>>>
>>>  I want to echo output to screen before next step,
>>>like the following when i type library(pkname),
>>>
>>>
>>>      
>>>
>>>>library(pkname)
>>>>        
>>>>
>>>a few description about the package
>>>........
>>>
>>>
>>>      
>>>
>>>>        
>>>>
>>>how should I do to get this?
>>>      
>>>
>>?cat
>>    
>>
>
>I know the use of "cat"
>
>but I mean that the description appear automatically
>when I type library(pkname)
>  
>
Hi,

Your question was not too clear about that.
See Writing R extensions.
?.First.lib if you don't have a NAMESPACE
?.onLoad if you do

Romain

--
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: echo output to screen

Liaw, Andy
In reply to this post by Chun-Ying Lee
Is something like this what you want?

> load_and_describe <- function(pkg) {
+     eval(substitute(library(pkg)))
+     packageDescription(pkg)
+ }
> load_and_describe("e1071")
Package: e1071
Version: 1.5-12
Date: 2006-01-11
Title: Misc Functions of the Department of Statistics (e1071), TU Wien
Depends: class
Imports: graphics, stats
Suggests: cluster, mlbench, nnet, randomForest, rpart, SparseM, xtable
Author: Evgenia Dimitriadou, Kurt Hornik, Friedrich Leisch, David
        Meyer, and Andreas Weingessel
Maintainer: Friedrich Leisch <[hidden email]>
Description: Functions for latent class analysis, short time Fourier
        transform, fuzzy clustering, support vector machines, shortest
        path computation, bagged clustering, naive Bayes classifier,
        ...
License: GPL version 2.  See COPYRIGHT.svm.cpp for the copyright of the
        svm C++ code.
SaveImage: no
LazyLoad: yes
Packaged: Wed Jan 11 17:37:06 2006; leisch
Built: R 2.2.1; i386-pc-mingw32; 2006-01-12 09:52:56; windows


Andy


From: Chun-Ying Lee

>
> On Thu, 09 Feb 2006 10:02:49 +0100, Uwe Ligges wrote
> > Chun-Ying Lee wrote:
> > > Hi all,
> > >  
> > >   I want to echo output to screen before next step,
> > > like the following when i type library(pkname),
> > >
> > >
> > >>library(pkname)
> > >
> > >
> > > a few description about the package
> > > ........
> > >
> > >
> > >>
> > >>
> > >
> > > how should I do to get this?
> >
> > ?cat
>
> I know the use of "cat"
>
> but I mean that the description appear automatically
> when I type library(pkname)
>
> >
> > Uwe Ligges
> >
> > > Thanks in advanced!!
> > >
> > >
>
>

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