Creating new columns

New columns or features can be easily created in Data1 and Data2 datasets.

R




# Creating feature in Data1 dataset
Data1$Num < - 0
 
# Creating feature in Data2 dataset
Data2$Code < - "Mission"
 
# Printing the data
head(Data1)
head(Data2)


Num is a new feature that is created with 0 default value in Data1 dataset. Code is a new feature that is created with the mission as a default string in Data2 dataset.

Working with Excel Files in R Programming

Excel files are of extension .xls, .xlsx and .csv(comma-separated values). To start working with excel files in R Programming Language, we need to first import excel files in RStudio or any other R supporting IDE(Integrated development environment).

Similar Reads

Reading Excel Files in R Programming Language

First, install readxl package in R to load excel files. Various methods including their subparts are demonstrated further....

Reading Files:

The two excel files Sample_data1.xlsx and Sample_data2.xlsx and read from the working directory....

Modifying Files

...

Deleting Content from files

The Sample_data1.xlsx file and Sample_file2.xlsx are modified....

Merging Files

...

Creating new columns

The variable or attribute is deleted from Data1 and Data2 datasets containing Sample_data1.xlsx and Sample_data2.xlsx files....

Writing Files

...