Sunday, December 22, 2013

2.4 Modifying data in R

Modifying data in R

The R console has a simple tool called Data Editor to review and modify an important data file.

The data editor

The data editor opens by clicking on Edit in the window of the R console: Edit-> Data Editor. The window appears that asks about which dataframe and matrix to open. Here you type in the name of the matrix and confirming this by clicking OK. Figure 18 shows that the variable/matrix Projects is typed in for review.

Figure 18: Selecting a variable in the Data Editor of R
Figure 18: Selecting a variable in the Data Editor of R
After choosing a variable/matrix to modify, the data appears in the form of a spreadsheet. Here you can modify different cells. If you click at the top of the spreadsheet, the window Variable Editor appears. Here you can choose between to data types: Numeric (values of the variable should be interpreted as numbers) and Character (values of the variable should be interpreted as categories). Figure 19 shows that the variable Customer satisfaction (TevredenheidKlant) is interpreted as character. You can change this by selecting numeric.

Figure 19: Variable editor of R, interpreting values of variables as numeric or character
Figure 19: Variable editor of R, interpreting values of variables as numeric or character

No comments:

Post a Comment