Displaying 15 results from an estimated 15 matches similar to: "format(numericmatrix, ...) : proposal for a change"
2012 Dec 05
1
RInside, rcpp compilation problem
I have spent some hours browsing the RInside and rcpp documentation, lots of it; but ... as a programmer of C++ since 1990, on both Windows and Unix ... ( Solaris and Ubuntu, and Mandrake/Mandrivo Linux); I see a minor problem ...... Where is the rcpp.h header file?? The below code fails to compile as the RInside.h header file references the rcpp.h header file, which is not included with
2014 Sep 30
1
Package Rcpp: Question conerning source code of cpp files and related question
Dear all,
I am trying to use Rcpp to write some files in C++ for use in R.
Below is an example for a cpp-file (crossp.cpp). Then I use
>sourceCpp("crossp.cpp") in R and the corresponding function is
availabe in R.
Now I have to question related to this worklfow:
1) Is there a way to see the source file of the "final" cpp-file? (I
mean is it possible to see how the
2011 Feb 20
2
Problem using F77_CALL(dgemm) in a package
Dear R-devel,
I've written a numerical solver for SOCPs (second order cone programs)
in R, and now I want to move most of the solver code into C for speed.
I've written combined R/C packages before, but in this case I need to
do matrix operations in my C code. As I have never done that before,
I'm trying to write some simple examples to make sure I understand the
basics. I am stuck
2011 Dec 16
0
crash in using Rcpp and inline packages.
Hi all,
I am using c++ functions in R by Rcpp and inline packages.
The code is quite simple, but the R session always automatically crash after some running time.
Does anyone here familiar with Rcpp and inline? What¡¯s the problem in the following code?
I have checked the input values, no NA and other strange value exists.
Thank you for your attention!
> mkc <- cxxfunction(
2011 Dec 16
0
Fw: crash in using Rcpp and inline packages.
Hi all,
I am using c++ functions in R by Rcpp and inline packages.
The code is quite simple, but the R session always automatically crash after some running time.
Does anyone here familiar with Rcpp and inline? What¡¯s the problem in the following code?
I have checked the input values, no NA and other strange value exists.
Thank you for your attention!
> mkc <- cxxfunction(
2018 Sep 20
4
Bias in R's random integers?
Hello,
On Thursday, September 20, 2018 11:15:04 AM EDT Duncan Murdoch wrote:
> On 20/09/2018 6:59 AM, Ralf Stubner wrote:
> > On 9/20/18 1:43 AM, Carl Boettiger wrote:
> >> For a well-tested C algorithm, based on my reading of Lemire, the
> >> unbiased "algorithm 3" in https://arxiv.org/abs/1805.10941 is part
> >> already of the C standard library in
2005 Dec 29
2
loop
Dear All,
I have to use loop over an array so I am using following procedure
count<-1
repeat{
count<-count + 1
c(g[count],1:i[count]) ->qw
if(count>5)break
}
as a result qw is
[1] 0.9643836 1.0000000 2.0000000 3.0000000 4.0000000 5.0000000
[7] 6.0000000 7.0000000 8.0000000 9.0000000 10.0000000 11.0000000
[13] 12.0000000 13.0000000 14.0000000 15.0000000 16.0000000
2012 Sep 11
1
lapply with different size lists?
Hello,
I have 2 functions (a and b)
a = function(n) { matrix (runif(n*2,0.0,1), n) }
>
>
> b = function (m, matrix) {
> n=nrow (matrix)
> p=ceiling (n/m)
> lapply (1:p, function (l,n,m) {
> inf = ((l-1)*m)+1
> if (l<p) sup=((l-1)*m)+m
> else sup=n
>
2013 Mar 14
1
ggplot2 problem
Hello all!
I have a problem with ggplot2 library. I want to do an heat map and the y
variables are the year months. If I use the following code, he y values are
in alphabetical order, but I want it in month order.
The code is:
library(reshape)
library(ggplot2)
library(scales)
p <- ggplot(data.m, aes(variable, Month)) + geom_tile(aes(fill = value),
2006 Feb 06
2
novice questions about programming in "R"
folks,
I have been struggling with the "R" documentation for too long now and
I need a simple answer on two questions. The documentation does not
have adequate examples. Please help.
given two equal vector lists:
A <- c(0,1,2,3)
B <- c(5,6,7,8)
[Question #1]
how do I dump them to a text file with the following format:
2007 Jan 30
2
Rbind for appending zoo objects
Hi R,
y1 <- zoo(matrix(1:10, ncol = 2), 1:5)
colnames(y1)=c("a","b")
y2 <- zoo(matrix(rnorm(10), ncol = 2), 6:10)
colnames(y2)=c("b","a")
> y1
a b
1 1 6
2 2 7
3 3 8
4 4 9
5 5 10
> y2
b a
6 0.9070204 0.3527630
7 1.2405943 0.8275001
8 -0.1690653 -0.1724976
9 -0.6905223 -1.1127670
10
2017 Nov 16
3
Manera eficiente de añadir el valor anterior por grupo
Buenas
Tengo un Data table de la siguiente manera:
datos<-data.table(grupo=rep(c("a","b"),5),x=c(1:10),y=rnorm(10,2,1))
Lo que quiero es añadir una fila por cada grupo y en esa nueva fila, al valor de la x ponerle el valor anterior de la y
Lo que hago es añadir una nueva fila por grupo, con:
datos[,.SD[1:(.N+1)],by=grupo]
Y para añadir el valor anterior uso la función
2014 Jun 24
4
asignacion de un valor a un elemento de una lista
Buen dia!
Queria saber si siendo l3 una lista,
no se puede asignar un valor a un elemento de una lista?!!!
l3[[1]][1,5]<-5
eso no vale?
--
"Abraza la incertidumbre, es un intento de tener una filosofía de vida para
agarrarme de algo e ir naufragando en la vida de alguna manera. Encarar a
ciegas, y generar incertidumbres en el proyectar."
J.I.S.
[[alternative HTML version
2005 Jun 07
1
Help with possible bug (assigning NA value to data.frame) ?
There's something peculiar that I do not understand here. However, did you
realize that the thing you are assigning into parts of `a' is NULL? Check
you're my.test.boot.ci.1: It's NULL.
Be that as it may, I get:
> a <- data.frame(matrix(1:4, nrow=2), X3=NA, X4=NA)
> a
X1 X2 X3 X4
1 1 3 NA NA
2 2 4 NA NA
> a[a$X1 == 1,]$X3 <- NULL
> a
X1 X2 X3 X4
1 1
2005 Jun 07
0
Help with possible bug (assigning NA value to data.frame)?
This 'strange behaviour' manifest itself within some quite complex
code. When I created a *very* simple example the behaviour dissapeared.
Here is the simplest version I have found which still causes the strange
behaviour (it could be quite unrelated to the boot library, however).
library(boot)
## boot statistic function
my.mean.s <- function(data,subset){
mean(data[subset])
}