4

I have a data frame having 1000 rows.I can use fix command or edit command in R to view and edit the data manually.I can't find any difference between the two. I want to know which is the efficient way of editing the data manually? Help me out in the same...

2 Answers 2

8

fix() invokes edit on x and then assigns the new version to the same object.

Example:

fix(my_dataFrame) #now my_dataFrame is changed

In edit() - we need to assign it to an object

my_new_dataFrame = edit(my_dataFrame)

You can read up on them - edit() and fix()

4

The difference is pretty trivial:

edit lets you edit an object and returns the new version.

fix lets you edit an object and modifies the original.

Internally, fix pretty much does the following:

  • Retrieve the name of the variable passed to fix (call it name)
  • Invoke result = edit(original)
  • Invoke assign(name, result, .GlobalEnv)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.