[R] Exporting the formula for a LOESS fit

2009-09-10 Thread jrflanders

I'm at my wit's end, and have searched all of my sources. I need to generate
a relatively large number of individual LOESS fits each month of data (I
have about 16 months of data). Fitting the polynomial is not my problem,
figuring out what the formula that describes that polynomial is. apologies
in advance if this is so simple, but I need a hand here. Thanks. 
-- 
View this message in context: 
http://www.nabble.com/Exporting-the-formula-for-a-LOESS-fit-tp25391878p25391878.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Why don't formulas that work for lm() work for plotmeans?

2009-09-18 Thread jrflanders

I know that simple line plots showing a point representing the mean + an
error bar are difficult in R, but I  am clearly missing something.  I simply
want to show how a the mean and 95% CI of a chemical concentration (y) vary
over space (x) under four temperature regimes (T; a categorical factor).
plotmeans, in the gplots library, should allow for such a figure, right?
After all, it invokes lm() in the help file for the formula, so any formula
that works in lm() (e.g., y~x | T) should work in plotmeans.  Obviously this
is not so - can anyone suggest an alternative  command or help me understand
how  the syntac differs? Thanks...
-- 
View this message in context: 
http://www.nabble.com/Why-don%27t-formulas-that-work-for-lm%28%29-work-for-plotmeans--tp25517081p25517081.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders

Dear R users,

I would like one of my groups in xyplot to appear to lie 'behind' the other
groups. I have searched for help and find many, many topics about panel
order (e.g., "as.table"), but that is not what I need.

What is odd is that the group that I want to appear 'behind' the others
(PROFILE) is the last in alphabetical order but xyplot is plotting it first.
Any ideas?

Code:
xyplot(Z_m~TEMP_C | LOCATION + EVENT, data = TC6,
groups = TYPE,
aspect = 2,
as.table = TRUE,
ylim = c(120,0),
between = list(y=2),
lty = 0,
strip = FALSE,
type = "o",
jitter.x = TRUE, jitter.y = TRUE,
pch = c(4,6,17,6,16), col.symbol =
c("grey","blue","black","red","black"), cex = 1.2,
ylab = "Depth (m)",
xlab = expression(Temperature~"("~degree*C~")"),
scales = list(
y=list(at=seq(0,120,20), limits = c(120,0), cex = 1.2),
x=list(at=seq(3,18,3), alternating = c(2,1), limits =
c(3,18), cex = 1.2)))

Example data:
EVENT, TRANSECT, LOC_CODE, TYPE, TEMP_C, Z_m
3 TC6 D MAX15.6 1.2
3 TC6 D MEAN 14.8 1.1
3 TC6 D MIN14.4 1.0
3 TC6 D POINT 11.3 55.8
3 TC6 D POINT 11.3 58.3
3 TC6 D POINT 11.3 58.3
3 TC6 D PROFILE 16.0 3.3
3 TC6 D PROFILE 16.0 3.2
3 TC6 D PROFILE 15.2 8.9
3 TC6 D PROFILE 12.6 14.8
3 TC6 D PROFILE 12.5 14.8
3 TC6 D PROFILE 11.6 21.2
3 TC6 D PROFILE 11.5 26.9
3 TC6 D PROFILE 11.4 33.3
3 TC6 D PROFILE 11.4 39.5
3 TC6 D PROFILE 11.3 45.4
3 TC6 D PROFILE 11.3 50.2
3 TC6 D PROFILE 11.3 54.1
3 TC6 D PROFILE 11.3 53.5 
-- 
View this message in context: 
http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2403483.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders

Dear R users,

I would like one of my groups in xyplot to appear to lie 'behind' the other
groups. I have searched for help and find many, many topics about panel
order (e.g., "as.table"), but that is not what I need. 

What is odd is that the group that I want to appear 'behind' the others
(PROFILE) is the last in alphabetical order but xyplot is plotting it first.
Any ideas? 

Code:
xyplot(Z_m~TEMP_C | LOCATION + EVENT, data = TC6, 
groups = TYPE,
aspect = 2, 
as.table = TRUE, 
ylim = c(120,0),
between = list(y=2),
lty = 0,
strip = FALSE,
type = "o", 
jitter.x = TRUE, jitter.y = TRUE,
pch = c(4,6,17,6,16), col.symbol = 
c("grey","blue","black","red","black"),
cex = 1.2,
ylab = "Depth (m)", 
xlab = expression(Temperature~"("~degree*C~")"),
scales = list(
y=list(at=seq(0,120,20), limits = c(120,0), cex = 1.2), 
x=list(at=seq(3,18,3), alternating = c(2,1), limits = c(3,18), 
cex =
1.2)))

Example data:
EVENT, TRANSECT, LOC_CODE, TYPE, TEMP_C, Z_m
3   TC6 D   MAX 15.61.2
3   TC6 D   MEAN14.81.1
3   TC6 D   MIN 14.41.0
3   TC6 D   POINT   11.355.8
3   TC6 D   POINT   11.358.3
3   TC6 D   POINT   11.358.3
3   TC6 D   PROFILE 16.03.3
3   TC6 D   PROFILE 16.03.2
3   TC6 D   PROFILE 15.28.9
3   TC6 D   PROFILE 12.614.8
3   TC6 D   PROFILE 12.514.8
3   TC6 D   PROFILE 11.621.2
3   TC6 D   PROFILE 11.526.9
3   TC6 D   PROFILE 11.433.3
3   TC6 D   PROFILE 11.439.5
3   TC6 D   PROFILE 11.345.4
3   TC6 D   PROFILE 11.350.2
3   TC6 D   PROFILE 11.354.1
3   TC6 D   PROFILE 11.353.5
-- 
View this message in context: 
http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403420p2403420.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xyplot (Lattice): Group order in display

2010-09-01 Thread jrflanders

Thank you! It is always so simple...

May I throw another question at you? In useOuterStrips, in the latticeExtra
package, I am having problems calling custom strip names, e.g.

useOuterStrips(xyplot(y-x | LOCATION + EVENT, data = TC6, groups = TYPE),
strip=strip.custom(factor.
levels = c("Left", "Middle", "Right 1","Right 2"), bg="snow3"),
strip.left=strip.custom(factor.levels = c("October 2009", "April 2010",
"June 2010"),bg="snow2")

Strip names should be location and strip.left should be event. For some
reason the factor.levels labels just aren't printing. It just says "EVENT."
strip works just fine.




On Wed, Sep 1, 2010 at 12:45 PM, Deepayan Sarkar [via R] <
ml-node+2413989-1836328520-57...@n4.nabble.com
> wrote:

> On Wed, Sep 1, 2010 at 9:00 AM, jrflanders <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=2413989&i=0>>
> wrote:
> >
> > Dear R users,
> >
> > I would like one of my groups in xyplot to appear to lie 'behind' the
> other
> > groups. I have searched for help and find many, many topics about panel
> > order (e.g., "as.table"), but that is not what I need.
> >
> > What is odd is that the group that I want to appear 'behind' the others
> > (PROFILE) is the last in alphabetical order but xyplot is plotting it
> first.
>
> Yes, the default order is alphabetical order (see ?factor). That group
> is the last group, so is plotted last, and so appears on top.
>
> > Any ideas?
>
> You simply need to make it the first group, using something like
>
> factor(TYPE, levels = ...)
>
> -Deepayan
>
>
> > Code:
> > xyplot(Z_m~TEMP_C | LOCATION + EVENT, data = TC6,
> >groups = TYPE,
> >aspect = 2,
> >as.table = TRUE,
> >ylim = c(120,0),
> >between = list(y=2),
> >lty = 0,
> >strip = FALSE,
> >type = "o",
> >jitter.x = TRUE, jitter.y = TRUE,
> >pch = c(4,6,17,6,16), col.symbol =
> > c("grey","blue","black","red","black"), cex = 1.2,
> >ylab = "Depth (m)",
> >xlab = expression(Temperature~"("~degree*C~")"),
> >scales = list(
> >y=list(at=seq(0,120,20), limits = c(120,0), cex = 1.2),
> >x=list(at=seq(3,18,3), alternating = c(2,1), limits =
> > c(3,18), cex = 1.2)))
> >
> > Example data:
> > EVENT, TRANSECT, LOC_CODE, TYPE, TEMP_C, Z_m
> > 3 TC6 D MAX15.6 1.2
> > 3 TC6 D MEAN 14.8 1.1
> > 3 TC6 D MIN14.4 1.0
> > 3 TC6 D POINT 11.3 55.8
> > 3 TC6 D POINT 11.3 58.3
> > 3 TC6 D POINT 11.3 58.3
> > 3 TC6 D PROFILE 16.0 3.3
> > 3 TC6 D PROFILE 16.0 3.2
> > 3 TC6 D PROFILE 15.2 8.9
> > 3 TC6 D PROFILE 12.6 14.8
> > 3 TC6 D PROFILE 12.5 14.8
> > 3 TC6 D PROFILE 11.6 21.2
> > 3 TC6 D PROFILE 11.5 26.9
> > 3 TC6 D PROFILE 11.4 33.3
> > 3 TC6 D PROFILE 11.4 39.5
> > 3 TC6 D PROFILE 11.3 45.4
> > 3 TC6 D PROFILE 11.3 50.2
> > 3 TC6 D PROFILE 11.3 54.1
> > 3 TC6 D PROFILE 11.3 53.5
> > --
> > View this message in context:
> http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2403483.html<http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2403483.html?by-user=t>
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > __
> > [hidden email] 
> > <http://user/SendEmail.jtp?type=node&node=2413989&i=1>mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> __
> [hidden email] <http://user/SendEmail.jtp?type=node&node=2413989&i=2>mailing 
> list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
> --
>  View message @
> http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2413989.html
> To unsubscribe from xyplot (Lattice): Group order in display, click 
> here<http://r.789695.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=2403483&code=anJmbGFuZGVyc0BnbWFpbC5jb218MjQwMzQ4M3w2NjU1NDI1NDI=>.
>
>
>

-- 
View this message in context: 
http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2415419.html
Sent from the R help mailing list archive at Nabble.com.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xyplot (Lattice): Group order in display

2010-09-07 Thread jrflanders

Yes, event was coded as an integer. As I said, always something simple. I'm  
learning.

By the way, I cited lattice in my recent paper in Applied Geochemistry.  
Thank you for your work.

On Sep 7, 2010 1:32am, "Deepayan Sarkar [via R]"  
 wrote:
> On Thu, Sep 2, 2010 at 1:28 AM, jrflanders [hidden email]> wrote:

> >

> > Thank you! It is always so simple...

> >

> > May I throw another question at you? In useOuterStrips, in the  
> latticeExtra

> > package, I am having problems calling custom strip names, eg

> >

> > useOuterStrips(xyplot(yx | LOCATION + EVENT, data = TC6, groups = TYPE),

> > strip=strip.custom(factor.

> > levels = c("Left", "Middle", "Right 1","Right 2"), bg="snow3"),

> > strip.left=strip.custom(factor.levels = c("October 2009", "April 2010",

> > "June 2010"),bg="snow2")

> >

> > Strip names should be location and strip.left should be event. For some

> > reason the factor.levels labels just aren't printing. It just  
> says "EVENT."

> > strip works just fine.


> Maybe you need


> xyplot(yx | LOCATION + factor(EVENT), ...


> ? Without the factor(), EVENT could be a shingle (it's hard to be sure

> without a reproducible example).


> -Deepayan


> __

> [hidden email] mailing list

> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide  
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.







> View message @  
> http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2529337.html


> To unsubscribe from xyplot (Lattice): Group order in display, click here.





-- 
View this message in context: 
http://r.789695.n4.nabble.com/xyplot-Lattice-Group-order-in-display-tp2403483p2529876.html
Sent from the R help mailing list archive at Nabble.com.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.