I would like to print the label of each code chunk, just before printing the
code chunk itself. Is that possible using SweaveHooks, or by some other
mechanism?
Thanks
David
--
View this message in context:
http://r.789695.n4.nabble.com/Sweave-SweaveHooks-and-printing-the-label-tp3453829p3453829.
Thanks to everyone for writing. A well-known phenomenon in mathematics,
statistics and/or complex computing is that everything one already knows
feels trivial and easy. It's as though one is permanently climbing a
vertical cliff-face, while, if you look back from where you've come, you see
a level
Hello, I don't want to find out how to make packages unless that becomes
necessary. Also, I don't want to clog up the computer memory with functions
that I'm not using. (It would be great if someone in this forum would
explain how memory is used when I type library(MASS) and then use only one
funct
Sweave is very useful, and I'm gradually getting used to it.
I've just been battling Sweave over the re-use of code chunks. As I am
pretty ignorant in the byways of both Sweave and R, this took a chunk of
time to sort out. Here is what I learned:
If one re-uses a code chunk, then Sweave (but not
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
Duncan Murdoch-2 wrote:
>
> ..
> That's because constructing names like this is generally a bad idea.
> But you can do it; you use get() to get the object whose name is in
> temp.name. So put data=get(temp.name) into your lm() call.
>
I had another useful answer (sent privately) from
I'm trying to get code along the following lines to work:
temp.name <- paste(TimePt,'df',sep='.') # invent a relevant name/symbol as a
character string.
assign(temp.name,IGF.df[IGF.df$TPt==TimePt,]) # this works. The relevant
variable is now a data frame
lm(b ~ Strain+BWt+PWt+PanPix, data=temp.nam
In a .Rnw file I want to insert the R command
pairs(mydataframe)
and achieve the following effects
1. the command itseld is echoed into the tex document generated by Sweave
<>=
2. The graphics generated appears in the tex document, with the graphics
centred.
3. The R command > pairs(mydataframe)
Given an ordered factor, how does one unorder it?
I tried various commands with reorder, with order=F, but they all gave me
error messages. I also tried to drop the order with various 'as dot
something' commands, but these didn't work either.
--
View this message in context:
http://n4.nabble.com
William Dunlap wrote:
>
>
>> > sub(x='>|t|',pattern = '\|t',replacement='zz')
>> [1] "zz>|t|"
>> Warning messages:
>> 1: '\|' is an unrecognized escape in a character string
>> 2: unrecognized escape removed from "\|t"
>> How can \| be an unrecognized escape? This flatly contradicts
>> help('
I have a data frame with two variables that are factors. One is actually a
TRUE/FALSE factor, and I have coded it as 1/0, a continuous variable, but I
could turn it back into a factor. The second is an ordered factor and
consists of five timepoints. There are several continuous variables as well.
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 charact
I downloaded the code, as Duncan Murdoch suggested. I also used sink() as
suggested by others and found that the two methods gave identical results. I
then fixed the bug in a private file and tried it out on a number of
examples. It now seems to work fine, as far as I can tell.
>From CRAN, I foun
There is quite a long piece of code defining a certain function in one of the
R packages.
I think the code has a bug and I want to get the code into a file so that I
can take a proper look, and possibly fix it.
how does one do this? (I mean getting the code into a file, not fixing the
bug.) I sup
Thanks. A nice simple answer and exactly what I want.
David
--
View this message in context:
http://n4.nabble.com/appending-an-R-object-to-a-list-tp1753544p1753665.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org m
How do I append an R-object to a list?
I want to start with an empty list, and append R-objects one by one.
Does this start with a command like
mylist <- NULL
??
I have read a few answers on R-help to questions like this, but they all
seem to be well off the point. Sometimes it's assumed that the
16 matches
Mail list logo