Learn R Programming

ranlip (version 1.0.1)

ranlip.SavePartition: Saves the computed hat function into a file

Description

Function for saving previously computed hat function to file name(string)

Usage

ranlip.SavePartition(string)

Arguments

string

The file name to save the partition

Value

output

The output is 0 if the function was successful, or 1 if no hat function was computed, or 2 if the file cannot be opened.

Examples

Run this code
# NOT RUN {
    dim<-3
	left<-c(0,0,0)
	right<-c(5,5,5)

	ranlip.Init(dim, left, right);
	

	num <- 10
	numfine <- 2
	MinLip <- 1

	Fn <- function(x,dim){
		out <- exp(-sum(x*x))
  
		return(out)
	}
	
	ranlip.PrepareHatFunctionAuto(num, numfine, MinLip, Fn);
	
# we don't want to create this file unnecessarily	
	
# }
# NOT RUN {
 out<-ranlip.SavePartition("mypartition.txt")
# }
# NOT RUN {
	
# }
# NOT RUN {
if(out>0) {print("File cannot be opened.")}  
# }
# NOT RUN {
	
 	ranlip.FreeMem()
# }

Run the code above in your browser using DataLab