Displaying 20 results from an estimated 20000 matches similar to: "how does one print code"
2011 Mar 20
2
Convert Sweave document to a function
I like Sweave, which I consider to be a great contribution. I have just
written a .Rnw document that comes to about 6 pages of mixed code and
mathematical explanation. Now I want to turn the R code into a function. My
R code currently contains statements like N<-1000 and theta<- pi/10. In the
next version of the document, I want N and theta to be parameters of a
function, so that they can be
2010 Apr 09
4
perhaps regular expression bug with | sign ??
Here is my interaction with R:
> sub(x='>|t|',pattern = '|t',replacement='zz')
[1] "zz>|t|"
So I say to myself "Clearly the | signs need to be escaped, so let's try
this"
> sub(x='>|t|',pattern = '\|t',replacement='zz')
[1] "zz>|t|"
Warning messages:
1: '\|' is an unrecognized escape in a
2009 Dec 29
3
error logging
Yet another question...
I'm wondering if there is a built in facility to log errors. I've got this
statement that gives me verbose DBI errors as they come up (to standard
output), but I'd like to trap and log them to a file as I running about
3000000 sql statements through this particular piece of code and I'd like to
keep the loop going and deal with all the errors once the
2008 Dec 02
1
simultaneous plots
Is there a good and concise way of making simultaneous plots that are
identical, but directed to different devices?
I'm writing an R-script that produces a pdf file. I would really like to
check visually whether the pdf file shows what I expect. So I would like the
same commands to produce a plot on screen. At the moment I'm using
cut-and-paste, which is not ideal because any corrections
2009 Aug 21
4
Where to put source code?
I'm trying to move from Matlab to R, and I'm stuck even getting
started. This sounds to me like the dumbest question in the world
but... how does one put R source code in files? Over the last three
days I've gone front to back through the Introduction to R and the R
Language Definition, and while I'm excited that the language is so
Lispish, none of what I read described how to
2010 Sep 08
2
subbing a string vector for another string vector
I have a data frame with two columns:
image pattern
1 http://$IMAGE_ID$ www.url.com/image.jpg
2 $IMAGE_ID$ http://www.blah.com/image.gif
...
I want to replace "$IMAGE_ID$" with the corresponding entry in the pattern
column such that the result would appear as follows:
url
http://www.url.com/image.jpg
2016 Mar 01
2
Insert CallInst within a function passing same parameters of the calling function.
Hi,
supposing I have a function “foo” like the following:
int foo(int a, int b) {
...
...
}
I want to insert int the LLVM IR a call instructions to a function “bar” that requires the same parameters of foo.
So my function foo will become:
int foo(int a, int b) {
bar(a,b);
…
...
}
I am using the following code:
bool ThreadSanitizer::runOnFunction(Function &F) {
2008 Oct 29
1
FW: Re: linux batch question
Hi Phil: That's EXACTLY what it is. Thanks so much. It's nice to know
that the R Gods don't hate me. I hope it's okay that I'm going to cc
r-help
in case this thread comes up in the future and also so that other people
who might want to help know that it's solved. Thanks again.
On Wed, Oct 29, 2008 at 5:01 PM, Phil Spector wrote:
> Mark:
>
>> delete
2008 Jul 20
4
drawing segments through points with pch=1
Please excuse me for asking such basic questions:
Here is my code
> y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12)
> ybar=mean(y)
> ll=length(y);
> ybarv=rep(ybar,ll)
> x=1:ll
> plot(x,ybarv,pch=1)
> segments(x[1],ybar,x[ll],ybar)
What I get is a collection of small circles, with a segment "on top"
of the circles, which is almost what I want. But I
2008 Dec 19
1
[LLVMdev] strange behaviour after extracting optimization pass code
Hi,
I am expieriencing strange behaviour of llvm's optimization passes and I
don't understand what I am doing wrong.
Basically all I've done is extracting code for optimization of a
llvm-function in a llvm-module and put it into a separate function for
better readability. The original code looks like follows (and works as
expected):
-----------------------------
std::string
2017 Jun 27
3
Testing utility for building and updating CFG
Hi folks,
I’m working on adding an API for incremental updates to DominatorTree and I
noticed that there isn’t a simple way to quickly build and update CFG (just
for testing) -- one has to either build CFG programmatically, or write IR
by hand and manually map pointers to basic blocks. The downside is that it
tends to be pretty verbose and not easy to update (e.g. adding a new edge
often involves
2009 Jan 13
7
Access 2000 forms
Trying to open and edit a form in wine using Access 2000. Only problem is that the file I need is over the network on a win xp server. I can bring up Access just fine, click open, but when I click on network places I get this:
[Image: http://i283.photobucket.com/albums/kk317/phydeaux24/Screenshot.png ]
I have tried everything but I'm horribly new to this. Please help.[/img]
2010 Aug 19
3
[LLVMdev] using external functions from llvm
The blog post I linked to implied that adding a symbol in the form
lle_X_FUNCTIONNAME would allow you to call a function called FUNCTIONNAME.
Is this not the case?
On Thu, Aug 19, 2010 at 6:46 PM, <o.j.sivart at gmail.com> wrote:
> You are adding the symbol as "lle_X_create_number_object" yet your error
> message implies you have tried to lookup and use
2013 Sep 02
1
Sweave: printing an underscore in the output from an R command
I am working with Sweave and would like to print out into my latex document the result of the R command
version$platform
So what I first tried in my .Rnw document was \Sexpr{print(version$platform)}.
However, the output from this command is the string "x86_64-apple-darwin10.8.0" (without the quotes). This contains an underscore, which is a special character in tex and so I get an error
2004 Aug 03
3
keep.source.pkgs()
Recently Brian Ripley had occasion to mock my inability to see a
comment in the code for arima(), in the stats package. After
considerable dredging around in the r-news archives I found reference
to keep.source() and keep.source.pkgs(), which I conjectured just
***might*** possibly be the ``obvious'' resource to which Prof.
Ripley thought I ought to have resorted.
However, after
2009 Sep 22
2
cannot build R-devel (>= r49747)
Hello,
I've tried several times yesterday to build R-devel and I consistently
get this error when I "make" :
mkdir -p -- ../../../library/base/R
make[3]: Leaving directory `/tmp/R-devel/src/library/profile'
make[3]: Entering directory `/tmp/R-devel/src/library/base'
building package 'base'
make[4]: Entering directory `/tmp/R-devel/src/library/base'
mkdir -p --
2009 Jun 13
1
Portuguese translation problem (PR#13756)
Full_Name: Adriano Azevedo Filho
Version: 2.9.0
OS: Windows Vista
Submission from: (NULL) (201.68.79.62)
The error message produced when the function name typed in the console is
misspelled in the Portuguese translation. This is not a new issue but as it is
around for sometime I've decided to report. As this is a frequent message when
beginners start using R, it gives an unfortunate bad
2011 Aug 09
1
Matlab to R
I am trying to convert a matlab code to R.
Most of the conversion statements are simple, but problem is with return.
Since it's a recursive function it's a bit complicated. Anyway in matlab
we can have return statment like
[price, notional] = functionname()
and also for the same function...
notional(1) = functionname()
how to do this in R? i have tried using data frame but still
2010 Feb 26
1
match.call to obtain the name of a function
Within a function I'd often like to obtain a text string equal to the name of the function.
One use for this: To generate a filename for use in pdf(). This enables me to keep track of which function generated a particular graphic came.
match.call() puts parentheses at the end of the name. I don't want parentheses in a filename.
The following kludgey function gives the desired result.
2016 Apr 26
2
How to print the frequency table (produced by the command "table" to Excel
Hi,
How could we print the frequency table (produced by "table") to an Excel
file?
Is there an easy way to do so? Thanks,
Miao
> df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3])
> table(df[,c("y","z")])
z
y a b c
1 0 0 1
2 0 1 0
3 1 0 0
> test<-table(df[,c("y","z")])
> as.data.frame(test)
y z Freq
1 1 a