Re: [Rd] setClass with a slot of RODBC

2007-06-05 Thread Uwe Ligges


[EMAIL PROTECTED] wrote:
>  
> Hi - I tried to get some answer before but there seems to have no one 
> response. My question is that I have a class like below definition:

Don't forget that "RODBC" is not an S4 but an S3 class, hence you have 
to declare it:

setOldClass("RODBC")


Uwe Ligges


> setClass("DBManager", 
>representation(channel="RODBC"))
>  
> My purpose of the conn slot is to hold a channel to database connection which 
> is returned by a command like:
>  
> channel <- odbcConnect("DB", uid="user", pwd="password")
>  
> According to RODBC documentation, this channel is supposed to have a type of 
> "RODBC". However, if I declare my class as above, R will complain that it 
> does not know about "RODBC" type or class. Please clarify. Thank you.
>
> - adschai 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] HTML vignette browser

2007-06-05 Thread Friedrich Leisch
> On Mon, 04 Jun 2007 11:52:51 -0700,
> Robert Gentleman (RG) wrote:

  > Deepayan Sarkar wrote:
  >> On 6/4/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
  >>> Friedrich Leisch <[EMAIL PROTECTED]> writes:
   Looks good to me, and certainly something worth being added to R.
   
   2 quick (related) comments:
   
   1) I am not sure if we want to include links to the Latex-Sources by
   default, those might confuse unsuspecting novices a lot. Perhaps
   make those optional using an argument to browseVignettes(), which
   is FALSE by default?
  >>> I agree that the Rnw could confuse folks.  But I'm not sure it needs
  >>> to be hidden or turned off by default...  If the .R file was also
  >>> included then it would be less confusing I suspect as the curious
  >>> could deduce what Rnw is about by triangulation.
  >>> 
   2) Instead links to .Rnw files we may want to include links to the R
   code -> should we R CMD INSTALL a tangled version of each vignette
   such that we can link to it? Of course it is redundant information
   given the .Rnw, but we also have the help pages in several formats
   ready.
  >>> Including, by default, links to the tangled .R code seems like a
  >>> really nice idea.  I think a lot of users who find vignettes don't
  >>> realize that all of the code used to generate the entire document is
  >>> available to them -- I just had a question from someone who wanted to
  >>> know how to make a plot that appeared in a vignette, for example.
  >> 
  >> I agree that having a Stangled .R file would be a great idea (among
  >> other things, it would have the complete code, which many PDFs will
  >> not).
  >> 
  >> I don't have a strong opinion either way about linking to the .Rnw
  >> file. It should definitely be there if the PDF file is absent (e.g.
  >> for grid, and other packages installed with --no-vignettes, which I
  >> always do for local installation). Maybe we can keep them, but change
  >> the name to something more scary than "source", e.g. "LaTeX/Noweb
  >> source".

  >I would very much prefer to keep the source, with some name, scary or 
  > not...

I have no strong opinion eitehr way, just "source" may have a lot of
people belive that is R code -> whatever "scary" name is chosen sounds
good to me.

I'll have a shot at installing the tangled code later this week (there
is a holiday coming up on Thursday).

.f

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] HTML vignette browser

2007-06-05 Thread Roger Peng
This is very nice work and I like it a lot.  I think it would be quite
useful for teaching.  My only thought was that when I saw 'source' I
was expecting R code, but instead got LaTeX/Noweb.  It does seem that
'source' is  a little ambiguous here.

-roger

On 6/1/07, Deepayan Sarkar <[EMAIL PROTECTED]> wrote:
> Hi,
>
> this is tangentially related to the recent discussion on vignettes.
> vignette() currently produces a listing of available vignettes, but
> these are not clickable. Since R has a browseURL() function, it seems
> natural to have a version that produces HTML with clickable links.
> Here's an attempt at that:
>
> source("http://dsarkar.fhcrc.org/R/vignette-browser.R";)
> browseVignettes()
> browseVignettes(package = "grid")
>
> etc. Perhaps some variant of this could be added to R.
>
> Comments welcome.
>
> -Deepayan
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Roger D. Peng  |  http://www.biostat.jhsph.edu/~rpeng/

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] missing IntegerFromString()

2007-06-05 Thread Aniko Szabo
I have created a DLL not so long ago using C code. My code used the
IntegerFromString() function that used to be exported in the
Rinternals.h header file (and thus easily accessible). Recently I
upgraded to R 2.5.0 and my DLL stopped working. I see that the
IntegerFromString() function is not exported in any of the header files
in the RHOME\include directory. Is it possible for me to use it without
installing all R source files? I can see that the function is in
coerce.c, however it #includes other stuff that I don't have and I am
afraid to mess things about by doing things I don't understand. Or
perhaps there is another function that is intended to be used instead?

 

Thanks,

Aniko

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] documenting S4 replacement methods

2007-06-05 Thread Aaron A. King
I'm writing a package that uses S4 classes.  I'd like to have a 'coef<-' 
method for one or more of the classes.  The generic is defined already (in 
nlme).  Defining it is no problem, but I can't seem to figure out how to 
handle the documentation.  In particular, I'd like a \usage entry in the .Rd 
file but no variant of 

\S4method{coef<-}{mif}(object, pars, ..., value)
\S4method{coef<-}{mif}(object, pars, ...) <- value
\S4method{coef}{mif}(object, pars, ...) <- value

does the job.  Is there a way to have the \usage line in the .Rd file?  If so, 
what is the correct syntax?

Thanks in advance,

Aaron



-- 
Aaron A. King, Ph.D.
Ecology & Evolutionary Biology
University of Michigan
GPG Public Key: 0x6E74F51B


pgpmUXjOF0Ydj.pgp
Description: PGP signature
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] HTML vignette browser

2007-06-05 Thread Deepayan Sarkar
On 6/5/07, Friedrich Leisch <[EMAIL PROTECTED]> wrote:
> > On Mon, 04 Jun 2007 11:52:51 -0700,
> > Robert Gentleman (RG) wrote:
>
>   > Deepayan Sarkar wrote:
>   >> On 6/4/07, Seth Falcon <[EMAIL PROTECTED]> wrote:
>   >>> Friedrich Leisch <[EMAIL PROTECTED]> writes:
>    Looks good to me, and certainly something worth being added to R.
>   
>    2 quick (related) comments:
>   
>    1) I am not sure if we want to include links to the Latex-Sources by
>    default, those might confuse unsuspecting novices a lot. Perhaps
>    make those optional using an argument to browseVignettes(), which
>    is FALSE by default?
>   >>> I agree that the Rnw could confuse folks.  But I'm not sure it needs
>   >>> to be hidden or turned off by default...  If the .R file was also
>   >>> included then it would be less confusing I suspect as the curious
>   >>> could deduce what Rnw is about by triangulation.
>   >>>
>    2) Instead links to .Rnw files we may want to include links to the R
>    code -> should we R CMD INSTALL a tangled version of each vignette
>    such that we can link to it? Of course it is redundant information
>    given the .Rnw, but we also have the help pages in several formats
>    ready.
>   >>> Including, by default, links to the tangled .R code seems like a
>   >>> really nice idea.  I think a lot of users who find vignettes don't
>   >>> realize that all of the code used to generate the entire document is
>   >>> available to them -- I just had a question from someone who wanted to
>   >>> know how to make a plot that appeared in a vignette, for example.
>   >>
>   >> I agree that having a Stangled .R file would be a great idea (among
>   >> other things, it would have the complete code, which many PDFs will
>   >> not).
>   >>
>   >> I don't have a strong opinion either way about linking to the .Rnw
>   >> file. It should definitely be there if the PDF file is absent (e.g.
>   >> for grid, and other packages installed with --no-vignettes, which I
>   >> always do for local installation). Maybe we can keep them, but change
>   >> the name to something more scary than "source", e.g. "LaTeX/Noweb
>   >> source".
>
>   >I would very much prefer to keep the source, with some name, scary or
>   > not...
>
> I have no strong opinion eitehr way, just "source" may have a lot of
> people belive that is R code -> whatever "scary" name is chosen sounds
> good to me.
>
> I'll have a shot at installing the tangled code later this week (there
> is a holiday coming up on Thursday).

Great. Assuming that this will involve .../Meta/vignette.rds getting a
new column similar to "PDF", the code changes in browseVignette()
should be minimal. I'll work on a .Rd file.

-Deepayan

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] 'R CMD INSTALL mypkg' doesn't always update help pages

2007-06-05 Thread Herve Pages
Hi,

'R CMD INSTALL mypkg' and 'install.packages(mypkg, repos=NULL)' don't
update mypkg help pages when mypkg is a source directory. They only
install new help pages if there are some but they leave the already
installed pages untouched. So you end up with mixed man pages from
different versions of the package :-/

I found no mention of this in 'R CMD INSTALL --help' or in
'?install.packages' so it looks like a bug (or at least an
undocumented feature). Isn't it something that the user should be
able to control via the --no-docs option?

This problem can be worked around by first building the source
package with 'R CMD build mypkg' but...

Cheers,
H.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] 'R CMD INSTALL mypkg' doesn't always update help pages

2007-06-05 Thread Jari Oksanen

On 6 Jun 2007, at 01:45, Herve Pages wrote:

> Hi,
>
> 'R CMD INSTALL mypkg' and 'install.packages(mypkg, repos=NULL)' don't
> update mypkg help pages when mypkg is a source directory. They only
> install new help pages if there are some but they leave the already
> installed pages untouched. So you end up with mixed man pages from
> different versions of the package :-/
>
I have observed this, too.

cheers, Jari Oksanen

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] missing IntegerFromString()

2007-06-05 Thread Seth Falcon
Hi Aniko,

"Aniko Szabo" <[EMAIL PROTECTED]> writes:

> I have created a DLL not so long ago using C code. My code used the
> IntegerFromString() function that used to be exported in the
> Rinternals.h header file (and thus easily accessible). Recently I
> upgraded to R 2.5.0 and my DLL stopped working. I see that the
> IntegerFromString() function is not exported in any of the header files
> in the RHOME\include directory. Is it possible for me to use it without
> installing all R source files? I can see that the function is in
> coerce.c, however it #includes other stuff that I don't have and I am
> afraid to mess things about by doing things I don't understand. Or
> perhaps there is another function that is intended to be used
> instead?

I think you want asInteger (which calls IntegerFromString).  This is
in RHOME/include/Rinternals.h

Best Wishes,

+ seth

PS: Nice to see you again :-)


-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel