# NOT RUN {
#this IV curve is of step=1
#if IV curve is of step>1, please use IVsteps to first find the number of
#steps and change points, then apply this function for each steps
#load the data provided in the package
data(IV_step1)
IV1 <- data.frame(IV_step1)
result <- IVfeature(IV1$I,IV1$V,crt=0.2,num=75,crtvalb=0.3)
# }
# NOT RUN {
data("IV_timeseries")
df <- IV_timeseries
result <- data.frame()
for (i in 1:length(df$tmst)){
IV = df$ivdf[i]
IV <- as.character(IV)
IV = data.frame(IV = strsplit(IV,'#'))
names(IV) <- 'IV'
IV$IV <- as.character(IV$IV)
IV <- tidyr::separate(IV,"IV",into = c("V","I"),sep = '\\*')
IV <- IV[-1,]
IV$V = as.numeric(as.character(IV$V))
IV$I=as.numeric(as.character(IV$I))
IV=IV[order(IV$V,decreasing=FALSE),]
IV_frame <- data.frame(IV)
trial=try(IVfeature(IV_frame$I,IV_frame$V),silent=TRUE)
if ('try-error' %in% class(trial)){
temp <- data.frame(NA,NA,NA,NA,NA,NA,NA,NA)
names(temp) <- c('Isc','Rsh','Voc','Rs','Pmp','Imp','Vmp','FF')
}else{
temp <- data.frame(trial)
}
result <- rbind(result,temp)
}
result <- cbind(df,result)
# }
Run the code above in your browser using DataLab