x <- c( 1, 1.5, 2, 3, 4.2, 5.0, 6.1, 5.3, 4.5, 0.9, 2.1, 4.3) # positive time
d <- c( 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1) # status censored/uncensored
#################
# dim =1
#################
f<-function(x) { x-3.7} # \sum f(ti) wi ~ 0
g=list( f=f) ; #define constraint as a list
kmc.solve( x,d,g) ; #using default
kmc.solve( x,d,g,using.C=TRUE) ; #using Rcpp
#################
# dim =2
#################
myfun5 <- function( x) {
x^2-16.5
}
g=list( f1=f,f2=myfun5) ; #define constraint as a list
kmc.solve( x,d,g) ->re0;
print(re0); #print method, plain ASCII
print(re0,5); #print method, digits=5,plain ASCII
print(re0,type='md'); #print method, output GIT Markdown
#summary(re0) is under developing.Run the code above in your browser using DataLab