Displaying 20 results from an estimated 1000 matches similar to: "Placing text in a ggplot"
2010 Feb 28
1
ggplot 'annotate problem' again.
I had a problem annotating a graph last year ( see http://n4.nabble.com/Putting-names-on-a-ggplot-td907158.html#a907158 for the discussion)
Stefan (smu) provided a solution using annotate(). However I apparently did not update the graph file and,now, when I go back to the thread and try to use Stefan's solution it does not seem to work although I am sure that it did then.
The problem
2009 Oct 17
2
Putting names on a ggplot
Putting names on a ggplot
Can anyone suggest what I am doing wrong here. I am plotting
daily temperatures at Ottawa Ontario for 2008 broken down by
months, I seperate them by lines and want to put the names of the months
at the top of the chart ( with in the graphing area)
Everything is working as I want until I try to add the names of the months.
I did something similar a few days ago and I
2009 May 28
2
ggplot2 legend
Hi:
I need some help with the legend. I got 14 samples(Muestreo) and I
am trying to plot a smooth line for each sample. I am able to accomplish that but the problem is that the legend only displays every other sample. How can I force the legend to show all of my Muestreos? Thanks in advance.
fish_ByMuestreo <- structure(list(data = structure(list(SampleDate = structure(c(3L,
3L, 3L, 3L,
2017 Jul 22
1
3-day moving average for block maxima
Dear r-users,
I would like to construct 3-day moving average for block maxima series.
I tried this:
bmthree <- lapply(split(dt, dt$Year), function(x) max(sapply(1:(nrow(x)-2),
function(i) with(x, mean(Amount[i:(i+2)],na.rm=TRUE)))))
bmthree
and got the following output.
$`1971`
[1] 70.81667
$`1972`
[1] 68.94553
$`1973`
[1] 102.7236
$`1974`
[1] 73.6625
$`1975`
[1]
2017 Dec 06
0
Odd dates generated in Forecasts
> On Dec 6, 2017, at 5:07 AM, Paul Bernal <paulbernal07 at gmail.com> wrote:
>
> Dear friends,
>
> I have a weekly time series which starts on Jan 4th, 2003 and ends on
> december 31st, 2016.
>
> I set up my ts object as follows:
>
> MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52)
>
> MyModel <- auto.arima(MyTseries, d=1, D=1)
2012 Aug 06
5
sapply() and by()
Hello everyone,
I have a dataset with 5 colums (4 colums with thresholds of weather
stations and one with month - data of 5 years). Now I would like to
calculate the average for each month.
I tried this unsuccessfully:
lf.med <- sapply(LF[,1:4],mean,LF[,5])
Error in mean.default(X[[1L]], ...) :
'trim' must be numeric and have length 1
With
lf.med <- by(LF[,1:4],LF[,5],mean)
2017 Dec 06
1
Odd dates generated in Forecasts
Thank you very much David. As a matter of fact, I solved it by doing the
following:
MyTimeSeriesObj <- ts(MyData, freq=365.25/7,
start=decimal_date(mdy("01-04-2003")))
After doing that adjustment, my forecasts dates started from 2017 on.
Cheers,
Paul
2017-12-06 12:03 GMT-05:00 David Winsemius <dwinsemius at comcast.net>:
>
> > On Dec 6, 2017, at 5:07 AM, Paul
2017 Dec 06
2
Odd dates generated in Forecasts
Dear friends,
I have a weekly time series which starts on Jan 4th, 2003 and ends on
december 31st, 2016.
I set up my ts object as follows:
MyTseries <- ts(mydataset, start=2003, end=2016, frequency=52)
MyModel <- auto.arima(MyTseries, d=1, D=1)
MyModelForecast <- forecast (MyModel, h=12)
Since my last observation was on december 31st, 2016 I expected my forecast
date to start on
2008 Aug 26
1
processing subset lists and then plot(density())
d <- structure(list(Site = structure(c(8L, 12L, 7L, 6L, 11L, 5L, 10L,
4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L,
1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L,
12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L,
11L, 5L, 10L, 4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L,
4L, 3L, 2L, 1L, 9L, 8L, 12L, 7L, 6L, 11L, 5L, 10L, 4L, 3L, 2L,
1L, 9L,
2009 Nov 26
1
lattice --- different properties of lines corresponding to type=c("l", "a") respectively
I think the subject says it all. I want to make a simple lattice plot,
using xyplot with the
argument type=c("l","a").
The problem then is that in the resulting plot it is
difficult/impossible to see which plot corresponds to the average
and which to the individual profiles. I triedthings like extra
arguments lwd=c(1,3) or col=c("blue","red")
hoping
2010 Apr 11
1
Peculiar behaviour with MatchIt and a function
Folks,
I have a strange situation where:
library(MatchIt)
f <- function(d) {
m <- matchit(treatment ~ lsales + major.industry,
data=d, method="nearest", discard="hull.treat")
treatmentfirms <- match.data(m, group="treat")
list(m=m, treatmentfirms=treatmentfirms)
}
res <- f(ex)
does not work at the match.data() call,
2008 Jun 04
1
dotchart
I am trying to plot the following data using dotchart
intersect.data<-structure(list(X = structure(c(1L, 3L, 8L, 9L, 10L, 11L, 12L,
13L, 14L, 15L, 2L, 4L, 5L, 6L, 7L), .Label = c("1-100", "1001-1100",
"101-200", "1101-1200", "1201-1300", "1301-1400", "1401-1500",
"201-300", "301-400", "401-500",
2009 Sep 23
1
dotchart to barplots
Hi,
I am trying to plot the following data so that it can be visually represented well. I tried the dotchart but I felt it was too spread out. Then I tried the barplot which is good enough for me. Is there a way to give the labels for the y-axis as in the dot chart? Also, I feel the grey level is confusing, so is there options for designs within the bars? I cannot use color as the journal wants
2017 Nov 07
1
fill histogram in ggplot
Hi all,
I have the following data and I have a histogram for mms like
ggplot(hist,aes(x=hist$mms))+ geom_histogram(binwidth=1,fill="white",color="black")and then I want to fill the color of histogram by probable=1 and probable=0, could anyone help me in this?
My data:
structure(list(probable = c(1L, 0L, 1L, 1L, 0L, 1L, 0L, 1L, 1L,
0L, 1L, 0L, 1L, 0L, 1L, 0L, 1L, 1L,
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
str(Empdata)
Empdata$gnipc<-as.numeric(Empdata$gnipc)
install.packages("systemfit")
library("systemfit")
pdata <- plm.data(Empdata,
2008 Jul 06
2
lattice question
I'm creating a lattice barchart based off a pretty complicated data
structure. The barchart comes out quite nice ( thanks
to lattice ) but the problem is that the horizontal axis comes out all
scrunched because the barchart doesn't know that the intervals
of Var.1 are really "associated" with the conditioning variable Var.2.
Therefore, all the intervals of Var.1 are put on
2017 Aug 23
2
strange nlme augpred behaviour
Dear all
I encountered strange behaviour of augPred with virtually the same data
First I made groupedData object.
> mar.g<-groupedData(rutilizace~doba|int, data=mar)
When I perform nlme on complete dataset I get an error with augPred
> fit<-nlsList(rutilizace~SSasymp(doba, Asym, R0, lrc), data=mar.g)
Warning message:
c("1 error caught in nls(y ~ cbind(1 - exp(-exp(lrc) * x),
2017 Aug 23
0
strange nlme augpred behaviour
Better posted on r-sig-mixed-models , no?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Wed, Aug 23, 2017 at 5:17 AM, PIKAL Petr <petr.pikal at precheza.cz> wrote:
> Dear all
>
> I encountered strange
2012 Oct 30
2
bootstrapping quantile regression
HI everyone,
I try to get some bootstrap CIs for coefficients obtained by quantile
regression. I have influencial values and thus switched to quantreg..
The data is clustered and within clusters the variance of my DV = 0..
Is this sensible for the below data? And what about the warnings?
Thanks in advance for any guidance,
Kay
> dput(d)
structure(list(Porenfläche = c(4990L, 7002L, 7558L,
2017 Aug 23
2
strange nlme augpred behaviour
Hi
Well, yes I tried it about two weeks ago but my post did not get through as it still awaits moderator approval. I could check which column is offending but actually it is only minor nuisance, I can live with selection of columns before fitting a model. What seems to me strange is that both full dataset and only selected colums gave me identical fit results but only one works within augPred.