Displaying 20 results from an estimated 1000 matches similar to: "Small issue with R's C API"
2006 Jun 22
2
.Call and data frames
Hello,
I'm trying to fetch a data frame through the C API,
and have no problem doing this when all columns
are numbers, but when there is a column of
strings I have a problem. On the C-side the
function looks like:
SEXP myfunc(SEXP df),
and it is called with a dataframe from
the R side with:
.Call("myfunc", somedataframe)
On the C side (actually C++ side) I use code
like this:
2007 Jun 23
1
Creating different matrices in a loop
Hello,
I have a big matrix of size (20,5) -bmat . I have to loop though the rows in
the matrix and create DIFFERENT matrices each time I go through the loop.
counts=c(4,6,10);
p=1;
for (i in 1:length(counts))
{
smat=bmat[p:p+i-1,];
p=p+i;
}
The problem is smat overwrites itself each time inside the loop. I would
like to have smat1, smat2, smat3 instead of a single vector smat.
2011 Nov 21
1
Sub sets
I'd appreciate it if you'd keep on list for the archives. That said, I
think this function does what you were hoping for.
Michael
powerset <- function(n, items = NULL){
if(!is.null(items)) {
if(n != length(items)) warning("Resetting n in preference to
length(items)")
n = length(items)
}
smat <- do.call(expand.grid, rep(list(c(0,1)), n))
2005 Apr 18
2
Very Slow Gower Similarity Function
Hello,
I am a relatively new user of R. I have written a basic function to calculate
the Gower similarity function. I was motivated to do so partly as an excercise
in learning R, and partly because the existing option (vegdist in the vegan
package) does not accept missing values.
I think I have succeeded - my function gives me the correct values. However, now
that I'm starting to use it with
2006 Jul 24
1
% symbol in .Rd files?
Hello,
I am encountering problems when there is a '%' character in
package .Rd files. More precisely, CRAN is having problems
with these characters when running check, whereas I am not
seeing any problems under Linux and Windows. I did see
these problems, and found that escaping the %'s fixes the
problem in my testing, but apparently this does not fix the
problem when check is run at
2010 Apr 27
2
Resolving functions using R's namespace mechanism can double runtime
It appears that the runtime for an R script can more than double if a few
references to a function foo() are replaced by more explict references
of the form pkgname::foo().
The more explicit references are of course required when two
loaded packages define the same function.
I can understand why use of this mechanism is not free in an
interpreted environment like R, but the cost seems rather
2023 Jan 19
2
Problem installing gdb into Rtools42
On second thought, there is a lot of metapramming code in Rcpp that runs
before main, so
I was wrong to say nothing can happen before main() is called.
Strategically placed print
statements may be the best strategy.
On Wed, Jan 18, 2023 at 8:17 PM Dominick Samperi <djsamperi at gmail.com>
wrote:
> Since these ?stray threads? were appearing before I installed gdb into
> Rtools42, this
2006 Feb 24
2
Rcpp, best method for linking to
Dear all,
After a bit of reading I came across the Rcpp example package. There
are a few classes that I would like to use and I am not sure how best to
include them in my own package. Is it best to compile it as an
independent library and link to it? Or is there some way to `require` it
for my own package? Re-write using the code as an example (unsure how
best to do this at this moment, as
1997 Apr 06
1
R-alpha: What should is.vector do?
[ Consumer warning: This is a little technical ... ]
I have been pondering the question
What should is.vector do?
Martin has raised this a number of times. I ran a few tests
in S and got the following results.
S> is.vector(list(1,2,3))
[1] T
S> is.vector(expression(a+b))
[1] T
S> is.vector(as.name("x"))
[1] T
S> is.vector(NULL)
[1] T
S> x <- 1:5
2023 Jan 18
2
Problem installing gdb into Rtools42
On 1/18/23 19:41, Dominick Samperi wrote:
> Thanks for the detailed feedback Tomas,
>
> I ran the command 'pacman -Syuu' again, just to be sure, and this time
> it says "there is nothing to do."
>
> It appears that gdb is working. I was spooked by the diagnostics that
> you say is a known (not serious) issue.
>
> My mistake was not setting a
2023 Jan 18
1
Problem installing gdb into Rtools42
Thanks for the detailed feedback Tomas,
I ran the command 'pacman -Syuu' again, just to be sure, and this time it
says "there is nothing to do."
It appears that gdb is working. I was spooked by the diagnostics that you
say is a known (not serious) issue.
My mistake was not setting a breakpoint on main, so I confused problems
with gdb with problems with the program I'm
2010 Sep 29
1
location of Rconfig.h when using architecture-dependent subdirs
Hello,
I just tried configuring R to use architecture-dependent subdirs
$ r_arch=x86_64 ./configure --prefix=/u/smat/konis/testdir
on a Debain Squeeze box
$ uname -a
Linux smapc007 2.6.32-5-686 #1 SMP Sat Sep 18 02:14:45 UTC 2010 i686
GNU/Linux
After building and installing, the Rconfig.h ended up in
.../lib/R/include/x86_64 but R.h still includes it as
#include <Rconfig.h>
2010 Jul 09
3
Telling Windows how to find DLL's from R?
Is it possible to set Windows' search path from within R, or
to tell Windows how to find a DLL in some other way from
R? Specifically, if a package DLL depends on another DLL
the normal requirement is that the second DLL be in the
search path so Windows can find it (there are other tricks,
but they apply at the Windows level, not at the R level).
Thanks,
Dominick
[[alternative HTML version
2010 Dec 01
6
GPL and R Community Policies (Rcpp)
This post asks members of the R community, users and developers,
to comment on issues related to the GNU Public License
and R community policies more generally.
The GPL says very little about protecting the the rights of original
contributors by not disseminating misleading information about them.
Indeed, for pragmatic reasons it effectively assumes that original authors
have no rights regarding
2015 Sep 12
1
rgl/webGL complains about Javascript, even in recent online docs?
FYI, one platform where I have not been able to get interactive rgl
working is iOS 8.
iOS 8 is supposed to support WebGL, and Javascript is enabled.
On Sat, Sep 12, 2015 at 4:33 PM, Dominick Samperi <djsamperi at gmail.com> wrote:
> Thanks for the pointers and the quick fix.
>
> Perhaps the generated HTML code should issue a
> message like "Javascript load problem"
2023 Jan 18
1
Problem installing gdb into Rtools42
Thanks,
But this didn't work. It installs msys2 along with lots of other stuff, and
gdb would not start as before (missing DLL's).
Then I tried to run the command you suggested again, and there was a
warning from the package manager about a cycle detected, but now gdb starts
with the following messages...
Traceback (most recent call last):
File "<string>", ine 3, in
2007 Feb 12
2
[LLVMdev] bitconvert for multi-typed RegisterClasses
On Feb 12, 2007, at 12:58 PM, Evan Cheng wrote:
>
> On Feb 12, 2007, at 1:41 AM, Christopher Lamb wrote:
>
>>
>> selector refused to select certain ops (specifically stores) for some
>> instructions when the operand type wasn't the first type for the
>> register class. After some digging around I seem to have solved the
>> problem by creating bitconvert
2003 May 21
2
moving onto returning a data.frame?
I've been studying some of the code and I'm still a little shakey on the
proper method for returning a data.frame from a C function (which is my
ultimate goal here). I've started some code that I've "stolen" from the
archives and I'm running into crashes, etc. I've been trying to gleen some
insight from the src/main/scan.c file and didn't find many comments in
2007 Feb 13
0
[LLVMdev] bitconvert for multi-typed RegisterClasses
>
> Thanks Evan,
>
> I had tried something like this, but ran into some problems.
>
> llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1478: failed assertion
> `MVT::isVector(VT) && "Cannot promote this load!"'
>
> and
>
> llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1766: failed assertion
> `MVT::isVector(VT) && "Unknown legal
2013 Mar 11
3
[LLVMdev] Bug in visitSIGN_EXTEND in DAGCombiner.cpp?
On Mar 11, 2013, at 9:41 AM, Nadav Rotem <nrotem at apple.com<mailto:nrotem at apple.com>>
wrote:
Hi Richard,
I did… It originates from an icmp ne <2x i8>, zero initializer followed by a sext of the result 2x i1 to 2x i8. When we visit the SIGN_EXTEND, we generate the ISD::SELECT even though the selector and both operands are vectors.
It sounds like a bug in the dag combine