Total members 11621 |It is currently Wed Mar 29, 2017 7:59 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka

All times are UTC [ DST ]



  Spearman correlation in R with pie charts
Tue Dec 16, 2014 6:28 am 

This example shows how to use Spearman correlation in R with pie charts.
Code:


setwd("D:/FirstPaper/Eclipse/")


require(foreign)
require(ggplot2)
require(MASS)
require(boot)

data <- read.csv("Femo_duplicates_X.csv",head=TRUE );
dat <- read.csv("Femo_duplicates.csv",head=TRUE );


require(randomForest)

require(ROSE)
if(!require(caret)){
  library(caret) 
}
if(!require(pROC)){
  library(pROC)
}
library (ROCR);

## get correlation to subset of the data.
cor(data[3:length(data)], method="spearman")

## get correlation to all data. It creates matrix of correlations.
cor(data, method="spearman")

## Draw pie charts
require(corrgram)
corrgram(data[3:length(data)], method="spearman", upper.panel=panel.pie)




_________________
Sami
PHD student - SAIL - School Of Computing
Queens' University
Canada


Author:
Site Admin
User avatar Posts: 34
Have thanks: 1 time
  Re: Spearman correlation in R with pie charts
Sat Nov 28, 2015 4:49 am 

Updated.

_________________
Sami
PHD student - SAIL - School Of Computing
Queens' University
Canada


Author:
Site Admin
User avatar Posts: 34
Have thanks: 1 time
Post new topic Reply to topic  [ 2 posts ] 


All times are UTC [ DST ]



Topic Tags

R Analysis






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team