Kieran Short
2013-08-31 09:39:09 UTC
I'm reviving a very old thread here, but I'm encountering the same problem
as JJ.
I'm looking at kidney duct branching angles from tomography data, for
different ages through development (with multiple kidneys per age group).
I am trying to plot angles (50 degress to -80 degrees) by inverse branch
generation (2 to ~15) for 7 age groups.
Not all groups have all generations (they're from different 'ages').
I'd like to use the smooth geom. If I simply plot and pool all groups, it
works fine.
ggplot() +
coord_cartesian(xlim = c(1,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation),data=delta) +
theme_bw() +
xlab(label = 'Inverse Generation')
However if I plot by group:
ggplot() +
coord_cartesian(xlim = c(2,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation,colour =
as.factor(Group)),data=delta) +
theme_bw() +
xlab(label = 'Inverse Generation')
then I get
geom_smooth: method="auto" and size of largest group is >=1000, so using
gam with formula: y ~ s(x, bs = "cs"). Use 'method = x' to change the
smoothing method.
Error in smooth.construct.cr.smooth.spec(object, data, knots) :
x has insufficient unique values to support 10 knots: reduce k.
In addition: Warning message:
Removed 81 rows containing missing values (stat_smooth).
Error in if (nrow(layer_data) == 0) return() : argument is of length zero
If I use the loess smooth, then I get a memory error
ggplot() +
coord_cartesian(xlim = c(2,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation,colour =
as.factor(Group)),data=delta,method = loess) +
theme_bw() +
xlab(label = 'Inverse Generation')
Error in predLoess(object$y, object$x, newx, object$s, object$weights, :
Calloc could not allocate memory (1866820 of 8 bytes)
In addition: There were 39 warnings (use warnings() to see them)
Error in if (nrow(layer_data) == 0) return() : argument is of length zero
lm, rlm and gam methods all work.. but no smoothing methods work.
I have attached the data as an robj.
Any help would be most welcome.
best regards,
Kieran
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggplot2-/***@public.gmane.org
To unsubscribe: email ggplot2+unsubscribe-/***@public.gmane.org
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
as JJ.
I'm looking at kidney duct branching angles from tomography data, for
different ages through development (with multiple kidneys per age group).
I am trying to plot angles (50 degress to -80 degrees) by inverse branch
generation (2 to ~15) for 7 age groups.
Not all groups have all generations (they're from different 'ages').
I'd like to use the smooth geom. If I simply plot and pool all groups, it
works fine.
ggplot() +
coord_cartesian(xlim = c(1,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation),data=delta) +
theme_bw() +
xlab(label = 'Inverse Generation')
However if I plot by group:
ggplot() +
coord_cartesian(xlim = c(2,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation,colour =
as.factor(Group)),data=delta) +
theme_bw() +
xlab(label = 'Inverse Generation')
then I get
geom_smooth: method="auto" and size of largest group is >=1000, so using
gam with formula: y ~ s(x, bs = "cs"). Use 'method = x' to change the
smoothing method.
Error in smooth.construct.cr.smooth.spec(object, data, knots) :
x has insufficient unique values to support 10 knots: reduce k.
In addition: Warning message:
Removed 81 rows containing missing values (stat_smooth).
Error in if (nrow(layer_data) == 0) return() : argument is of length zero
If I use the loess smooth, then I get a memory error
ggplot() +
coord_cartesian(xlim = c(2,15),ylim = c(50,-80)) +
geom_smooth(aes(x = Inverse.Generation,y = DeltaBifurcation,colour =
as.factor(Group)),data=delta,method = loess) +
theme_bw() +
xlab(label = 'Inverse Generation')
Error in predLoess(object$y, object$x, newx, object$s, object$weights, :
Calloc could not allocate memory (1866820 of 8 bytes)
In addition: There were 39 warnings (use warnings() to see them)
Error in if (nrow(layer_data) == 0) return() : argument is of length zero
lm, rlm and gam methods all work.. but no smoothing methods work.
I have attached the data as an robj.
Any help would be most welcome.
best regards,
Kieran
Thanks so much for your help on my last post.
I'm running into a different problem on a different project. I am
trying to make a line graph comparing students' achievement over the
grade school years (time = Grade), separated into 4 groups (groups =
riskstatic). There are about 48,724 observations.
I get the following error message when I try the graph with
"
Error in predLoess(object$y, object$x, newx, object$s, object
Calloc could not allocate (598080872 of 4) memory
"
The graph works fine when I set method = glm or method = lm . I
suspect this is a not-enough-memory issue, but I wanted to be sure and
ask for any suggestions about how to make the estimation/graph less
memory intensive.
I'm not sure if reproducible syntax is helpful because I'm mostly
confused by the error message, but I'm happy to convert the below to
something reproducible if that would be helpful.
##### Math graphs
library(ggplot2)
attach(math.file)
riskstatic <- factor(RiskStatic45678, label = c("HHM","Free Meals",
"Reduced Price Meals", "General"))
memory.limit(size=2700)
math.graph <- ggplot(math.file, aes(y=Math, x=Grade,
color=riskstatic))
math.graph + stat_smooth(method=loess) + xlab("Grade") + ylab("Math
Achievement") + scale_colour_discrete ("Risk Group")
#below works fine
math.graph + stat_smooth(method=glm) + xlab("Grade") + ylab("Math
Achievement") + scale_colour_discrete ("Risk Group")
--I'm running into a different problem on a different project. I am
trying to make a line graph comparing students' achievement over the
grade school years (time = Grade), separated into 4 groups (groups =
riskstatic). There are about 48,724 observations.
I get the following error message when I try the graph with
"
Error in predLoess(object$y, object$x, newx, object$s, object
Calloc could not allocate (598080872 of 4) memory
"
The graph works fine when I set method = glm or method = lm . I
suspect this is a not-enough-memory issue, but I wanted to be sure and
ask for any suggestions about how to make the estimation/graph less
memory intensive.
I'm not sure if reproducible syntax is helpful because I'm mostly
confused by the error message, but I'm happy to convert the below to
something reproducible if that would be helpful.
##### Math graphs
library(ggplot2)
attach(math.file)
riskstatic <- factor(RiskStatic45678, label = c("HHM","Free Meals",
"Reduced Price Meals", "General"))
memory.limit(size=2700)
math.graph <- ggplot(math.file, aes(y=Math, x=Grade,
color=riskstatic))
math.graph + stat_smooth(method=loess) + xlab("Grade") + ylab("Math
Achievement") + scale_colour_discrete ("Risk Group")
#below works fine
math.graph + stat_smooth(method=glm) + xlab("Grade") + ylab("Math
Achievement") + scale_colour_discrete ("Risk Group")
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggplot2-/***@public.gmane.org
To unsubscribe: email ggplot2+unsubscribe-/***@public.gmane.org
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.