Learn R Programming

ranlip (version 1.0.1)

ranlip.LoadPartition: Load the computed hat function

Description

Loads previously computed hat function from file name(string)

Usage

ranlip.LoadPartition(string)

Arguments

string

The file name to read saved partition from

Value

output

The output is 0 if the function was successful, or: 2 if the file cannot be opened, 3 if file is corrupted, 4 if memory cannot be allocated

Examples

Run this code
# NOT RUN {
	Fn <- function(x,dim){
		out <- sum(exp(-x))
  
		return(out)
	}
    out<-ranlip.LoadPartition("mypartition.txt")
	if(out>0) {
		print("Error loading hat function. ")
		err<-switch(out,"Unknown","Fice cannot be opened",
		 "File is corrupted","Memory not allocated")
		print(err)
	} else {

		r<-ranlip.RandomVec( Fn)
		print(r)
	}
   	ranlip.FreeMem();
# }

Run the code above in your browser using DataLab