Displaying 20 results from an estimated 400 matches similar to: "CHAR(STRING_ELT( - OK but CHAR(asChar(STRING_ELT( - not, why?"
2008 Aug 07
1
string comparison
Hi,
I have a package where I do things like this a lot:
if(strncmp(CHAR(asChar(Scategory)), "chance", 6) == 0)
category = h_category_chance;
else if(strncmp(CHAR(asChar(Scategory)), "utility", 7) == 0)
category = h_category_utility;
else if(strncmp(CHAR(asChar(Scategory)), "decision", 8) == 0)
category = h_category_decision;
else
2016 Sep 16
1
getGraphicsEvent() questions, minor feature/tweak request, and patch(es).
Hey all, new R user and first timer here.
I've been using getGraphicsEvent() on an X11-Xlib device in a kind of
interactive loop, and would like to be able to stop it from printing
newlines in the console when I don't actually want to print a prompt.
Even an empty "" value still causes a newline right now.
To not break any code that depends on this behavior, I figured getting
2010 Jul 21
1
xtable with ifelse statement
Hi there,
I'm very new on R and I hope someone can help me to solve the problem in
using the ifelse statement with the xtable function(library xtable).
I'm trying to get the printing of the elements of two lists in a sorted way.
These two list have in common the their names.
I will try to give an example:
the first list looks like this:
$code1
Code code1
Nation
2009 Nov 10
1
Data transformation
Dear all,
I have a dataset as below:
id code1 code2 p
1 4 8 0.1
1 5 7 0.9
2 1 8 0.4
2 6 2 0.2
2 4 3 0.6
3 5 6 0.7
3 7 5 0.9
I just want to rewrite it as this (vertical to horizontal):
id var1 var2 var3
2011 Feb 24
4
Running code sequentially from separate scripts (but not functions)
Hello!
I am wondering if it's possible to run - in sequence - code that is
stored in several R scripts.
For example:
Script in the file "code1.r" contains the code:
a = 3; b = 5; c = a + b
Script in the file "code2.r" contains the code:
d = 10; e = d - c
Script in the file "code3.r" contains the code:
result=e/a
I understand that I could write those 3 scripts
2009 Nov 15
2
Segmentation faults on SEXP conversion
Hello -
I am making a first attempt at writing a simple C++ routine to print
out R objects (this is a simple proof-of-concept as part of a larger
package development). The relevant C++ routine is as follows:
void Rwrite(SEXP fd, SEXP msg) {
int *ofd = INTEGER(fd);
const char * omsg = CHAR(asChar(msg));
printf("[%i] %s",*ofd,omsg);
}
And the corresponding interface in R is as
2011 Feb 03
1
Getting variable names in function output
Dear R-users,
I would like to have some advises about a problem illustrated by the
following snippet. Within myf, I need to evaluate a piece of R code that is
passed as a character argument and then return the objects that are created
by this code. The difficulty comes from the fact that the content of the
code is variable and unknown to me (obviously not in this illustration!).
With the
2007 Feb 22
2
[LLVMdev] opt -verify
I am writing an interprocedural compiler pass. Because the passneeds
information from a FunctionPass, e.g., the post-dominance frontier
(PDF), and because a ModulePass is not permitted to require a
FunctionPass, I am forced to make my pass a FunctionPass and do majority
of its work in the doFinalization() method.
When I run "opt -mypass -verify -o code2.bc code1.bc" I get no
2007 Feb 22
3
[LLVMdev] opt -verify
I followed what you said and called verifyModule() with the
AbortProcessAction option. verifyModule() returns false, but does not
abort and does not print out any information about what caused the
verification to fail.
Chris Lattner wrote:
> On Wed, 21 Feb 2007, Ryan M. Lefever wrote:
>> I am writing an interprocedural compiler pass. Because the passneeds
>> information from a
2007 Feb 22
0
[LLVMdev] opt -verify
I also tried iterating through the functions of the module and calling
verifyFunction(), which also returns false, but does not cause an abort
or report anything to stderr about what caused the verification to fail.
From the doxygen for verifyFunction() and verifyModule(), it seems
like they both should print information to stderr if the verification
fails and should abort opt if
2007 Feb 22
0
[LLVMdev] opt -verify
On Wed, 21 Feb 2007, Ryan M. Lefever wrote:
> I am writing an interprocedural compiler pass. Because the passneeds
> information from a FunctionPass, e.g., the post-dominance frontier
> (PDF), and because a ModulePass is not permitted to require a
> FunctionPass, I am forced to make my pass a FunctionPass and do majority
> of its work in the doFinalization() method.
ok
> When
2010 May 21
1
Error in FUN(X[[1L]], ...) : STRING_ELT() can only be applied to a 'character vector', not a 'integer'
I am receiving this error running a command on a multi-row data-frame. The
data is strings of text (each with new line separator, no spaces, no
numerical characters).
Error in FUN(X[[1L]], ...) :
STRING_ELT() can only be applied to a 'character vector', not a 'integer'
I can run single text string into the same command, and so the issue seems
to be how the package deals with the
2006 Oct 17
1
Error: STRING_ELT() can only be applied to a 'character vector', not a 'builtin'
I have a daily job that attaches hundreds of pseudo-packages containing
data as promise objects (DDP's, ref: g.data package), and plots the
results to a multi-page pdf device. Sometimes it fails. Under R-2.2.1
it just gave segfaults. Under R-2.3.1 it gave this error message:
*** caught segfault ***
address (nil), cause 'memory not mapped'
Traceback:
1:
2011 Jun 11
0
problems with geom_vline, histograms, scale=free and facets in ggplot
Dear list,
I?m having a little trouble with adding vertical lines to a histogram.
I need to draw a matrix of histograms (using facets), and in each
histogram add a vertical line indicating the mean value of the data in
each facet. According to the last example in the geom_hline help, to
display different lines in each facet I need to provide a data frame.
I modified this example to make a plot
2007 Feb 22
1
[LLVMdev] opt -verify
I think I misread the doxygen. verifyFunction & verifyModule return
false if no errors are detected. However, my question now becomes why
does the code produced by my transform pass verification, but it causes
an assertion failure in the byte reader when it (the code produced by my
transform) is passed to another invocation of opt?
Ryan M. Lefever wrote:
> I also tried iterating
2016 May 24
2
Suggestion: mkString(NULL) should be NA
On Tue, May 24, 2016 at 9:30 AM, Jeroen Ooms <jeroen.ooms at stat.ucla.edu>
wrote:
> On Tue, May 24, 2016 at 5:59 PM, Gabriel Becker <gmbecker at ucdavis.edu>
> wrote:
> > Shouldn't Rf_mkString(NULL) return (the c-level equivalent of)
> character()
> > rather than the NA_character_?
>
> No. It should still be safe to assume that mkString() always returns
2009 Jan 19
1
patch for textspecial and defaultfont in xfig
Hello,
The current xfig device lacks the functionality to set the
textspecial flag and use the defaultfont in xfig. This is necessary
when you want to export to xfig and use interpreted text (e.g., $
\frac{1}{e}$ gets interpreted by latex). The attached patch adds this
functionality.
Why would you like to do this?
- Use math in labels (e.g., name your variables $r_{xy}$, do a
2001 Apr 02
0
Constructing a contingency table
Greetings. I'm having some trouble constructing a contingency table from
raw data (actually read in via RPgSQL). Here's the deal:
- What I've got: a data frame in the form:
Groupcode code1 code2 code3 code4 code5 .. coden
where groupcode is one of {P,C,B,S,U,X} and code{1..n} is TRUE or
FALSE. code{1..n} are NOT mutually exclusive, so between 0 and n of them
can be TRUE.
-
2007 Jul 23
2
R2.6 bug in arithmetics of S4 classes inherited from 'array', or intended behavior?
Hi,
I have an S4 class directly derived from 'array' as shown in the code
below (EBImage package of Bioconductor 2.1, devel), it simply contains
array adding a couple of slots:
setClass ("Image",
representation (colormode="integer", filename="character",
compression="character", resolution="numeric", features="list"
),
2011 May 31
1
Coercing in R and in C (R-Extensions)
Hello,
in "Writing R Extensions" I found the following stuff:
"Note that these coercion functions are not the same as calling as.numeric
(and so on) in R code, as they do not dispatch on the class of the object.
Thus it is normally preferable to do the coercion in the calling R code."
( Writing R Extensions, 2011-04-13, page 100 )
What is meant by