From 09dde24f686a6c1d83c4cb2d3ab349718640d022 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" Here we are creating a new object from an existing one: Using just this will only print the result and not actually change
If we want to modify If we forget to reassign this can cause subsequent steps to not work
as expected because we will not be working with the data that has been
modified.Why are my changes not taking effect? It’s making my results
-new_rivers <- sample(rivers, 5)
new_rivers
+## [1] 605 260 230 306 1038
## [1] 1243 2533 310 250 377
new_rivers
:
-new_rivers + 1
+## [1] 606 261 231 307 1039
## [1] 1244 2534 311 251 378
new_rivers
and save that modified
version, then we need to reassign new_rivers
like so:
-new_rivers <- new_rivers + 1
new_rivers
+## [1] 606 261 231 307 1039
## [1] 1244 2534 311 251 378
Error: object ‘X’ not found
operator:
rivers2 <- new_rivers + 1
rivers2
-## [1] 607 262 232 308 1040
+## [1] 1245 2535 312 252 379
Introduction to
-R for Public Health Researchers