changed drop to as.vector in adapt.r