Displaying 20 results from an estimated 10000 matches similar to: "Resource for learning C/R interface"
2011 Jul 20
2
transforming a matrix of logical to 0 and 1 while keeping the dim of matrix
Hi all,
Suppose I have a matrix of logical value:
x<-matrix(c(TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE,FALSE,TRUE),nrow=3)
I would like to change the value of FALSE to 0 and TRUE to 1. An
obvious way to do it is :
y<-as.numeric(x)
However this method doesn't keep the dim of x. I also need to copy the
dim information to y too.
attributes(y)<-attributes(x)
Is this a correct way to do
2011 Feb 25
1
Question about foreach (with doSNOW), is that a bug?
Hi all,
Within a foreach loop with doSNOW, we cant call functions which come from
the non-default package. We need to load(require/library) the package once
more within the foreach loop. Anyone knows why would happen like this? Is it
caused by the snow package and something happened when "snow" parallelize
the job?
Other than load the package once more with in the foreach loop, is
2011 May 26
1
Question about ggplot2
Hi all,
Is there any way for me to to string in the argument of qplot or ggplot? for
example
qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth'))
instead of
qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth'))
Thanks!!
Regards,
TszKin Julian
[[alternative HTML version deleted]]
2010 Dec 15
2
Cumulative percentage by unit of time
Hi All,
I've been struggling on that one for a couple of days. I've tried several
things, but nothing is worth publishing.
I'm working with a bird nests data frame for which I have a laying date (LD)
and a fledgling date (FD) (in calendar Julian date) by nest id. For the
period spanning between LD and SD, the nest is termed "active". Each nest id
occur once in the data
2018 Mar 14
1
Learning advanced R
Depending on your application, I'm not sure there's much point in being an
"advanced R programmer" these days. Become an adequate R programmer, and
learn C++ and Rcpp. Do basic data mashing in R, then do all your intensive
stuff in C++ with Rcpp. Eventually you'll probably get to the point where
you can express yourself in C++ as fast as you can in interpreted R, with
the
2018 Mar 14
0
Learning advanced R
On Wed, 14 Mar 2018, Barry Rowlingson wrote:
> Depending on your application, I'm not sure there's much point in being an
> "advanced R programmer" these days. Become an adequate R programmer, and
> learn C++ and Rcpp. Do basic data mashing in R, then do all your intensive
> stuff in C++ with Rcpp. Eventually you'll probably get to the point where
> you can
2007 Nov 12
4
a repetition of simulation
Hello,
I have a simple (?) simulation problem.
I'm doing a simulation with logistic model and I want to reapet it 600
times.
The simulation looks like this:
z <- 0
x <- 0
y <- 0
aps <- 0
tiss <- 0
for (i in 1:500){
z[i] <- rbinom(1, 1, .6)
x[i] <- rbinom(1, 1, .95)
y[i] <- z[i]*x[i]
if (y[i]==1) aps[i] <- rnorm(1,mean=13.4, sd=7.09) else aps[i] <-
2010 Sep 29
2
R crashes when loading rgl package before minqa package
Hej,
Calling newuoa (from the minqa package) makes R crash when the package rgl
is loaded first. This however only on certain selected data.
The data used for testing (saved to 'bugs.R'):
xvals = c(1,2,4,5,7,8,9,10,11,12,14,15,16,18,19,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36)
yvals =
2018 Apr 12
1
WGCNA package installation segmentation fault
Hi all,
a user contacted me about a segfault when installing WGCNA package
dowloaded from CRAN. I also see a segfault like that on certain
installs of R.
The package passes all CRAN checks, so presumably this has something
to do with the R installation or environment. The R versions here are
not the newest but I would guess that this is not an R version issue.
I'm attaching two
2010 Aug 03
4
[Xen-API] New XCP Management Tool
XCP Users:
I received an email from Alberto Gonzalez Rodriguez who created OpenXenCenter/OpenXenManager and is now working on OpenXenWebManager. Info to access the tool is:
steps to test are:
download from http://bit.ly/bres2U
uncompress: tar xvfz xenwebmanager_rev24_full.tar.gz cd xenwebmanager python frontend.py
and with a browser open http://localhost:8080 (or http://ip:8080) you need
2011 Nov 30
1
R Interface to C / C++
Dear List,
I’d like to modify the R rpart package source code to add a new split
criterion. I’m familiar with R, but not at all with C or C++.
I understand C and C++ are quite different, and I don’t have the time to
learn both, so my questions are (i) which one should I learn for the
specific task mentioned above? (I understand rpart routines are written in
C, but want to check this), (ii) more
2016 Dec 19
4
Problems installing tibble (ggplot2) in R running Ubuntu 14.04
Hi,
I am unable to install tibble, a required package for ggplot2 in R. I am
running R (version 3.3.2 ) in RStudio (version 1.0.44). My OS is ubuntu
14.04 (64 bits).
I get the same error when running R from the terminal.
Any help would be gretly appreciated.
Kind regards,
Terje
****************
Error messages:
****************
install.packages("tibble")
Installing package into
2010 Jul 08
8
XCP Management Tools Inquiry
XCP Users:
As many of you are aware, there are several open source products available for everyone to use when working with XCP. I would like to get some feedback on the various tools to get a feeling on how people are using XCP and these tools.
Here are the tools that I am aware of (please respond if you are using another tool):
* OpenXenManager -
2012 May 03
1
Setting up a windows system for rcpp
I am running into a wall getting my system to work with rcpp and inline.
Following Dirk's advice on stackoverflow, I hope someone is able to help
me.
My steps were to install MinGW 32 bit first, then installing Rtools, I
disabled MinGW's entry in the PATH.
I am trying to get the following code to work:
library(Rcpp)
library(inline)
body <- '
NumericVector xx(x);
return wrap(
2013 Jun 21
1
compiling Rcpp with 3.0.1 on Solaris 10
Hello
My colleagues asked me to install "R" with module "shiny".
R version 3.0.1 compiled fine on Solaris 10 and is running well.
I tried to install "shiny". With the dependencies "Rcpp" should be installed before. But the compile step did fail. See below.
The initial error message is "Error in dyn.load(file, DLLpath = DLLpath, ...) :"
2010 Mar 25
1
Error using Rcpp
Hi, Im not sure if this is the right place to post this. I am using Xubuntu
Karmic Koala and am trying to use the Rcpp package. I am testing it using a
simple code that takes in a vector and adds 1 to each element:
#include <Rcpp.h>
// This file takes in a vector and adds one to each entry
RcppExport SEXP addone(SEXP vec){
// create a local copy of vec
Rcpp::NumericVector
2017 Dec 03
5
Rcpp, dyn.load and C++ problems
Hi,
I have written a small C++ function and compile it.
However in R I can't see the function I have defined in C++.
I have read some web-pages about Rcpp and C++ but it is a bit confusion
for me.
Anyway,
This is the C++-code:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
List compute_values_cpp(int totalPoints = 1e5, double angle_increment =
0.01, int radius =
2013 Jun 20
1
compiling Rcpp with 3.0.1 on Solaris 10
Hello
My colleagues asked me to install "R" with module "shiny".
R version 3.0.1 compiled fine on Solaris 10 and is running well.
I tried to install "shiny". With the dependencies "Rcpp" should be installed before. But the compile step did fail. See below.
The initial error message is "Error in dyn.load(file, DLLpath = DLLpath, ...) :"
Before
2013 Nov 16
2
Linking to native routines in other packages
Hello,
I'm currently working on making Rcpp use the feature described here more:
http://cran.r-project.org/doc/manuals/R-exts.html#Linking-to-native-routines-in-other-packages
To give more context, Rcpp has for a long time built what we called "the
Rcpp user library", i.e. a library we could link against user the
linker. We were then producing appropriate linker flag with
2013 May 14
2
invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.
Dear R-Developers,
I just started learning how to use Rcpp. Earlier while using it, I
encountered an error as shown below:
file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector
foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector,
Rcpp::Function, Rcpp::Function)’:
file74d8254b96d4.cpp:10: error: invalid operands of types ‘SEXPREC*’ and
‘R_len_t’ to binary ‘operator/’
make: ***