The objective of this manual is to guide user to manage and analyse data using R Studio.
This manual consist a compilation of codings/ commands that were used to perform common data management and statistical analysis.
There are three parts that will be discussed in this manual with some introduction for the first time user:
For first time user or new beginner of R, below are some introduction of R interface.
When open Rstudio, you can see this interface
To open the code editor,please follow the steps as in the picture below
Then it will look like this
Notes:
To start working with R, it is advisable to create a “project” where you can add all the folders or files needed.
(1) To create project, click on New Project> New Directory> New Project
(2) Create a folder name by inserting “XXX study” in the “Directory name” box. (3) Click browse to set the directory (4) Once finish, click “Create Project” box and you will be directed into the XXX Study project
For this exercise, please upload the following dataset:
Download data data_example1.xlsx here
Provided also is the dictionary for your reference
Download data_example1’s dictionary here
Please follow steps below to import data from excel to R
(1) Copy the “data_example1.xlsx” data and paste into the XXX Study project. (2) Click Import Dataset and choose From Excel from the dropdown list.
(3) An Import Excel Data dialog box will prompt out. Click Browse and select data_example1.xlsx from the file directory. (4) Create Data Name by typing “data” into the name box and Click Import once you have finished.
Your data will be displayed as below