Warning! You are viewing this exercise in a course that you are not a member of. You won't appear on your teacher's scoresheets until you register.
Sign in to test your solution.
make.circle.data = function(n) {
x1 <- runif(n, min = -1, max = 1)
x2 <- x1
y1 <- sqrt(1 - x1^2)
y2 <- (-1)*y1
x1 <- c(x1,x2)
x2 <- c(y1,y2)
return(data.frame(x1, x2))
}

set.seed(2077)
df1 <- make.circle.data(30)
df2 <- make.circle.data(30)
df1 <- df1 * .5 + rnorm(30, 0, 0.05)
df2 <- df2 + rnorm(30, 0, 0.05)
df <- rbind(df1, df2)
z <- rep(c(-1, 1), each=60)

dat <- data.frame(x=df, y = as.factor(z))
names(dat) <- c('x.1', 'x.2', 'y')
You can submit as many times as you like. Only your latest submission will be taken into account.
Sign in to test your solution.