Displaying 20 results from an estimated 1000 matches similar to: "Trouble with 'smooth' using xyplot in lattice"
2011 Sep 30
2
ggplot2 - extracting values of smooth
Suppose that I'm working on Hadley's diamond dataset and I want to
review the relationship between price, colour and carat.
I might run the following:
library(ggplot2)
#plot scatter and add some hex binning
q<-qplot(carat,price,data=diamonds, geom=c("hex"),
main="Variability of Diamond Prices by Carat and Colour")
#facet to get one scatter for
2007 Apr 13
2
Difficulty with formatting scatter.smooth output
Hello,
I have been using scatter.smooth and been trying to format my plots
and been unable to adjust the line type or color of the smooth curve.
When I specify col in scatter.smooth, I can adjust the color of the
scatter plot points, but the line always stays black and solid. lty
has no effect.
When I specify par prior to calling scatter.smooth, col will change
the color of the points,
2011 Oct 21
1
lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth
In the HistData package, I have a data frame, PearsonLee, containing
observations on heights of parent and child, in weighted form:
library(HistData)
> str(PearsonLee)
'data.frame': 746 obs. of 6 variables:
$ child : num 59.5 59.5 59.5 60.5 60.5 61.5 61.5 61.5 61.5 61.5 ...
$ parent : num 62.5 63.5 64.5 62.5 66.5 59.5 60.5 62.5 63.5 64.5 ...
$ frequency: num 0.5 0.5
2011 Jul 28
3
smooth scatterplot and geo map
Hello everybody,
I'm trying to understand how to draw a smoothed scatterplot on a geographic
map with R.
Have a dataframe with point locations (long, lat) and was able to simply
plot these points on a shp map by using the maptools package. However,
instead of having simply the raw points on the map, I would like to have a
"smoothed" scatterplot of the same superimposed on the map.
2008 Oct 30
2
smooth function advice
Dear R Users,
I am looking for a smoothing function with the following characteristics
for a time series of data:
- at each date, should only use data up to that date (so, right aligned
and not centered)
- should return a smoothed series of length equal to the original time
series:
- for a one-day time series, just returns that day
- this means the front part of the series will
2010 May 11
1
kernel density to smooth plots
Hi r-sers,
I have a data of relative frequencies for the interval of 0-20, 20-40,...380-400. I would like the two data on the same graph using the same x-axis label. My question is how to get a smooth curve using kernel density code if it possible for this data.
> cbind(rel_obs,rel_gen)
rel_obs rel_gen
[1,] 0.000000000 0.0000
[2,] 0.092534175 0.0712
[3,] 0.105152471 0.1092
2006 Jan 11
1
4 smoothed lines on xyplot
I am using the R code listed below to create 4 smoothed lines on a
xyplot. I'm having trouble fine tuning it. First I think I may need a
black and white plot so how do I get it to plot the lines with different
characters, preferable the same characters used in the key (plus, X
circle and triangle). I might also be interest in a version that draws
four solid lines of different colors but
2009 Jan 23
1
lattice: reverse order of panel.lmline, panel.smooth
Hi,
is it possible to reverse the order in which panel.lmline() or panel.smooth()
operation in xyplot() ? This type of situation might occur when plotting some
variable with depth, but the relation we want to describe is variable ~
depth, and not depth ~ variable, as the plotting formula would suggest.
# an example:
d <- 1:100
v <- d * rnorm(100)
xyplot(d ~ v, ylim=c(100,0),
2002 Dec 06
3
smooth curves
I would like to draw smooth curves instead of polygons.
I could not find any spline function to do that : given an x and a y vectors, they all take the x in increasing order.
Is there a function to draw a smooth curve through a set of points in any order ?
with many thanks in advance
Alain Guerreau CNRS Paris
[[alternate HTML version deleted]]
2010 Aug 18
2
'panel.smooth' error
Hi,
The following call:
xyplot(incidence ~ year, melanoma, panel=panel.smooth)
produces a blank plot region with an error message:
Error using packet 1
plot.new has not been called yet
> sessionInfo()
R version 2.11.1 (2010-05-31)
x86_64-pc-linux-gnu
locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8 LC_MONETARY=C
2013 Jan 17
3
coxph with smooth survival
Hello users,
I would like to obtain a survival curve from a Cox model that is smooth and does not have zero differences due to no events for those particular days.
I have:
> sum((diff(surv))==0)
[1] 18
So you can see 18 days where the survival curve did not drop due to no events.
Is there a way to ask survfit to fit a nice spline for the survival??
Note: I tried survreg and it did not
2008 Sep 21
2
r format questions
Hi,
1) I have noticed that when I use the aggregate function it outputs numbers in the results. for example:
aggregate by product
group.1 Aggregate
1 ProductA 1000400.00
2 ProductB 23232323.00
3 Missing 232323.00
is there a way to suppress the numbers infront of aggregate outputs. I checked and they don't look like columns when I do a summary so I can't -1
2007 Nov 27
2
measure smoothness
I have 3 sets of Cartesian data, one is 'original' data and the other
2 are "smoothed"data. The smoothed data is the result of applying a
smoothing algorithm to the original.One set of smoothed data is the
'old' algorithm and the other set is the 'new' algorithm.
Does R have the capability of telling me which data is "smoother"?
Example data (subsets
2008 Sep 21
1
design question on piping multiple data sets from 1 file into R
Hi,
I have some queries that I use to get time series information for 8 seperate queries which deal with a different set of time series each.
I take my queries run them and save the output as csv file and them format the data into graphs in excel.
I wanted to know if there is an elegant and clean way to read in 1 csv file but to read the seperate matrices on different rows into seperate
2009 Jan 06
3
smoothed contour lines
Hi all,
I'm trying to draw a contour plot
with rounded (smoothed) contour lines instead of sharp angles;
when the grid consists of only a few points
in x- and y- axis, the resulting contour
is in facts rather ugly since very sharp angles may appear.
I did not find any way to do it,
by using either "contour" or "contourplot" (from the lattice package),
I wonder if there
2008 Mar 07
1
using xyplot with groups and panel.linejoin
Dear All,
I am using xyplot() with many groups like this:
statselect <- levels(dat$stat)
xyplot(relmse~T|lambda, groups=stat, data=dat,
panel = panel.superpose,
key=simpleKey(statselect, lines=T))
However, I want lines not scatterplots and if I set
panel.groups=panel.linejoin that connects the lines according to the
relmse and not according the consecutive values of T. Is there
2008 Aug 05
1
xyplot key issue - line colors
I have a problem regarding the colors assigned to the lines in the key
to an xy plot. I specify the plot like this:
xyplot(numbers~sqrt(breaks)|moltype+disttype, groups = type, data = alldata,
layout = c(3,2), type = "l" , lwd = 2, col = c("gray", "skyblue"),
key = simpleKey(levels(alldata$type), points = FALSE, lines = TRUE,
columns = 2, lwd = 2,
2008 Nov 26
1
Smoothed 3D plots
DeaR list,
I'm trying to represent some information via 3D plots. My data and session
info are at the end of this message. So far, I have tried scatterplot3d
(scatterplot3d),
persp3d (rgl), persp (graphics) and scatter3d (Rmcdr) but any of them gave
me what I'd like to have as final result (please see [1] for a similar 3D
plot changing
PF by ypred, pdn by h4 and pup by h11).
In general
2008 Apr 24
0
extracting averages from smooth.ppp output on spatstat
I have used smooth.ppp in spatstat to create a smoothed surface plot based
on randomly selected depths across a lake (as marks).
I wonder if based on the smoothed surface plot if I can calculate the
average depth for each 10x10 grid square across the lake.
I can't see any obvious way of doing this and would appreciate some
pointers.
Many thanks,
Graham
[[alternative HTML version
2008 Oct 01
1
Please help me to produce smoothed contour plots
Please help me to produce smoothed contour plots.
I have dependent data generated at regular intervals of two independent
variables and would like to produce smoothed contour plots - I cannot get
interp (alima) to produce cubic interpolations of the data, only linear
ones. I'm interested in smoothing as the data generation process is
stochastic and produces small variations which I'd