Displaying 20 results from an estimated 8000 matches similar to: "Word wrapping for character objects (WINDOWS R ONLY)"
2008 Jun 04
2
Constructing groupedData objects in nlme - a little problem
Dear R-help,
I am trying to create groupedData objects using the nlme library. I'm
missing something basic, I know:
Here is the first example in ch.1 of Pinheiro & Bates (2000):
library(nlme)
x2=Rail$travel;x1=Rail$Rail;eg1=data.frame(x1,x2);eg1gd=Rail
print(eg1gd)
x11();print(plot(eg1gd))
femodel=lm(x2~x1-1,data=eg1gd)
print(femodel$coefficients)
Result:
x12 x15 x11
2008 Jan 06
4
[LLVMdev] Another memory fun
hm.... I think, that is valid in c
but next code too doesn't works right:
; ModuleID = 'sample.lz'
@.str1 = internal global [6 x i8] c"world\00" ; <[6 x i8]*>
[#uses=1]
@.str2 = internal global [7 x i8] c"hello \00" ; <[7 x i8]*>
[#uses=1]
@.str7 = internal global [7 x i8] c"father\00" ; <[7 x i8]*>
[#uses=1]
2011 Aug 10
2
using if then statements in a dataframe
I used this service several months ago and was very pleased with the response.
I have a dataframe with several thousand lines and to each line I need to apply a series of "if else" statements. For each row I need either a value or a blank/NA. Below is the series of if else statements I have been trying without success to integrate into a function such as "apply".
if
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr,
I think I found a working matcher: match
ifStmt(hasCondition(implicitCastExpr(hasImplicitDestinationType(isInteger()),
has(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("compare"))),
hasArgument(0, declRefExpr().bind("str2")),
callee(memberExpr(has(declRefExpr().bind("str1"))))))))).bind("case1")
This one bind to both str1 and str2 in
2016 Nov 28
2
Looking for help with an ast matcher
Hi Piotr,
Thanks. Yeah, it seemed a little weird, but it was what got me closest. I
found out that the matcher I supplied here was working for clang-query
3.8.1. I'm working on a clang-tidy module for 4.0.0 - it's not working
there.
Could you elaborate on the "onImplicitObjectArgument"? There is no document
on it on the clang page. So I wouldn't know how it works or what it
2008 Aug 09
1
Converting nested "for" loops to an "apply" function(s)
Hello,
I would like to know more about how to use the "apply" family and have attempted to convert nested "for" loops in example code from Contributed Documentation ("The Friendly Beginners' R Course? by Toby Marthews (ZIP, 2007-03-01)") to an "apply" function(s). The relevant code is:
distances=c(51,65,175,196,197,125,10,56) #distances of 8 houses
2006 Jun 14
1
R internal clock time discrepancy
Dear R:
I'm trying to map some time series data on to dates and
because I'm using R's "strptime' facility I get an hour's
break in my time series: my readings for between 1am and
2am on 27th March 2005 won't map onto anything (I'm using a
data logger to record temperature and other things in a
forest).
As far as I know, the clock's didn't change on 27th
2008 Jan 06
0
[LLVMdev] Another memory fun
It's invalid for the same reason that
char *foobar = strcat("foo", "bar");
is invalid in C. Please make sure you understand what you're asking LLVM
to do before going any further down this path. A good approach is to
write out the correct code in C and then use llvm-gcc (or the demo page
at http://llvm.org/demo ) to see what it looks like in LLVM assembly.
Nick
2013 Oct 24
2
[LLVMdev] LLVM use chains
Hi,
I have:
...
@.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
function\0A\00", align 1
; Function Attrs: ssp uwtable
define i32 @_Z1fv() #2 {
entry:
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21
x i8]* @.str1, i32 0, i32 0))
ret i32 0
}
Then I get after trying to erase the function from the module:
511
2007 Jun 08
1
Question about Running C code from R
Dear R-devel,
Apologies for sending what is probably a very simple question to R-devel: I am definitely missing something very simple and can't work out what it is. I've been trying to find the problem here for about a month and need some help!
I am trying to work out how to run a C program from an R script. Rather than try the C program directly, I'm trying to get a much simpler
2013 Oct 24
2
[LLVMdev] LLVM use chains
On 10/24/13 2:13 AM, Rafael EspĂndola wrote:
> On 23 October 2013 22:41, Vassil Vassilev <vvasilev at cern.ch> wrote:
>> Hi,
>> I have:
>> ...
>> @.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
>> function\0A\00", align 1
>> ; Function Attrs: ssp uwtable
>> define i32 @_Z1fv() #2 {
>> entry:
>> %call =
2008 Jan 06
4
[LLVMdev] Another memory fun
Hey again)
Now I have next code:
; ModuleID = 'sample.lz'
@.str1 = internal global [8 x i8] c" world!\00" ; <[8 x i8]*>
[#uses=1]
@.str2 = internal global [8 x i8] c"hello, \00" ; <[8 x i8]*>
[#uses=1]
@.str7 = internal global [21 x i8] c"welcome to out hall!\00" ;
<[21 x i8]*> [#uses=1]
declare i32 @puts(i8*)
2013 Oct 24
0
[LLVMdev] LLVM use chains
On 23 October 2013 22:41, Vassil Vassilev <vvasilev at cern.ch> wrote:
> Hi,
> I have:
> ...
> @.str1 = private unnamed_addr constant [21 x i8] c"Now f is a
> function\0A\00", align 1
> ; Function Attrs: ssp uwtable
> define i32 @_Z1fv() #2 {
> entry:
> %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([21 x
> i8]* @.str1, i32 0,
2008 Jan 06
0
[LLVMdev] Another memory fun
Zalunin Pavel wrote:
> hm.... I think, that is valid in c
[snip]
> I tried decompile code:
> main(int argc, char **argv) {
> char str1[] = "mother ";
> strcat(str1, "father");
> return 0;
> }
>
This is valid C but you forget that str1 is not magically expanded by
strcat. It starts out as, and remains a char array with 8 elements.
>
2016 Nov 27
2
Looking for help with an ast matcher
Adding cfe-dev, because it is related to clang, not LLVM.
2016-11-27 22:34 GMT+01:00 Piotr Padlewski <piotr.padlewski at gmail.com>:
> Hi Mads,
> Can you provide the code that you run clang-query on, or at least AST for
> the fragment you want to match?
>
> Piotr
>
> 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org
> >:
>
2016 Nov 26
2
Looking for help with an ast matcher
Hi,
Hope this is the right channel for this question. I am trying to make an
ast matcher for clang-tidy to find str1.compare(str2), where both str1 and
str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png .
But I am having a hard time finding a way to bind an id to the str1 part of
the expression.
Can anyone help me out with an idea?
Best regards,
Mads Ravn
--------------
2007 Dec 13
6
spliting strings ...
Hi everyone,
I have a vector of strings, each string made up by different number of words. I want to get a new vector which has only the first word of each string in the first vector. I came up with this:
str <- c('aaa bbb', 'cc', 'd eee aa', 'mmm o n')
str1 <- rep(1, length(str))
for (i in 1:length(str)) {
str1[i] <- strsplit(str, "
2007 Oct 02
2
using sprintf with dates
hello,
Please help with using sprintf with character variables:
The following does not produce what i intended
foot=function(){
str1=format(Sys.Date,"%Y%m%d")
sprintf("99%-4s%s","nm",str1)
}
I wanted to have "99nm 20071002" as the output.
2019 Mar 09
2
Cast a function parameter to GEP
Hi all,
I'm still working on the Interpreter class and I would like to understand
why an operand cannot be cast to GetElementPtrInst.
My code is something like:
void MyInterpreter::visitCallInst(CallInst& I)
{
for(int i = 0; i < I.getNumArgOperands(); i++) {
operand = I.getOperand(i);
if(GetElementPtrInst* CI =
dyn_cast<GetElementPtrInst>(operand)) {
2010 Jun 30
2
string question
Hi,
How can I get double quotes embedded in the string?
Example:
--------------
str1 <- '"xyz"'
## desired output
# abc"xyz"
qr2 <- paste('abc',str1,sep='')
print(qr2)
-----------------
Actual output:
> [1] "abc\"str\""
I also tried putting an escape sequence before the quote, but couldn't get the
string that I