# Subset the data to include only the first scan
Rep1 <- subset(nickel, rep == 1)
# Get a rough idea of how the grain map looks by plotting the first
# element of the rotation matrix at each location
ggplot2::qplot(xpos, ypos, data = Rep1, colour = V1, size = I(2))
# Focus in on a particular location, for example location 698
Rs <- subset(nickel, location == 698)
# Translate the Rs data.frame into an object of class 'SO3'
Rs <- as.SO3(Rs[,5:13])
# Some observations are not rotations, remove them
Rs <- Rs[is.SO3(Rs),]
# Estimate the central orientation with the average
mean(Rs)
# Re-estimate central orientation robustly
median(Rs)
# \donttest{
# Visualize the location, there appears to be two groups
plot(Rs, col = c(1, 2, 3))
# }
Run the code above in your browser using DataLab