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

  • SEARCH
  • Home
  • 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 9207115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:19:10+00:00 2026-06-18T00:19:10+00:00

I have a dataframe of 407 observations of 14 variables. Using ggplot2 or other

  • 0

I have a dataframe of 407 observations of 14 variables. Using ggplot2 or other graphics I can easily create a scatterplot of one of the variables against another to allow me to observe patterns.

I would like to be able to highlight some of the points in the scatterplot that are of interest because of the pattern they make within the plot and then call the associated information from the dataframe. Is there a package that can do this?

There are no other variables within the dataframe that would allow me to distinguish the group of interesting points in the plot. This would make the problem much simpler.

I am aware that this may be a bigger question than I think it is and I am grateful for any pointers in the right direction!

Many thanks!
Nicki

  • 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-18T00:19:11+00:00Added an answer on June 18, 2026 at 12:19 am

    Here are two options: identify() in base R and the iplots package.

    First, you can use identify() to identify and label points on a plot() as you click on them:

    data(cars)
    plot(cars)
    interesting <- identify(cars)
    

    Now if we click on the plot, it will search for the nearest data point, return its index, and, by default (unless we add the plot = FALSE argument), label that point with its index.

    enter image description here

    We stop the identification process by clicking the secondary mouse button and selecting ‘Stop’ from the menu, or by selecting ‘Stop’ on the graphics window. Since we’ve stored the output in a variable named interesting, we can easily examine the points:

    cars[interesting,]
    #    speed dist
    # 19    13   46
    # 23    14   80
    # 44    22   66
    

    The iplots package, which does really nice interactive linked plots, provides a fancier solution:

    library(iplots)
    data(iris)
    iplot(iris$Sepal.Length,iris$Petal.Length)
    ihist(iris$Sepal.Width)
    

    Using iplots, you can highlight data on one plot and have them change colors on all plots. Here I have selected the red points in the lower plot, changing their color on both plots.

    enter image description here

    After highlighting a subset of data, we can determine the currently selected points with iset.selected(), as in:

    iris[iset.selected(),]
    #     Sepal.Length Sepal.Width Petal.Length Petal.Width    Species
    # 85           5.4         3.0          4.5         1.5 versicolor
    # 91           5.5         2.6          4.4         1.2 versicolor
    # 54           5.5         2.3          4.0         1.3 versicolor
    # etc
    

    Since you have 14 variables, mutiple iplot() scatterplots might be more effective than using identify().

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

Sidebar

Related Questions

I have a dataframe with numeric entries like this one test <- data.frame(x =
I have a dataframe where one of the columns contains a set of names.
I have a dataframe (df) of goals scored against various teams by date gamedate
I have a input dataframe like this (the real one is very large, so
I have a dataframe in R with three variables named for example df$V1 ,
I have a dataframe with columns A , B . I need to create
I have a dataframe where a few indexes are string values. How can I
I have a dataframe with a few columns, one of those columns is ranks,
I have a DataFrame with daily OHLCV data. I can calculate the range with:
I have a dataframe running into about 500,000 rows. One of these columns contains

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.