Displaying 2 results from an estimated 2 matches for "numbercolumn".
Did you mean:
numbercolumns
2002 May 07
2
passing a matrix to C++ with .C()?
It seems that it is possible to pass a matrix to C++ by using .C()
The R part of the interface should be something like:
('C++function', matrix, numberRows, numberColumns )
...I guess.
The C++ part of the interface could be something like
void C++( double matrix[][], int numberRows, numberColumns )
but C++ requires to indicate the number of columns, that is, instead of
matrix[][], it should be double matrix[][ numberColumns ]...
This does not look like the rig...
2008 Apr 13
0
[Fwd: Re: Assigning to multiple variables]
...te:
> If we have a function that returns 2 or more values (such as dim as
> applied to a matrix), can we assign these 2 or more values to an equal
> number of differently named variables in one line? For example, is
> there any way to do something like this:
>
> [NumberRows NumberColumns] <- dim(MatrixA)
In that case R returns an object (a vector) with two values where the
first is the number of rows and the second is the number of columns.
Almost everything in R are objects.
So:
> d <- dim(attitude)
> rows <- d[1]
> rows
[1] 30
Tom