Have a class for which I would like to provide a "colnames<-.myclass"
function so that
colnames(myintsance) <- c("a","b","c")
can be called.
Witold
--
Witold Eryk Wolski
[[alternative HTML version deleted]]
__
R-devel@r-project.org mailing
Am 14.05.2014 08:56, schrieb Deepayan Sarkar:
On Wed, May 14, 2014 at 12:29 AM, Duncan Murdoch
wrote:
I think you are misunderstanding the comments in that file. It's an
internal set of tests for the package, so "test some typical completion
attempts" is a description of the tests that follow,
Dear devels,
I need to create a (short) vector in C, which contains potentially very
large numbers, exponentially to the powers of 2.
This is my test example:
lgth = 35;
int power[lgth];
power[lgth - 1] = 1;
for (j = 1; j < lgth; j++) {
power[lgth - j - 1] = 2*power[lgth - j];
}
Everything
Hi Witold,
you should first of all redefine colnames to use UseMethod.
Then you have to write a colnames.default that uses base::colnames
(so that it does not interfere with existing code and other functions)
and the you can define the method for your class.
I would suggest, though, to use attribu
On 14/05/2014 10:37, Adrian Dușa wrote:
Dear devels,
I need to create a (short) vector in C, which contains potentially very
large numbers, exponentially to the powers of 2.
This isn't an R question, except in so far that R mandates the usual
convention of C being 32-bit. However
1) You s
Dear Prof. Ripley,
Once again, thank you for your replies.
I must confess not being a genuine C programmer, having learned how to use
C only in connection to R (and the macros provided are almost a separate
language to learn).
I'll try to read more about the types you've indicated, and will keep
On May 14, 2014, at 8:41 AM, Adrian Dușa wrote:
> Dear Prof. Ripley,
>
> Once again, thank you for your replies.
> I must confess not being a genuine C programmer, having learned how to use
> C only in connection to R (and the macros provided are almost a separate
> language to learn).
>
> I'll
On Wed, May 14, 2014 at 5:35 PM, Simon Urbanek
wrote:
> [...]
>
> How do you print them? It seems like you're printing 32-bit value instead
> ... (powers of 2 are simply shifts of 1).
>
>
I am simply using Rprintf():
long long int power[lgth];
power[lgth - 1] = 1;
Rprintf("power: %d",
On Wed, 2014-05-14 at 18:17 +0300, Adrian Dușa wrote:
> On Wed, May 14, 2014 at 5:35 PM, Simon Urbanek
> wrote:
>
> > [...]
> >
> > How do you print them? It seems like you're printing 32-bit value instead
> > ... (powers of 2 are simply shifts of 1).
> >
> >
> I am simply using Rprintf():
>
>
Witold E Wolski gmail.com> writes:
>
> Have a class for which I would like to provide a "colnames<-.myclass"
> function so that
>
> colnames(myintsance) <- c("a","b","c")
> can be called.
`colnames<-` is not generic as Luca noted.
But `dimnames<-` is.
If you write a suitable `dimnames<-.myi
Hi,
read.dcf() can modify the locale variable LC_CTYPE, and here is a
minimal example:
> Sys.getlocale('LC_CTYPE')
[1] "en_US.UTF-8"
> read.dcf(textConnection('a: b'), all = TRUE)
a
1 b
> Sys.getlocale('LC_CTYPE')
[1] "C"
After diagnosing the problem, it seems the on.exit() call in
read.dcf()
On Wed, May 14, 2014 at 6:24 PM, Martyn Plummer wrote:
> [...]
>
> Your numbers are being coerced to int when you print them. Try the
> format ", %lld" instead.
Oh my goodness, this was a printing issue...!
(feeling embarrassed, but learned something new)
Problem solved, thanks very much all,
12 matches
Mail list logo