A little announcement. A lot to explore.

Happy learning!

Explore lessons, including SAS & R programs and practice data.

Search lessons

Type at least 3 characters to see matching lessons.

Open SAS ↗Open R ↗
← SASnRCreate a copy of an existing dataset

Introduction

  • Sometimes we need a fresh copy of a dataset to experiment on — so that our changes do not touch the original.
  • In SAS, the idiomatic way is a DATA step with a SET statement. In R, we simply assign the existing object to a new name.
  • This lesson shows the same “copy CLASS to a new dataset called new_class” task in each environment.
  • After running, we should have two independent objects in memory: the original class and a copy called new_class with identical contents.

Create a copy of an existing dataset