Grokbase Groups R r-help June 2016
FAQ
Dear all,


In order to create plots comparing two measurements I am using the "xyplot" and "make.groups" functions (see script example below).
Now I would like to assign a value to the variable names in the plot. Meaning: In the beginning of my script I assign a name(value) to a variable (for example: ID1 <- Name1). Now I would like to use this variable to name the plot variables.


Maybe easier to understand using an example:


Script:


pdf("REP_Chess.pdf")
scChess1=xyplot( x = ObjErrorX~Image, data=make.groups("ID1"=Chess1, "ID2"=Chess2),
              pch ,main="Chess - Object Error X [mm]", auto.key=T, groups=which, scales=list(relation="free",
                                                                               y=list(rot=0), x=list(rotE), abbreviate = TRUE),


print(scChess1, split=c(1,1,1,1), moreúlse)
dev.off()


I would like to assign a value to ID1, so that this value is shown on the plot labels after it is printed.
Something like : ID1 <- Name1 , and Name1 is shown in the plots.




Thank you very much in advance.


Cheers
Mark Fingerle






  [[alternative HTML version deleted]]

Search Discussions

  • Bert Gunter at Jun 13, 2016 at 4:16 pm
    Mark:


    I do not understand what you mean by plot labels, which generally mean
    the x and y axis labels that can be given with xlab and ylab
    parameters in the xyplot call. Clearly, however, this is not what you
    mean. If you mean the labels in the key for the groups, you should
    create the grouping factor with the level names you want and they will
    be used in the key IIRC (you may have to explicitly create the key and
    use its "text" component, as explained in the "key" portion of the
    xyplot Help page) . If you want to put text labels of some sort in the
    plot, then you should use a panel function that plots the data and
    adds a panel.text() call to put text in the plot where you want it.


    If none of these, maybe someone with better understanding than I can help.


    Cheers,
    Bert




    Bert Gunter


    "The trouble with having an open mind is that people keep coming along
    and sticking things into it."
    -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )




    On Mon, Jun 13, 2016 at 1:47 AM, Mark Fingerle
    wrote:
    Dear all,

    In order to create plots comparing two measurements I am using the "xyplot" and "make.groups" functions (see script example below).
    Now I would like to assign a value to the variable names in the plot. Meaning: In the beginning of my script I assign a name(value) to a variable (for example: ID1 <- Name1). Now I would like to use this variable to name the plot variables.

    Maybe easier to understand using an example:

    Script:

    pdf("REP_Chess.pdf")
    scChess1=xyplot( x = ObjErrorX~Image, data=make.groups("ID1"=Chess1, "ID2"=Chess2),
    pch ,main="Chess - Object Error X [mm]", auto.key=T, groups=which, scales=list(relation="free",
    y=list(rot=0), x=list(rotE), abbreviate = TRUE),

    print(scChess1, split=c(1,1,1,1), moreúlse)
    dev.off()

    I would like to assign a value to ID1, so that this value is shown on the plot labels after it is printed.
    Something like : ID1 <- Name1 , and Name1 is shown in the plots.


    Thank you very much in advance.

    Cheers
    Mark Fingerle



    [[alternative HTML version deleted]]

    ______________________________________________
    R-help at r-project.org 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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedJun 13, '16 at 8:47a
activeJun 13, '16 at 4:16p
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Mark Fingerle: 1 post Bert Gunter: 1 post

People

Translate

site design / logo © 2017 Grokbase