Hello to everyone. I start to works with R studio 3 months ago. My teacher gave me same code but it didn't work. I tried it a lot of time but I can solve the problems with this code. Help me please.
rm(list=ls())
install.packages("superpc")
library(superpc)
library(dplyr)
set.seed(1111111) # 111111 (thr: change) gets crossing KM curve (worse result) < 1111111 (thr:0.5) makes no error, and the seed number affects the result a lot !!
# read my data
data_dir <- "D:/Documents/data"
filename <- "data.csv"
x_total <- read.csv(file.path(data_dir, filename), sep = ",", header = T)
dim(x_total)
x_total <- Filter(function(x) length(unique(x))>1, x_total)
x_total <- as.matrix(x_total)
dimnames(x_total) <- NULL # MUST remove column names for this package
x <- x_total[,4:ncol(x_total)]
# x <- scale(x) # MUST remove scale(x) not to make error !!!
x <- t(x) # MUST be pxn matrix, not nxp !!!
dim(x) # (7546, 50)