Displaying 20 results from an estimated 2000 matches similar to: "Is nested namespace supported?"
2010 Jan 14
1
how to call a function from C
Hi,
In Rcpp, we now have a "Function" class to encapsulate functions (they
cover all three kinds, but this may change).
To call the function, what we do is generate a call with the function as
the first node and then evaluate the call.
SEXP stats = PROTECT( R_FindNamespace( mkString( "stats") ) );
SEXP rnorm = PROTECT( findVarInFrame( stats, install( "rnorm") ) )
2010 Jan 07
1
question on 'within' and 'parse' commands
Hi,
Why can't I pass an expression to `within' by way of textual input to
the 'parse' function?
e.g.,
> x <- data.frame(a=1:5,b=LETTERS[1:5])
> x
a b
1 1 A
2 2 B
3 3 C
4 4 D
5 5 E
> within(x, parse(text="a<-a*10; b<-2:6"))
a b
1 1 A
2 2 B
3 3 C
4 4 D
5 5 E
> within(x, parse(text="a<-a*10; b<-2:6")[[1]])
a b
1 1 A
2 2 B
3
2010 Jan 24
1
header files for R packages
I have 6 or 7 nice constants (for example 1852 meters per nautical mile)
I would like to have available to 4 or 5 functions in an R package. In
C this would just be a header .h file and I would just "include" I am
stuck trying to figure out how to create something like a C header file
for an R package. Any ideas?
2010 Jan 14
1
Logical function
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100114/da4bc580/attachment.pl>
2010 Jan 19
2
Working with text data/text operators
Hello,
Could someone tell me, how can I select from a dataframe only those columns whose names contain a certain text?
For example, if the column names are "Bond1.Creditclass","Bond1.Price","Bond2.Creditclass","Bond2.Price", how do I select only the columns corresponding to Bond1?
Thanks a lot,
Mihai
[[alternative HTML version deleted]]
2010 Feb 01
1
Number with fixed digit length - zero fill-up
Dear R-help members,
I'm quite new to R and I apologize for my basic question, but I haven't
been able to find a solution yet.
I try to interpret vector entries as a binary code, but unfortunately
every first digit which is zero disappears.
So how can I set any number (e.g. x = 10110) to a 8-digit zero fill-up (x
= 00010110) in order to address digit indices?
Or other way round, how
2010 Jan 26
4
Error with toString
Hello there, I want to create a string from strings and numbers, here is my
code:
str <- "name" & toString(20)
but it returns me this error:
Error in toString(20) : could not find function ".jcall"
what did I do wrong? I couldn't find this error anywhere...
--
View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html
Sent from
2010 Jan 26
4
reading a string vector
Hi, I need to read a string vector in R which is like this
"atgctaaaactaatcgtcccaacaattatattactaccac", but R seems to understand it as
a unique vector input when I read in like x <-
"atgctaaaactaatcgtcccaacaattatattactaccac". How do I unconcatenate it, so I
can use each of the letters on my reading?
Thanks,
Beatriz
--
View this message in context:
2010 Jan 23
1
matrix to a C function
Hi the list,
Is there a way to give a matrix to a C function, and then to use it as a
matrix ?
I write a function to print a matrix, but I use it as a vector :
1. void printMatrix(double *mTraj,int *nbCol, int *nbLigne){
2. int i=0,j=0;
3. for(i=0 ; i < *nbLigne ; i++){
4. for(j=0 ; j < *nbCol ; j++){
5. Rprintf(" %f",mTraj[i * *nbCol + j]);
6. }
7.
2010 Jan 22
2
Optimizing C code
Hi the list,
I need to write some efficient distances function, so I read the code
for the Euclidean distance.
I do not understand the purpose of the line 11 : if x[i] and y[i] are
not NA (line 9), can dev be NA ?
Christophe
#define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b))
#define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b))
1. static double R_euclidean2(double *x, double
2010 Jan 22
2
R CMD check error with the GNU Scientific Library
I have been working on an R package that calls C code using .C(). I recently
started including some functions from the GNU Scientific Library in my code.
The code runs fine on my machine when not wrapped in the package. But I get the
following error from "R CMD check"
* checking whether the package can be loaded ... ERROR
Loading required package: splancs
Loading required package: sp
2010 Jan 14
5
Better way than an ifelse statement?
Hello All,
I am trying to create a column of weights based off of factor levels
from another column. I am using the weights to calculate L scores.
Here is an example where the first column are scores, the second is my
"factor" and the third I want to be a column of weights. I can do
what I want with an ifelse statement (see below), but I am wondering
if anyone knows of a cleaner way
2011 Jul 25
6
What does using a lambda in rspec tests accomplish?
Here is the code in question:
describe UsersController do
render_views
…
…
describe "POST to ''create'' action" do
describe "failure" do
before(:each) do
@attr = { :name => '''', :email => '''', :password => '''',
:password_confirmation =>
2010 Oct 03
4
Programmaticly finding number of processors by R code
Dear List
Sorry if this question seems very basic.
Is there a function to pro grammatically find number of processors in
my system _ I want to pass this as a parameter to snow in some serial
code to parallel code functions
Regards
Ajay
Websites-
http://decisionstats.com
http://dudeofdata.com
Linkedin- www.linkedin.com/in/ajayohri
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
[Disclaimer: what is below reflects my understanding from reading the R
source, others will correct where deemed necessary]
On 1/2/10 12:00 PM, r-devel-request at r-project.org wrote:
>
> Hello,
>
> We are currently making lots of changes to Rcpp (see the open Rcpp
> mailing list if interested [1] in the details).
>
> We are now using [2] R_PreserveObject and R_ReleaseObject
2009 Nov 13
2
[LLVMdev] AsmParser is not robust
Hello all,
My partner was just debugging a project that had tried to call a function without arguments in the code but the declaration wasn't declared with a void parameter list. It failed with an assertion that something was trying to ++ past the end of an ilist.
I seem to remember Chris Lattner saying when he made the hand written AsmParser that it wasn't intended to be very robust
2016 Jan 08
2
remove cdrom after installing os on a guest
Hi all,
I have the following issue, and I hope someone know a way to handle it.
I need to grammatically need to create/install a guest OS using the
libvirt API.
Currently what I do:
1. create a xml with the vm configuration (this will include a path to the
iso image)
2. connection.defineXML(<my_config>)
3. vm = connection.lookupByName(<domain_name>)
4. vm.create()
This will
2009 Nov 13
0
[LLVMdev] AsmParser is not robust
On Nov 13, 2009, at 10:16 AM, Samuel Crow wrote:
> Hello all,
>
> My partner was just debugging a project that had tried to call a
> function without arguments in the code but the declaration wasn't
> declared with a void parameter list. It failed with an assertion
> that something was trying to ++ past the end of an ilist.
>
> I seem to remember Chris Lattner
2013 Dec 11
1
Asterisk Language Status
In putting together the SoundPack code, I am looking at the
various language/locale specific code, and wondering how it all
really stands...
So, share with me, non-English speakers, what is your experience
and impression?
I heard a few comments during AstriDevCon, that some of the languages are
not quite right; some said their language was understandable, but...
Would anyone be willing to share
2018 Dec 17
1
Unnecessary apostrophe in English base::summary() NA count output?
Hello, this is quite a minor issue but as summary() is in all likelihood
one of the most widely used functions in R I decided to email this list.
When producing a count of missing values, summary() in English generates an
unnecessary and grammatically incorrect apostrophe (NA's rather than NAs)
in its table header. For example:
> summary(c(1,2,NA,3,4,NA))
Min. 1st Qu. Median Mean