strip levels

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

strip levels

R help mailing list-2
To whom it may help,

I am new to R.

I have been tring to have a lattice plot in two strip levels: 4 stations in 2 years.  

I type in:

histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

The second level, i.e. Year, showed as "Raw.no10$Year" in the each of the lattice plot, instead of its respective year, such as "2002" and "2014".

I changed to the following programme language, therefore:

histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

in order to specify the variable names of the strip.

Instead of showing "Raw.no10$Year", each of the lattice plot states "2014"!  They should have 4 plots showing "2002" and another 4 showing "2014".

Could any one help indicating what has gone wrong?

I am really helpless and frustrated now.  T_T

Regards,
Christine

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Sarah Goslee
Hi,

On Mon, Apr 6, 2015 at 7:44 AM, Christine Lee via R-help
<[hidden email]> wrote:
> To whom it may help,
>
> I am new to R.
>
> I have been tring to have a lattice plot in two strip levels: 4 stations in 2 years.
>
> I type in:
>
> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

In both examples, you're mis-stating the data. Given the data
argument, you do not need to restate the data source.

histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,
layout=c(4,2),nin=30,xlab="Prosomal Width (mm)",
strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

If that doesn't solve your problem, then please use
dput(head(Raw.no10), 20) to provide some example data, or create fake
data of the same structure.

Without a reproducible example that includes some sample data (fake is
fine), the code you used, and some clear idea of what output you
expect, it's impossible to figure out how to help you. Here are some
suggestions for creating a good reproducible example:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example


> The second level, i.e. Year, showed as "Raw.no10$Year" in the each of the lattice plot, instead of its respective year, such as "2002" and "2014".
>
> I changed to the following programme language, therefore:
>
> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>
> in order to specify the variable names of the strip.
>
> Instead of showing "Raw.no10$Year", each of the lattice plot states "2014"!  They should have 4 plots showing "2002" and another 4 showing "2014".
>
> Could any one help indicating what has gone wrong?
>
> I am really helpless and frustrated now.  T_T
>
> Regards,
> Christine


--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Michael Dewey-3
See inline

On 06/04/2015 15:39, Sarah Goslee wrote:

> Hi,
>
> On Mon, Apr 6, 2015 at 7:44 AM, Christine Lee via R-help
> <[hidden email]> wrote:
>> To whom it may help,
>>
>> I am new to R.
>>
>> I have been tring to have a lattice plot in two strip levels: 4 stations in 2 years.
>>
>> I type in:
>>
>> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>
> In both examples, you're mis-stating the data. Given the data
> argument, you do not need to restate the data source.
>
> histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,

I think Sarah meant to type Station * Year and not as above

> layout=c(4,2),nin=30,xlab="Prosomal Width (mm)",
> strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>
> If that doesn't solve your problem, then please use
> dput(head(Raw.no10), 20) to provide some example data, or create fake
> data of the same structure.
>
> Without a reproducible example that includes some sample data (fake is
> fine), the code you used, and some clear idea of what output you
> expect, it's impossible to figure out how to help you. Here are some
> suggestions for creating a good reproducible example:
> http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>
>
>> The second level, i.e. Year, showed as "Raw.no10$Year" in the each of the lattice plot, instead of its respective year, such as "2002" and "2014".
>>
>> I changed to the following programme language, therefore:
>>
>> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>>
>> in order to specify the variable names of the strip.
>>
>> Instead of showing "Raw.no10$Year", each of the lattice plot states "2014"!  They should have 4 plots showing "2002" and another 4 showing "2014".
>>
>> Could any one help indicating what has gone wrong?
>>
>> I am really helpless and frustrated now.  T_T
>>
>> Regards,
>> Christine
>
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

R help mailing list-2
In reply to this post by R help mailing list-2
Thank you very much to Both Sarah and Michael,

Your responses are deeply appreciated.  TxT

I have omitted the reinstatement of the data source as follows:

library(lattice)
histogram(~Width|Station*Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

Instead of showing respective year of 2002 and 2014 in each of the lattice plot, it just shows "Year" in all lattice plot as attached.  TxT

Do you know what has gone wrong?

Many thanks.

Regards,
Christine




--------------------------------------------
2015年4月6日 星期一,Michael Dewey <[hidden email]> 寫道﹕

 主題: Re: [R] strip levels
 收件人: "Sarah Goslee" <[hidden email]>, "Chr
 副本(CC): "r-help" <[hidden email]>
 日期: 2015年4月6日,星期一,下午11:15

 See inline

 On 06/04/2015 15:39, Sarah
 Goslee wrote:
 > Hi,
 >
 > On Mon, Apr 6, 2015
 at 7:44 AM, Christine Lee via R-help
 >
 <[hidden email]>
 wrote:
 >> To whom it may help,
 >>
 >> I am new to
 R.
 >>
 >> I have
 been tring to have a lattice plot in two strip levels: 4
 stations in 2 years.
 >>
 >> I type in:
 >>
 >>
 histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
 data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
 Width (mm)",
 strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
 >
 > In both examples,
 you're mis-stating the data. Given the data
 > argument, you do not need to restate the
 data source.
 >
 >
 histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,

 I think Sarah meant to type
 Station * Year and not as above

 >
 layout=c(4,2),nin=30,xlab="Prosomal Width
 (mm)",
 >
 strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
 >
 > If that doesn't
 solve your problem, then please use
 >
 dput(head(Raw.no10), 20) to provide some example data, or
 create fake
 > data of the same
 structure.
 >
 > Without
 a reproducible example that includes some sample data (fake
 is
 > fine), the code you used, and some
 clear idea of what output you
 > expect,
 it's impossible to figure out how to help you. Here are
 some
 > suggestions for creating a good
 reproducible example:
 > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 >
 >
 >> The second level, i.e. Year, showed as
 "Raw.no10$Year" in the each of the lattice plot,
 instead of its respective year, such as "2002" and
 "2014".
 >>
 >> I changed to the following programme
 language, therefore:
 >>
 >>
 histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
 data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
 Width (mm)",
 strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
 >>
 >> in order to
 specify the variable names of the strip.
 >>
 >> Instead of
 showing "Raw.no10$Year", each of the lattice plot
 states "2014"!  They should have 4 plots showing
 "2002" and another 4 showing "2014".
 >>
 >> Could any one
 help indicating what has gone wrong?
 >>
 >> I am really
 helpless and frustrated now.  T_T
 >>
 >> Regards,
 >> Christine
 >
 >

 --
 Michael
 http://www.dewey.myzen.co.uk/home.html
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.

Histogram-no10-1.pdf (9K) Download Attachment
testing.txt (20K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Sarah Goslee
Please use dput() to provide your data, as already requested. Just
providing the text file doesn't tell us enough about the structure:
are some columns factors? etc.

Or, if you must provide an attachment (really not preferred, as many
attachments won't make it to the list, and many people do not want to
open unsolicited attachments), also include the code to import it
*exactly the way you did*.


Without a reproducible example that includes some sample data (fake is
fine), the code you used, and some clear idea of what output you
expect, it's impossible to figure out how to help you. Here are some
suggestions for creating a good reproducible example:
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example



Sarah

On Mon, Apr 6, 2015 at 12:40 PM, Christine Lee <[hidden email]> wrote:

> Thank you very much to Both Sarah and Michael,
>
> Your responses are deeply appreciated.  TxT
>
> I have omitted the reinstatement of the data source as follows:
>
> library(lattice)
> histogram(~Width|Station*Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>
> Instead of showing respective year of 2002 and 2014 in each of the lattice plot, it just shows "Year" in all lattice plot as attached.  TxT
>
> Do you know what has gone wrong?
>
> Many thanks.
>
> Regards,
> Christine
>
>
>
>
> --------------------------------------------
> 2015年4月6日 星期一,Michael Dewey <[hidden email]> 寫道﹕
>
>  主題: Re: [R] strip levels
>  收件人: "Sarah Goslee" <[hidden email]>, "Christine Lee" <[hidden email]>
>  副本(CC): "r-help" <[hidden email]>
>  日期: 2015年4月6日,星期一,下午11:15
>
>  See inline
>
>  On 06/04/2015 15:39, Sarah
>  Goslee wrote:
>  > Hi,
>  >
>  > On Mon, Apr 6, 2015
>  at 7:44 AM, Christine Lee via R-help
>  >
>  <[hidden email]>
>  wrote:
>  >> To whom it may help,
>  >>
>  >> I am new to
>  R.
>  >>
>  >> I have
>  been tring to have a lattice plot in two strip levels: 4
>  stations in 2 years.
>  >>
>  >> I type in:
>  >>
>  >>
>  histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
>  data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
>  Width (mm)",
>  strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>  >
>  > In both examples,
>  you're mis-stating the data. Given the data
>  > argument, you do not need to restate the
>  data source.
>  >
>  >
>  histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,
>
>  I think Sarah meant to type
>  Station * Year and not as above
>
>  >
>  layout=c(4,2),nin=30,xlab="Prosomal Width
>  (mm)",
>  >
>  strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>  >
>  > If that doesn't
>  solve your problem, then please use
>  >
>  dput(head(Raw.no10), 20) to provide some example data, or
>  create fake
>  > data of the same
>  structure.
>  >
>  > Without
>  a reproducible example that includes some sample data (fake
>  is
>  > fine), the code you used, and some
>  clear idea of what output you
>  > expect,
>  it's impossible to figure out how to help you. Here are
>  some
>  > suggestions for creating a good
>  reproducible example:
>  > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>  >
>  >
>  >> The second level, i.e. Year, showed as
>  "Raw.no10$Year" in the each of the lattice plot,
>  instead of its respective year, such as "2002" and
>  "2014".
>  >>
>  >> I changed to the following programme
>  language, therefore:
>  >>
>  >>
>  histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
>  data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
>  Width (mm)",
>  strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>  >>
>  >> in order to
>  specify the variable names of the strip.
>  >>
>  >> Instead of
>  showing "Raw.no10$Year", each of the lattice plot
>  states "2014"!  They should have 4 plots showing
>  "2002" and another 4 showing "2014".
>  >>
>  >> Could any one
>  help indicating what has gone wrong?
>  >>
>  >> I am really
>  helpless and frustrated now.  T_T
>  >>
>  >> Regards,
>  >> Christine
>  >
>  >
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Duncan Mackay-4
In reply to this post by R help mailing list-2
Hi

also have a look at useOuterStrips in the latticeExtra package if you want
station x time conditioning

useOuterStrips(strip      = strip.custom(par.strip.text = list(cex = 0.75)),
               strip.left = strip.custom(horizontal = FALSE,
                            par.strip.text = list(cex = 0.75)),
useOuterStrips(strip      = strip.custom(factor.levels = ... ,
                                         par.strip.text = list(cex = 0.75)),
               strip.left = strip.custom(factor.levels =  ...,
                                         horizontal = FALSE,
                                         par.strip.text = par.strip.text =
list(cex = 0.75)),
histogram(...)
) ## useOuterStrips

... = your code

Regards

Duncan Mackay

Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: [hidden email]

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Christine
Lee via R-help
Sent: Monday, 6 April 2015 21:44
To: [hidden email]
Subject: [R] strip levels

To whom it may help,

I am new to R.

I have been tring to have a lattice plot in two strip levels: 4 stations in
2 years.  

I type in:

histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10,
layout=c(4,2),nin=30,xlab="Prosomal Width (mm)",
strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.tabl
e=TRUE)

The second level, i.e. Year, showed as "Raw.no10$Year" in the each of the
lattice plot, instead of its respective year, such as "2002" and "2014".

I changed to the following programme language, therefore:

histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year, data=Raw.no10,
layout=c(4,2),nin=30,xlab="Prosomal Width (mm)",
strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",
tick=-1,col='grey',as.table=TRUE)

in order to specify the variable names of the strip.

Instead of showing "Raw.no10$Year", each of the lattice plot states "2014"!
They should have 4 plots showing "2002" and another 4 showing "2014".

Could any one help indicating what has gone wrong?

I am really helpless and frustrated now.  T_T

Regards,
Christine

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

R help mailing list-2
Thank you Duncan,

I am new to R.  Could you please tell me how to download the latticeExtra package to get stationx time conditioning?  I am terribly sorry that I have read 3-4 R books for dummies but I am still quite helpless with using R.  >_<

Regards,
Christine


--------------------------------------------
2015年4月7日 星期二,Duncan Mackay <[hidden email]> 寫道﹕

 主題: RE: [R] strip levels
 收件人: "R" <[hidden email]>, "'Christine Lee'"
 日期: 2015年4月7日,星期二,上午8:57

 Hi

 also have a look at useOuterStrips in the
 latticeExtra package if you want
 station x
 time conditioning

 useOuterStrips(strip      =
 strip.custom(par.strip.text = list(cex = 0.75)),
                strip.left =
 strip.custom(horizontal = FALSE,
        
                     par.strip.text = list(cex =
 0.75)),
 useOuterStrips(strip      =
 strip.custom(factor.levels = ... ,
      
                                
    par.strip.text = list(cex = 0.75)),
                strip.left =
 strip.custom(factor.levels =  ...,
      
                                
    horizontal = FALSE,
      
                                
    par.strip.text = par.strip.text =
 list(cex = 0.75)),
 histogram(...)
 ) ##
 useOuterStrips

 ... = your
 code

 Regards

 Duncan Mackay

 Department of Agronomy and
 Soil Science
 University of New England
 Armidale NSW 2351
 Email: home:
 [hidden email]

 -----Original Message-----
 From: R-help [mailto:[hidden email]]
 On Behalf Of Christine
 Lee via R-help
 Sent: Monday, 6 April 2015 21:44
 To: [hidden email]
 Subject: [R] strip levels

 To whom it may help,

 I am new to R.

 I have been tring to have a lattice plot in two
 strip levels: 4 stations in
 2 years. 

 I type in:

 histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
 data=Raw.no10,
 layout=c(4,2),nin=30,xlab="Prosomal Width
 (mm)",
 strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.tabl
 e=TRUE)

 The
 second level, i.e. Year, showed as "Raw.no10$Year"
 in the each of the
 lattice plot, instead of
 its respective year, such as "2002" and
 "2014".

 I changed
 to the following programme language, therefore:

 histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
 data=Raw.no10,
 layout=c(4,2),nin=30,xlab="Prosomal Width
 (mm)",
 strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",
 tick=-1,col='grey',as.table=TRUE)

 in order to specify the
 variable names of the strip.

 Instead of showing "Raw.no10$Year",
[[elided Yahoo spam]]
 They should have 4 plots showing
 "2002" and another 4 showing "2014".

 Could any one help indicating
 what has gone wrong?

 I am
 really helpless and frustrated now.  T_T

 Regards,
 Christine

 ______________________________________________
 [hidden email]
 mailing list -- To UNSUBSCRIBE and more, see
 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] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

David Winsemius

On Apr 6, 2015, at 9:38 PM, Christine Lee via R-help wrote:

> Thank you Duncan,
>
> I am new to R.  Could you please tell me how to download the latticeExtra package to get stationx time conditioning?  I am terribly sorry that I have read 3-4 R books for dummies but I am still quite helpless with using R.  >_<
>

These books didn't illustrate acquiring packages?

Read:

?install.packages

Also read the posting guide where it is suggested that you describe your setup: R version, operating system, etc.

--
David.

> Regards,
> Christine
>
>
> --------------------------------------------
> 2015年4月7日 星期二,Duncan Mackay <[hidden email]> 寫道﹕
>
> 主題: RE: [R] strip levels
> 收件人: "R" <[hidden email]>, "'Christine Lee'"
> 日期: 2015年4月7日,星期二,上午8:57
>
> Hi
>
> also have a look at useOuterStrips in the
> latticeExtra package if you want
> station x
> time conditioning
>
> useOuterStrips(strip      =
> strip.custom(par.strip.text = list(cex = 0.75)),
>                strip.left =
> strip.custom(horizontal = FALSE,
>        
>                     par.strip.text = list(cex =
> 0.75)),
> useOuterStrips(strip      =
> strip.custom(factor.levels = ... ,
>      
>                                
>    par.strip.text = list(cex = 0.75)),
>                strip.left =
> strip.custom(factor.levels =  ...,
>      
>                                
>    horizontal = FALSE,
>      
>                                
>    par.strip.text = par.strip.text =
> list(cex = 0.75)),
> histogram(...)
> ) ##
> useOuterStrips
>
> ... = your
> code
>
> Regards
>
> Duncan Mackay
>
> Department of Agronomy and
> Soil Science
> University of New England
> Armidale NSW 2351
> Email: home:
> [hidden email]
>
> -----Original Message-----
> From: R-help [mailto:[hidden email]]
> On Behalf Of Christine
> Lee via R-help
> Sent: Monday, 6 April 2015 21:44
> To: [hidden email]
> Subject: [R] strip levels
>
> To whom it may help,
>
> I am new to R.
>
> I have been tring to have a lattice plot in two
> strip levels: 4 stations in
> 2 years.  
>
> I type in:
>
> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> data=Raw.no10,
> layout=c(4,2),nin=30,xlab="Prosomal Width
> (mm)",
> strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.tabl
> e=TRUE)
>
> The
> second level, i.e. Year, showed as "Raw.no10$Year"
> in the each of the
> lattice plot, instead of
> its respective year, such as "2002" and
> "2014".
>
> I changed
> to the following programme language, therefore:
>
> histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> data=Raw.no10,
> layout=c(4,2),nin=30,xlab="Prosomal Width
> (mm)",
> strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",
> tick=-1,col='grey',as.table=TRUE)
>
> in order to specify the
> variable names of the strip.
>
> Instead of showing "Raw.no10$Year",
> [[elided Yahoo spam]]
> They should have 4 plots showing
> "2002" and another 4 showing "2014".
>
> Could any one help indicating
> what has gone wrong?
>
> I am
> really helpless and frustrated now.  T_T
>
> Regards,
> Christine
>
> ______________________________________________
> [hidden email]
> mailing list -- To UNSUBSCRIBE and more, see
> 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] mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Jim Lemon-4
Hi Chistine,
The latticeExtra package should be included with your installation of R.
Enter:

library(latticeExtra)

in your R session to make it available.

Jim


On Tue, Apr 7, 2015 at 4:28 PM, David Winsemius <[hidden email]>
wrote:

>
> On Apr 6, 2015, at 9:38 PM, Christine Lee via R-help wrote:
>
> > Thank you Duncan,
> >
> > I am new to R.  Could you please tell me how to download the
> latticeExtra package to get stationx time conditioning?  I am terribly
> sorry that I have read 3-4 R books for dummies but I am still quite
> helpless with using R.  >_<
> >
>
> These books didn't illustrate acquiring packages?
>
> Read:
>
> ?install.packages
>
> Also read the posting guide where it is suggested that you describe your
> setup: R version, operating system, etc.
>
> --
> David.
> > Regards,
> > Christine
> >
> >
> > --------------------------------------------
> > 2015年4月7日 星期二,Duncan Mackay <[hidden email]> 寫道﹕
> >
> > 主題: RE: [R] strip levels
> > 收件人: "R" <[hidden email]>, "'Christine Lee'"
> > 日期: 2015年4月7日,星期二,上午8:57
> >
> > Hi
> >
> > also have a look at useOuterStrips in the
> > latticeExtra package if you want
> > station x
> > time conditioning
> >
> > useOuterStrips(strip      =
> > strip.custom(par.strip.text = list(cex = 0.75)),
> >                strip.left =
> > strip.custom(horizontal = FALSE,
> >
> >                     par.strip.text = list(cex =
> > 0.75)),
> > useOuterStrips(strip      =
> > strip.custom(factor.levels = ... ,
> >
> >
> >    par.strip.text = list(cex = 0.75)),
> >                strip.left =
> > strip.custom(factor.levels =  ...,
> >
> >
> >    horizontal = FALSE,
> >
> >
> >    par.strip.text = par.strip.text =
> > list(cex = 0.75)),
> > histogram(...)
> > ) ##
> > useOuterStrips
> >
> > ... = your
> > code
> >
> > Regards
> >
> > Duncan Mackay
> >
> > Department of Agronomy and
> > Soil Science
> > University of New England
> > Armidale NSW 2351
> > Email: home:
> > [hidden email]
> >
> > -----Original Message-----
> > From: R-help [mailto:[hidden email]]
> > On Behalf Of Christine
> > Lee via R-help
> > Sent: Monday, 6 April 2015 21:44
> > To: [hidden email]
> > Subject: [R] strip levels
> >
> > To whom it may help,
> >
> > I am new to R.
> >
> > I have been tring to have a lattice plot in two
> > strip levels: 4 stations in
> > 2 years.
> >
> > I type in:
> >
> > histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> > data=Raw.no10,
> > layout=c(4,2),nin=30,xlab="Prosomal Width
> > (mm)",
> >
> strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.tabl
> > e=TRUE)
> >
> > The
> > second level, i.e. Year, showed as "Raw.no10$Year"
> > in the each of the
> > lattice plot, instead of
> > its respective year, such as "2002" and
> > "2014".
> >
> > I changed
> > to the following programme language, therefore:
> >
> > histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> > data=Raw.no10,
> > layout=c(4,2),nin=30,xlab="Prosomal Width
> > (mm)",
> > strip=strip.custom(bg='white',var.name
> =c("2002","2014")),ylab="Frequencies",
> > tick=-1,col='grey',as.table=TRUE)
> >
> > in order to specify the
> > variable names of the strip.
> >
> > Instead of showing "Raw.no10$Year",
> > [[elided Yahoo spam]]
> > They should have 4 plots showing
> > "2002" and another 4 showing "2014".
> >
> > Could any one help indicating
> > what has gone wrong?
> >
> > I am
> > really helpless and frustrated now.  T_T
> >
> > Regards,
> > Christine
> >
> > ______________________________________________
> > [hidden email]
> > mailing list -- To UNSUBSCRIBE and more, see
> > 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] mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

Michael Dewey-3
In reply to this post by R help mailing list-2
Dear Christine
Are you sure that your variable Year is not numeric? You example plot
looks to me as though it is treating it as a shingle.

What does str(Raw.no10) tell you about Year?

On 06/04/2015 17:40, Christine Lee wrote:

> Thank you very much to Both Sarah and Michael,
>
> Your responses are deeply appreciated.  TxT
>
> I have omitted the reinstatement of the data source as follows:
>
> library(lattice)
> histogram(~Width|Station*Year, data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>
> Instead of showing respective year of 2002 and 2014 in each of the lattice plot, it just shows "Year" in all lattice plot as attached.  TxT
>
> Do you know what has gone wrong?
>
> Many thanks.
>
> Regards,
> Christine
>
>
>
>
> --------------------------------------------
> 2015年4月6日 星期一,Michael Dewey <[hidden email]> 寫道﹕
>
>   主題: Re: [R] strip levels
>   收件人: "Sarah Goslee" <[hidden email]>, "Christine Lee" <[hidden email]>
>   副本(CC): "r-help" <[hidden email]>
>   日期: 2015年4月6日,星期一,下午11:15
>
>   See inline
>
>   On 06/04/2015 15:39, Sarah
>   Goslee wrote:
>   > Hi,
>   >
>   > On Mon, Apr 6, 2015
>   at 7:44 AM, Christine Lee via R-help
>   >
>   <[hidden email]>
>   wrote:
>   >> To whom it may help,
>   >>
>   >> I am new to
>   R.
>   >>
>   >> I have
>   been tring to have a lattice plot in two strip levels: 4
>   stations in 2 years.
>   >>
>   >> I type in:
>   >>
>   >>
>   histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
>   data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
>   Width (mm)",
>   strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>   >
>   > In both examples,
>   you're mis-stating the data. Given the data
>   > argument, you do not need to restate the
>   data source.
>   >
>   >
>   histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,
>
>   I think Sarah meant to type
>   Station * Year and not as above
>
>   >
>   layout=c(4,2),nin=30,xlab="Prosomal Width
>   (mm)",
>   >
>   strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>   >
>   > If that doesn't
>   solve your problem, then please use
>   >
>   dput(head(Raw.no10), 20) to provide some example data, or
>   create fake
>   > data of the same
>   structure.
>   >
>   > Without
>   a reproducible example that includes some sample data (fake
>   is
>   > fine), the code you used, and some
>   clear idea of what output you
>   > expect,
>   it's impossible to figure out how to help you. Here are
>   some
>   > suggestions for creating a good
>   reproducible example:
>   > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
>   >
>   >
>   >> The second level, i.e. Year, showed as
>   "Raw.no10$Year" in the each of the lattice plot,
>   instead of its respective year, such as "2002" and
>   "2014".
>   >>
>   >> I changed to the following programme
>   language, therefore:
>   >>
>   >>
>   histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
>   data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
>   Width (mm)",
>   strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)
>   >>
>   >> in order to
>   specify the variable names of the strip.
>   >>
>   >> Instead of
>   showing "Raw.no10$Year", each of the lattice plot
>   states "2014"!  They should have 4 plots showing
>   "2002" and another 4 showing "2014".
>   >>
>   >> Could any one
>   help indicating what has gone wrong?
>   >>
>   >> I am really
>   helpless and frustrated now.  T_T
>   >>
>   >> Regards,
>   >> Christine
>   >
>   >
>
>   --
>   Michael
>   http://www.dewey.myzen.co.uk/home.html
>

--
Michael
http://www.dewey.myzen.co.uk/home.html

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.
Reply | Threaded
Open this post in threaded view
|

Re: strip levels

PIKAL Petr
Hi

As Michael suggested your Year variable is probably numeric. Quick fix could be.

histogram(~Width|Station*as.factor(Year), data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal Width (mm)", strip=strip.custom(bg='white'),ylab="Frequencies",tick=-1,col='grey',as.table=TRUE)

Cheers
Petr


> -----Original Message-----
> From: R-help [mailto:[hidden email]] On Behalf Of Michael
> Dewey
> Sent: Tuesday, April 07, 2015 9:58 AM
> To: Christine Lee; Sarah Goslee
> Cc: r-help
> Subject: Re: [R] strip levels
>
> Dear Christine
> Are you sure that your variable Year is not numeric? You example plot
> looks to me as though it is treating it as a shingle.
>
> What does str(Raw.no10) tell you about Year?
>
> On 06/04/2015 17:40, Christine Lee wrote:
> > Thank you very much to Both Sarah and Michael,
> >
> > Your responses are deeply appreciated.  TxT
> >
> > I have omitted the reinstatement of the data source as follows:
> >
> > library(lattice)
> > histogram(~Width|Station*Year, data=Raw.no10,
> > layout=c(4,2),nin=30,xlab="Prosomal Width (mm)",
> > strip=strip.custom(bg='white'),ylab="Frequencies",tick=-
> 1,col='grey',a
> > s.table=TRUE)
> >
> > Instead of showing respective year of 2002 and 2014 in each of the
> > lattice plot, it just shows "Year" in all lattice plot as attached.
> > TxT
> >
> > Do you know what has gone wrong?
> >
> > Many thanks.
> >
> > Regards,
> > Christine
> >
> >
> >
> >
> > --------------------------------------------
> > 2015年4月6日 星期一,Michael Dewey <[hidden email]> 寫道﹕
> >
> >   主題: Re: [R] strip levels
> >   收件人: "Sarah Goslee" <[hidden email]>, "Christine Lee"
> <[hidden email]>
> >   副本(CC): "r-help" <[hidden email]>
> >   日期: 2015年4月6日,星期一,下午11:15
> >
> >   See inline
> >
> >   On 06/04/2015 15:39, Sarah
> >   Goslee wrote:
> >   > Hi,
> >   >
> >   > On Mon, Apr 6, 2015
> >   at 7:44 AM, Christine Lee via R-help
> >   >
> >   <[hidden email]>
> >   wrote:
> >   >> To whom it may help,
> >   >>
> >   >> I am new to
> >   R.
> >   >>
> >   >> I have
> >   been tring to have a lattice plot in two strip levels: 4
> >   stations in 2 years.
> >   >>
> >   >> I type in:
> >   >>
> >   >>
> >   histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> >   data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
> >   Width (mm)",
> >   strip=strip.custom(bg='white'),ylab="Frequencies",tick=-
> 1,col='grey',as.table=TRUE)
> >   >
> >   > In both examples,
> >   you're mis-stating the data. Given the data
> >   > argument, you do not need to restate the
> >   data source.
> >   >
> >   >
> >   histogram(~Width | Station*Raw.no10$Year, data=Raw.no10,
> >
> >   I think Sarah meant to type
> >   Station * Year and not as above
> >
> >   >
> >   layout=c(4,2),nin=30,xlab="Prosomal Width
> >   (mm)",
> >   >
> >   strip=strip.custom(bg='white'),ylab="Frequencies",tick=-
> 1,col='grey',as.table=TRUE)
> >   >
> >   > If that doesn't
> >   solve your problem, then please use
> >   >
> >   dput(head(Raw.no10), 20) to provide some example data, or
> >   create fake
> >   > data of the same
> >   structure.
> >   >
> >   > Without
> >   a reproducible example that includes some sample data (fake
> >   is
> >   > fine), the code you used, and some
> >   clear idea of what output you
> >   > expect,
> >   it's impossible to figure out how to help you. Here are
> >   some
> >   > suggestions for creating a good
> >   reproducible example:
> >   > http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-
> reproducible-example
> >   >
> >   >
> >   >> The second level, i.e. Year, showed as
> >   "Raw.no10$Year" in the each of the lattice plot,
> >   instead of its respective year, such as "2002" and
> >   "2014".
> >   >>
> >   >> I changed to the following programme
> >   language, therefore:
> >   >>
> >   >>
> >   histogram(~Raw.no10$Width|Raw.no10$Station*Raw.no10$Year,
> >   data=Raw.no10, layout=c(4,2),nin=30,xlab="Prosomal
> >   Width (mm)",
> >
> strip=strip.custom(bg='white',var.name=c("2002","2014")),ylab="Frequenc
> ies",tick=-1,col='grey',as.table=TRUE)
> >   >>
> >   >> in order to
> >   specify the variable names of the strip.
> >   >>
> >   >> Instead of
> >   showing "Raw.no10$Year", each of the lattice plot
> >   states "2014"!  They should have 4 plots showing
> >   "2002" and another 4 showing "2014".
> >   >>
> >   >> Could any one
> >   help indicating what has gone wrong?
> >   >>
> >   >> I am really
> >   helpless and frustrated now.  T_T
> >   >>
> >   >> Regards,
> >   >> Christine
> >   >
> >   >
> >
> >   --
> >   Michael
> >   http://www.dewey.myzen.co.uk/home.html
> >
>
> --
> Michael
> http://www.dewey.myzen.co.uk/home.html
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> 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.

________________________________
Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům.
Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému.
Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat.
Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu.

V případě, že je tento e-mail součástí obchodního jednání:
- vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu.
- a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou.
- trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech.
- odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá.

This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients.
If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system.
If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner.
The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email.

In case that this e-mail forms part of business dealings:
- the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning.
- if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation.
- the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects.
- the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient.
______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
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.