Displaying 11 results from an estimated 11 matches similar to: "Modifying a list: what gets copied?"
2013 Apr 30
1
trace with reference class
Hi
The final line of the example in ?setRefClass induces an error:
> ## debugging all objects from class mEdit in method $undo()
> mEdit$trace(undo, browser)
Error in envRefInferField(x, what, getClass(class(x)), selfEnv) :
'undo' is not a valid field or method name for reference class
"refGeneratorSlot"
$trace tries to embed the trace in the generator object (instead
2011 Jan 15
1
Truetype and Opentype font in pdf device
Deal all,
I want to know if truetype or opentype fonts are available in pdf
device (i.e., pdf() or dev.copy2pdf()), and if so, how to do it?
Now I can do as followings:
1. convert ttf to afm using ttf2afm, e.g.: $ ttf2afm Impact.ttf > Impact.afm
2. put the afm file in $R_HOME/library/grDevices/afm
3. register a new type1 font: pdfFonts(Impact=Type1Font("Impact",
2012 Mar 28
1
rep with bigz in gmp
Hi
With package:gmp, is this an expected behavior?
> rep(1:3, rep(3, 3))
[1] 1 1 1 2 2 2 3 3 3
> rep(as.bigz(1:3), rep(3, 3))
Big Integer ('bigz') object of length 9:
[1] 1 2 3 1 2 3 1 2 3
This code is used inside `outer`, so more worse
> outer(1:3, 1:3, `*`)
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 2 4 6
[3,] 3 6 9
> outer(as.bigz(1:3),
2012 Apr 05
1
using for loops with ggplot
Hi all, I have been using ggplot for a few months and ran into this
porblem, I am trying to use ggplot in a for loop and it is not working. if
I do the following:
data=as.data.frame(cbind(rnorm(10),rnorm(10),rnorm(10)))
############
pp=ggplot(data, aes(x=(1:10), y=data[,1]))
pp=pp+geom_line(aes(x=(1:10),y = data[,1]),lty=2)
pp=pp+geom_line(aes(x=(1:10),y = data[,2]),lty=2)
2018 Jan 19
2
Split charts with ggplot2, tidyquant
So the general strategy for getting these into separate panels in ggplot
is to have a single variable that will be your response and a factor
variable that indexes which original variable it came from. This can be
accomplished in many ways, but the way I use is with the melt() function
in the reshape2 package.
For example,
library(reshape2)
plotDF <- melt(SPYdf,
??? ??? ??? ??? ??? ???
2018 Jan 20
2
Split charts with ggplot2, tidyquant
For this kind of control you will probably need to move to base graphics
and utilize the `fig` argument in par(), in which case you would want to
run the plot() command twice: once with your first outcome and once with
your second, changing the par() settings before each one to control the
size.
On 01/19/2018 01:39 PM, Eric Berger wrote:
> Hi Charlie,
> Thanks. This is helpful. As
2010 Dec 10
1
melt causes errors when characters and values are used
Hello,
I am finding that the melt function from the reshape library causes
errors when applied to a data.frame that contains numeric and character
columns. For example,
melt(id.vars="ID",data.frame(ID=1:3,date=c("a","b","c"),value=c(1,4,5)))
ID variable value
1 1 date a
2 2 date b
3 3 date c
4 1 value <NA>
5 2
2018 Jan 20
0
Split charts with ggplot2, tidyquant
That (the need for base graphics) is false. It certainly **can** be done in
base graphics -- see ?layout for a perhaps more straightforward way to do
it along the lines you suggest.
However both lattice and ggplot are based on grid graphics, which has a
similar but slightly more flexible ?grid.layout function which would allow
one to size and place subsequent ggplot or lattice graphs in an
2018 Jan 21
1
Split charts with ggplot2, tidyquant
Thanks for the reminder about lattice! I did some searching and there's
a good example of manipulating the size of subplots using the `position`
argument (see pp. 202-203 in the Trellis Users Guide:
http://ml.stat.purdue.edu/stat695t/writings/Trellis.User.pdf). This is
not within the paneling environment with the headers like in other
trellis plots though, so you'll have to do a bit
2018 Jan 19
0
Split charts with ggplot2, tidyquant
Hi Charlie,
Thanks. This is helpful. As mentioned in my original question, I want to be
able to plot a few such charts on the same page,
say a 2 x 2 grid with such a chart for each of 4 different stocks. Using
your solution I accomplished this by making
a list pLst of your ggplots and then calling cowplot::plot_grid(
plotlist=pLst, nrow=2, ncol=2 ) That worked fine.
The one issue I have is that
2012 Apr 15
6
CRAN (and crantastic) updates this week
CRAN (and crantastic) updates this week
New packages
------------
* disclapmix (0.1)
Maintainer: Mikkel Meyer Andersen
Author(s): Mikkel Meyer Andersen and Poul Svante Eriksen
License: GPL-2
http://crantastic.org/packages/disclapmix
disclapmix makes inference in a mixture of Discrete Laplace
distributions using the EM algorithm.
* EstSimPDMP (1.1)
Maintainer: Unknown
Author(s):