Displaying 20 results from an estimated 500 matches similar to: "Plotting error while using ggplot facet"
2013 Jan 21
1
Faceting in ggplot with 3 series in each plot
I have created a graph with basic R plot with 2 rows and 3 columns. With
the basic plot feature of R I had to write several lines of code to come up
with the graph https://www.dropbox.com/s/f7d6ei6krtcrtti/hello.png
I was wondering whether we can plot multiple series in each plot using
ggplot as created in the above link. If anyone could give me any suggestion
then I could try on ggplot.
I
2013 Jan 24
1
Insert segment only on particular facets in ggplot
Dear R users,
I am working on a data-set with 3 species. They are apple, orange and
banana.
I want to annotate the facets only on the bottom panel. However, by default
I am getting annotations on all the plots. I was able to get text
annotation only on the desired plot. However, I am confused what I need to
do for the arrows / segments.
Here is my code:
library(ggplot2)
library(grid)
tempobs
2013 Apr 18
5
Subsetting a large number into smaller numbers and find the largest product
Hello,
I have a big number lets say of around hundred digits. I want to subset
that big number into consecutive number of 5 digits and find the product of
those 5 digits. For example my first 5 digit number would be 73167. I need
to check the product of the individual numbers in 73167 and so on.
The sample number is as follows:
2013 Jan 21
1
Very slow in processing the equation in the scatter plot ggplot
Hello All,
I have plotted a scatter plot in ggplot2 and added a regression line and a
regression equation. But the processing is very very slow. One reason might
be because I have so many data pairs. Is there any way to speed up this
code ? I need to create a multiple layout as well.
The code I have used is as follows:
setwd("C:/Users/jzd0009/Documents/R software")
mydata <-
2013 Feb 07
4
low pass filter analysis in R
Hello R users,
I am trying to use R to do the low pass filter analysis for the tidal data.
I am a novice in R and so far been doing only simple stuffs on R. I found a
package called signal but couldn't find the proper tutorial for the low
pass filter.
Could anyone point me to the proper tutorial or starting point on how to do
low pass filter analysis in R ?
Thank you so much.
Janesh
2013 Feb 19
5
Converting the data in year month day hour and minutes to date
Hi ,
I am trying to convert the date as factor to date using "as.date" function
in R. I have the date in the following format
2008-01-01 02:30
I tried to use the following command :
as.Date(mydata$Date, format="%y-%m-%d ")
Can somebody help me with this ? I was able to convert the format with no
hour but getting difficulty with hour included.
Thank you.
2013 Feb 01
2
Summary of data for each year
Hello All,
I have a data with two columns. In one column it is date and in another
column it is flow data.
I was able to read the data as date and flow data. I used the following
code:
creek <- read.csv("creek.csv")
library(ggplot2)
creek[1:10,]
colnames(creek) <- c("date","flow")
creek$date <- as.Date(creek$date, "%m/%d/%Y")
The link to my data
2013 Jan 19
1
Is it possible to create color ramp legend in spplot for discontinuous data ?
Hello All,
I have a discontinuous dataset and I used spplot to plot the points.
I was wondering whether it is possible to show the legend of the plot as
color ramp. I saw that on continuous data. If anyone could tell me that
would be great.
Another thing I would like to know is how can we create the horizontal
legend. By default, the legend is vertical.
I was able to shift the legend inside
2013 Mar 19
1
Convert to date and time of the year
Dear R Users,
I have data for more than 3 years. For each year I want to find the day
corresponding to Jaunary 1 of that year. For example:
> x <- c('5/5/2007','12/31/2007','1/2/2008')
> #Convert to day of year (julian date) -
> strptime(x,"%m/%d/%Y")$yday+1
[1] 125 365 2
I want to know how to do the same thing but with time added. But I still
2013 Jan 21
2
How to read a file with two data sets in text format
Hello All,
I have a data file in a text format and there are two data sets. The data
set are continuous.
For each data set there is a header which has the number of data rows and
the name of data series.
For example first data set has "6240 Terry Cove-Model". Then the data for
that series follows upto 6240 rows. Then another data would start and it
will have the header such as
2013 Feb 14
1
Clip a contour with shapefile while using contourplot
Hi, I have done the interpolation for my data and I was able to create the
contours in multipanel with the help of Pascal. Now, I want to clip the
contour with the shapefile. I want only the portion of contour to be
displayed which falls inside the boundary of the shapefile.
The data mydata.csv can be found on
https://www.dropbox.com/s/khi7nv0160hi68p/mydata.csv
The data for shapefile can be
2010 Nov 09
1
ggplot2: facet_grid with different vertical lines on each facet
Hello,
I am plotting many histograms together using facet_grid in ggplot2. However,
I want to then add a vertical line to each histogram, or facet, each of
which vertical lines are at different x-values.
The following example adds all vertical lines to each facet:
ggplot(data,aes(values)) + geom_histogram() + facet_grid(.~variable) +
geom_vline(xintercept=c(5,10,15))
How can I add a vertical
2008 Aug 23
1
ggplot facet: change layout of panels
Hi,
is there anyway to adjust how ggplot(facet=) displays the layout of
panels? I have a dataset with many 25 groups and gplot(y,x,facet=
.~group) displays all 25 y~x plots next to each other so overall the
plot is too wide. if i do the same plot in lattice xyploy(y~x|group)
the y~x plots are arranged nicely 5 in each row to overall the plots
is a nice 5 by 5 rectangular grid.
Is there any way
2013 Oct 15
0
compute current values in a facet
Hello Experts,
I found this example on web and use it just for explanation.
( http://stackoverflow.com/questions/15867263/ggplot2-geom-text-with-facet-grid )
library(ggplot2)
x <-runif(9, 0, 125)
data <-
2008 Feb 27
1
how to specify ggplot2 facet plot order
Hi, new to R and ggplot2. I've been trying to get a facet plot in which the
order of the facets is as I require, rather than ordered numerically,
alphabetically, by Roman numerals, mean (answers to these were posted here
after much searching). Here's some test code to demonstrate what I get.
series = c('C2','C4','C8','C10','C15','C20')
ids =
2013 Jun 10
1
All against all correlation matrix with GGPLOT Facet
I have the following data:
v <- rnorm(13)
w <- rnorm(13)
x <- rnorm(13)
y <- rnorm(13)
z <- rnorm(13)
Using GGPLOT facet, what I want to do is to create a 5*5 matrix,
where each cells plot the correlation between
each pair of the above data. E.g. v-v,v-w; v-x,...,z-z
What's the way to do it?
Attached is the image.
GV.
2007 Jul 16
2
Different axis limits for each facet in ggplot2
Hi!
Is it possible to have different axis limit for each facet in a ggplot2
plot? Here is an example:
--------------------------------------------------------------
library(ggplot2)
x=seq(-10,10,.1)
y=cos(x)
z=sin(x)*10
dat=melt(data.frame(x,y,z), id.var="x")
qplot( x, value, data=dat, facets=variable~., geom="line" )
2011 May 18
1
Changing order of facet grid in ggplot2
Hi I am running the following code:
sym <- c(sym1,sym2,sym4)
lifedxm <- c("O-BD","O-WELL","O-UNI")
life <- c(lifedxm,lifedxm,lifedxm)
tp <- c("TP-ANY","TP-ANY", "TP-ANY", "TP-SUB", "TP-SUB", "TP-SUB", "TP-CLIN"
, "TP-CLIN", "TP-CLIN")
data <-
2009 Aug 11
1
ggplot2: override facet names in facet_wrap?
just a quick question (to which I suspect the answer is "no"):
does anyone know if, in the ggplot2 package, there's a way to
override the default names of the facets in facet_wrap (which
correspond to the levels of the factor used to facet)? I know
that I go back and change the levels of the factor, but it would
be convenient to be able to supply a vector of level names at
the time
2008 Jun 17
1
ggplot facet spacing, wrapping
I'm running into some problems with the spacing of some faceted ggplot plots.
I have a number of time series faceted to be one above another, but the
scale labels of the y axes all clobber each other at the bottom/top of each.
for example, try:
qplot(x, y, data = data.frame(x = 1:10, y = 1:10, size = 1:10), facets =
size ~ ., size = size) + scale_x_continuous(breaks = 1:10) +