Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8731843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:19:51+00:00 2026-06-13T09:19:51+00:00

When I make xyplot with line connections before reordering factors, it gives me a

  • 0

When I make xyplot with line connections before reordering factors, it gives me a nice, sequential connections between data points:

library(lattice)
fin <- read.csv("http://dl.dropbox.com/u/2505196/unc_vall.csv", header=T)
xyplot(acceptability ~ character | motion, data=fin, col=1, 
       aspect="xy", layout=c(6,1), type="o", scales = list(x = list(rot = 90)))

enter image description here

Then I reorder factors, and everything gets screwed:

fin$character <- factor(fin$character, levels = c("battle","klank","manny",
                        "skelly","zombie","loman","himan"))

enter image description here

Reordering factors’ levels works fine, the values go where they should, but somehow the order of line connections stays the same. It doesn’t occur to me how I could change my reordering to make it work.

EDIT: I should add that solution should be universal enough to work for both xyplot and xYplot from the package Hmisc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:19:51+00:00Added an answer on June 13, 2026 at 9:19 am

    The lines get drawn in the order they appear in the data, I think. So if you want to get a correct ordering you could do:

    xyplot(acceptability ~ character | motion, data=fin[order(fin$character),], col=1, 
    aspect="xy", layout=c(6,1), type="o", scales = list(x = list(rot = 90)))
    

    Notice only the data argument changed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a doubleYScale plot: library(lattice) library(latticeExtra) # Some data foo <- list(x =
I make a bot program and i want to send some keyboard keys between
I wrote the following code to make time series plot by group. nsplot<- xyplot(conc
When using groups , Lattice gives each group a different color. Example: df <-
I've been experimenting with both ggplot2 and lattice to graph panels of data. I'm
To make sure a document is ready before doing stuff, i do the following
I make an application for querying from and inserting data to the database using
I have the following barchart to which I want to add error bars. library(lattice)
We make infrastructure services (data retrieval and storage) and small smart client applications (fancy
To make things easier when switching between machines (my workstation at the office and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.