EpiR.base - namespace changes

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

EpiR.base - namespace changes

ml-r-help


Hi,

as some might have noticed over the last few days a variing but large number of
unit tests failed. This should now be resolved.

The changes made to the namespace exports aim at provideing a clear,
maintainable (and thus minimal) set of public methods availabel for use by other
packages and at the R prompt.
Changes are motivated by recent changes in R devel which indicate a series of
issues we have to overcome for the R 2.3.0 release.

For the future, please
 - check the NAMESPACE file to find out which functions and methods are public
   and use them, only.
   (If you have to rely on a private method do so via the prefix EpiR.base:::
    although this is not advised and not guaranteed to work at all times.)

  - make an effort to check for meaningful method names for new methods,
    check if a similar name has already been in use for the same task and
    reuse it in order to keep the method list concise.

Package maintainers for the remaining packages should update their NAMESPACE
files over the next few weeks.


Regards,

  Matthias

--
Matthias Burger                     Project Manager/ Biostatistician
Epigenomics AG    Kleine Praesidentenstr. 1    10178 Berlin, Germany
phone:+49-30-24345-371                          fax:+49-30-24345-555
http://www.epigenomics.com           [hidden email]

______________________________________________
[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
|

Please ignore (Re: EpiR.base - namespace changes)

ml-r-help

Please ignore my posting, was not meant to be sent to this list.

Appologies for the distraction.

Regards,

  Matthias

--
Matthias Burger                     Project Manager/ Biostatistician
Epigenomics AG    Kleine Praesidentenstr. 1    10178 Berlin, Germany
phone:+49-30-24345-371                          fax:+49-30-24345-555
http://www.epigenomics.com           [hidden email]

______________________________________________
[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
|

sprintf

J.M. Breiwick
In reply to this post by ml-r-help
Hi,

I want to use sprintf with vectors whose lengths vary.
As an example: x = c(2,4,6,10)
sprintf("%i%5f%5f%5f",x[1],x[2],x[3],x[4]) works. But if I have to compute
the length of x within a function then I cannot list all for format codes
and sprintf apparently will not accept just "x" - it wants one value for
each format code as in the above example. Does anyone know a way to handle
this? And is there a way to repeat the format code like in Fortran (e.g.
5F4.1)? Thanks.

Jeff B.

______________________________________________
[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: sprintf

Marc Schwartz (via MN)
On Fri, 2006-02-17 at 12:01 -0800, J.M. Breiwick wrote:

> Hi,
>
> I want to use sprintf with vectors whose lengths vary.
> As an example: x = c(2,4,6,10)
> sprintf("%i%5f%5f%5f",x[1],x[2],x[3],x[4]) works. But if I have to compute
> the length of x within a function then I cannot list all for format codes
> and sprintf apparently will not accept just "x" - it wants one value for
> each format code as in the above example. Does anyone know a way to handle
> this? And is there a way to repeat the format code like in Fortran (e.g.
> 5F4.1)? Thanks.
>
> Jeff B.

Is the format of the vector 'x' predictable?  In other words, will the
first element always be printed as an integer with the rest (of unknown
length) printed as floats?

Keep in mind that sprintf() is vectorized.

So:

x <- c(2, 4, 6, 10)

> c(sprintf("%i", x[1]), sprintf("%5f", x[-1]))
[1] "2"         "4.000000"  "6.000000"  "10.000000"


> x <- seq(2, 20, 2)
> x
 [1]  2  4  6  8 10 12 14 16 18 20

# Same code here
> c(sprintf("%i", x[1]), sprintf("%5f", x[-1]))
 [1] "2"         "4.000000"  "6.000000"  "8.000000"  "10.000000"
 [6] "12.000000" "14.000000" "16.000000" "18.000000" "20.000000"


Does that get what you want?

BTW, please do not create a new post by responding to a different
thread. It plays havoc with the list archive making it difficult to
search for your post and any replies.

HTH,

Marc Schwartz

______________________________________________
[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