Add option to remove regression line from scatter plot

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
r

Research direction

Start by reading the plot() entry point and the scatter-plot code it calls; check for existing tests covering type = "scatter". Done means reg_line = FALSE omits the regression line while the default behavior still includes it; add or update tests for both cases.

Written by the indexing model from the issue text.

Description

enhancement

Sometimes we don't want to communicate the regression line so we should be able to remove it from the plot with an argument.

E.g.:

library(CroPlotR)

workspace <- system.file(
    file.path("extdata", "stics_example_1"),
    package = "CroPlotR"
)

situations <- SticsRFiles::get_usms_list(
    file = file.path(workspace, "usms.xml")
)

sim <- SticsRFiles::get_sim(
    workspace = workspace,
    usms_file = file.path(workspace, "usms.xml")
)

obs <- SticsRFiles::get_obs(
    workspace = workspace,
    usm = situations,
    usms_file = file.path(workspace, "usms.xml")
)

plot(
    sim,
    obs = obs,
    type = "scatter",
    select_scat = "res",
    all_situations = FALSE
)

We should be able to do e.g.:

plot(
    sim,
    obs = obs,
    type = "scatter",
    select_scat = "res",
    all_situations = FALSE,
    reg_line = FALSE
)
Dominant language
R
Stars
1
Forks
3
Avg merge
9h 41m
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SticsRPacks/CroPlotR

All issues in SticsRPacks/CroPlotR

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.