I am wondering what you want to do:
ggplot(df,aes(x=lng,y=wgt,color=sex)) + geom_point(shape=1) + geom_smooth()
geom_smooth draw smooth line for each sex group, try see:
ggplot(df,aes(x=lng,y=wgt,color=sex))+ geom_smooth()
let me know if you are thinking something else….
--
--
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 ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
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+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
> names(test)
[1] "ObjektID" "tallstubbyta"
> is.factor(test$ObjektID); is.factor(test$tallstubbyta)
[1] TRUE
[1] FALSE
> is.numeric(test$ObjektID); is.numeric(test$tallstubbyta)
[1] FALSE
[1] TRUE
> mean(test$tallstubbyta)
[1] 0.01142584
> aggregate(test, list(test$ObjektID), length)[, c("Group.1", "tallstubbyta")]
Group.1 tallstubbyta
1 S.1 19
2 S.10 4
> aggregate(test, list(test$ObjektID), mean)[, c("Group.1", "tallstubbyta")]
Group.1 tallstubbyta
1 S.1 0.01383128
2 S.10 0.00000000
Warning messages:
1: argument is not numeric or logical: returning NA in:
mean.default(X[[1]], ...)
2: argument is not numeric or logical: returning NA in:
mean.default(X[[2]], ...)
> aggregate(test, list(test$ObjektID), sum)[, c("Group.1", "tallstubbyta")]
Error in Summary.factor(..., na.rm = na.rm) :
"sum" not meaningful for factors
> aggregate
function (x, ...)
UseMethod("aggregate")
> test
ObjektID tallstubbyta
1 S.1 0.0000000000
2 S.1 0.0000000000
3 S.1 0.0000000000
4 S.1 0.0000000000
5 S.1 0.0000000000
6 S.1 0.1320254313
8 S.1 0.0003141593
9 S.1 0.0000000000
10 S.1 0.0003141593
11 S.1 0.0003141593
12 S.1 0.0530929158
13 S.1 0.0000000000
14 S.1 0.0000000000
15 S.1 0.0003141593
16 S.1 0.0000000000
17 S.1 0.0226980069
18 S.1 0.0003141593
19 S.1 0.0003141593
20 S.1 0.0530929158
21 S.10 0.0000000000
22 S.10 0.0000000000
26 S.10 0.0000000000
27 S.10 0.0000000000