| remove_body | R Documentation |
Drops bodies by name from an 'orbit_system'. This is the counterpart to [add_body()] — use it to strip out bodies you no longer need before simulating, or to prune a system built with [load_solar_system()].
remove_body(system, id)
system |
An 'orbit_system' object. |
id |
A character vector of body names to remove. All names must exist in the system. |
“' load_solar_system() |> remove_body(c("Pluto", "Moon")) |> simulate_system(time_step = seconds_per_day, duration = seconds_per_year) “'
The updated 'orbit_system' with the specified bodies removed.
# Remove a single body
create_system() |>
add_sun() |>
add_planet("Earth", parent = "Sun") |>
add_planet("Mars", parent = "Sun") |>
remove_body("Mars")
# Remove multiple bodies from the full solar system
load_solar_system() |>
remove_body(c("Pluto", "Moon")) |>
simulate_system(time_step = seconds_per_day, duration = seconds_per_year) |>
plot_orbits()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.