Displaying 20 results from an estimated 10000 matches similar to: "Split charts with ggplot2, tidyquant"
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
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 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 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
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 18
0
Split charts with ggplot2, tidyquant
Hi Charlie,
I am comfortable to put the data in any way that works best. Here are two
possibilities: an xts and a data frame.
library(quantmod)
quantmod::getSymbols("SPY") # creates xts variable SPY
SPYxts <- SPY[,c("SPY.Close","SPY.Volume")]
SPYdf <- data.frame(Date=index(SPYxts),close=as.numeric(SPYxts$SPY.Close),
2018 Jan 18
3
Split charts with ggplot2, tidyquant
Could you provide some information on your data structure (e.g., are the
two time series in separate columns in the data)? The solution is fairly
straightforward once you have the data in the right structure. And I do
not think tidyquant is necessary for what you want.
Best,
Charlie
--
Charles Redmon
GRA, Center for Research Methods and Data Analysis
PhD Student, Department of Linguistics
2017 Oct 18
1
Problem with tq_mutate_xy() from the tidyquant package
I was able to reproduce the problem with this self-contained example. Maybe
it could be reproduced with an even smaller one ...
library(tidyquant) # Loads tidyverse, tidyquant, financial pkgs, xts/zoo
library(xts)
dtV <- as.Date("2017-01-01") + 1:100
locL <- list( foo=xts(rnorm(100), order.by=dtV), bar=xts(rnorm(100),
order.by=dtV) )
fullXts <- do.call(merge,locL)
smallXts
2006 Sep 19
1
Adding percentage to Pie Charts (was (no subject))
Have you read the books by Cleveland?
His experiments show that most people do better estimating things and
comparing things on a linear scale rather than looking at angles and
areas (also see
http://biostat.mc.vanderbilt.edu/twiki/pub/Main/StatGraphCourse/graphsco
urse.pdf)
With a dot chart you can set the axis to go from 0 to the total of all
groups (see the example I sent before, it could
2017 Aug 07
1
tidyquant error downloading symbols for Index
Hi R Helpers,
I recently tried to take advantage of the ability to download all the
tickers in the S&P 500 using the functionality of tidyquant, but it threw
an error.
For summary, the set of commands that I ran was
library(tidyquant)
tq_index_options()
tq_index("SP500")
sessionInfo()
R feedback including error message and sessionInfo are provided below.
Guidance would be
2003 Aug 17
0
FibMaster charts..
I have posted some charts for this week, showing critical support
and resistance areas, and possible trade setups..
These are for stocks MO, TTEK, IBM, MERQ.. I may post some more before the weekend is over. Check back in future, look for
updates as these charts develop.
To see the charts, log in here:
<http://www.fibmarkets.com/cgi-local/yabb/YaBB.pl>
and then click on the "Traders
2013 Aug 22
0
Close with a ggplot chart but need a little assistance
I have the following code and data
data.csv
"","Goal","Frequency","Weight","Group"
"1","Move",13,0.245283018867925,"Public"
"2","Create",10,0.188679245283019,"Public"
"3","Strengthen",30,0.566037735849057,"Public"
2008 Oct 02
0
Gruff bar charts and zero data
Hi - I am creating bar and stacked bar charts in Gruff, but the problem
I am having is that zero data is showing up as a thin bar. (It also
seems to be that way in examples I have seen online where a zero value
still shows as a thin bar or slice)
It''s not a major issue to see a thin sliver on a plain bar chart, but on
my stacked bar chart if I have more than one zero value in a
2008 Feb 16
1
ggplot2 & ribbon
I would like to be able to shade between two lines using ggplot2 (with
faceting too). But, despite reading all the documentation on the website,
cant figure out how to do it (either because i am a novice or idiot - or,
of course, possibly both)
My data looks is readership of paid & free newspapers in london by age since
1994. The structure is
reading.melt <-
structure(list(Date =
2010 Feb 04
6
problems with SPC charts in R
Hi all,
I am using SPC techniques of plotting Xbar, R, S, P and C charts in R.For
this I am using qcc package in R and also using the following document for
reference.
http://www.stat.unipg.it/~luca/Rnews_2004-1-pag11-17.pdf
But while plotting S chart, R chartchart and also C chart I am getting
following errors.
I have plotted the Xbar chart successfully using following command
obj <-
2008 Mar 04
1
qplot (ggplot2) faceting histogram with missing values
Hi,
I've run into a difficulty with qplot function (in the ggplot2
package). I can facet histograms even when the faceting variable
contains missing values, but only so long as the faceting variable is
not a factor.
Example:
y1 <- rnorm(10)
x1 <- c(rep(1,5), rep(2,4), NA)
x2 <- factor(c(rep(1,5), rep(2,4), NA))
library(ggplot2)
qplot(y1, geom = "histogram", facets =
2008 Oct 06
2
Stacked area chart and legends
I have found lots of good advice on this forum about stacked area charts but
I?ve run into problems with the 2 recommended options: stackploy in plotrix
or qplot in ggplot2. I have a many page report that will be in a 2x2 page
format ?par(mfrow=c(2,2))?? and need one of the page components to be a
stacked chart.
I?d prefer to use stackpoly, if possible, but I?m stuck on how to do the
legend in
2009 Feb 24
0
creating bar charts with nested groups
I'm looking for a way to create bar charts with nested groups levels.
I have data that is seperated to this factors:
1. Day part - day/night.
2. Season - summer/winter.
3. habitat - Cover/Open
I have created in Excel the following chart which I would like to create in
R:
http://www.nabble.com/file/p22180918/chart.jpg
I have seen this nice post:
2009 Feb 03
2
ThinkCell type waterfall charts in R?
Hi all,
with PowerPoint and ThinkCell one can draw something they call waterfall
chart and it looks like this:
http://www.think-cell.com/products/images/waterfall.gif
I found discussions on waterfall charts in the archive of this
mailinglist, but unfortunately they looked totally different. Other
names for this type of plot seem to be bridge chart, cascade chart,
stair case chart, etc. but
2008 Jun 24
1
Bar charts with error bars
I would like to add error bars to a bar chart, I have created in R. I am able to add error bars to a bar plot, but the same method does not seem to work for my bar chart version.
Is there a way to add error bars to bar charts?
________________________________________________________
Audi, Fiat, Peugeot, Skoda, Porsche, Toyota, Ford - Kelkoo har brugte biler til en hver smag! Klik her