Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Latest commit

 

History

History
33 lines (20 loc) · 1.14 KB

README.md

File metadata and controls

33 lines (20 loc) · 1.14 KB

The functions of the script

The script will do the PCA for the Linear-Accelerator data from the csv file we got from the Android App.

Then it will filter the result of the PCA and draw three plots about the Phone A's movement, Phone B's movement and the correlation between the two dataset.

Before you run the script

Make sure you have installed the R language in your system. If not, please download it from R-Project offical website

Then please install the R packages via the install.packages() command:

  • ggplot2
  • cowplot
  • signal
  • scales

How to use this script

Put the two csv file in the folder and rename them (or modified the script line 8 and 9)

Open the terminal (PowerShell, Tilix, iTerm2, whatever)

Change directory to the R_script folder

Run Rscript run.r

The plot will create in the folder named "output_plot.pdf", the importance of components of PCA will output in the terminal.

If you want to change the size of the plot, just modified the last line of the script.

Reference

Thanks for the rowr.r file from @cvarrichio