Learn R Programming

spa (version 2.0)

spa.sim: Simulated data for SPA

Description

An easy function to access the "moon" data set used to illustrate this package.

Usage

spa.sim(n=206,m=3,p=8,type=c("moon","supervised"),nonoise=TRUE)

Arguments

n
the total number of x observations to generate
m
the number of labeled cases (m
p
the diminsion on the x data. First two columns are meaningful, others are noise.
type
the unlabeled border to generate
nonoise
whether or not the addiotional noisy columns should be returned
...
additional arguments passed into the function

References

M. Culp (2011). spa: A Semi-Supervised R Package for Semi-Parametric Graph-Based Estimation. Journal of Statistical Software, 40(10), 1-29. URL http://www.jstatsoft.org/v40/i10/.

Examples

Run this code
set.seed(100)
dat=spa.sim(type="moon") 

L=which(!is.na(dat$y))
U=which(is.na(dat$y))

##Fit data
gsemi<-spa(dat$y,graph=as.matrix(daisy(dat[,-1])))
gsemi

Run the code above in your browser using DataLab