代码如下:
- library("devtools")
- library("ggplot2")
- library("ggradar")
- fundma=read.csv("kplteam.csv")#读入数据
- fundma.sample=fundma[1:5,c(1,3,4,5,7,18)]#筛选作图用数据
- #自定义归一化函数(投影到[0,1])
- myNormalize <- function (target) {
- (target - min(target))/(max(target) - min(target))
- }
- #对数据做逐列归一化处理
- fundma.sample[,-1]=apply(fundma.sample[,-1],2,myNormalize)
- #作图
- ggradar(fundma.sample)
- set.seed(123)
- fundma.sample=fundma[,c(3,4,5,7,18)]#筛选数据
- model=kmeans(fundma.sample,centers=4,iter.max = 100)#聚类
- model$centers#展示类中心
这个会是什么原因造成的呢?
谢谢
- kplteam.csv