Did you load scatterplot3d? Where is your dataframe ad?
Here is one chunk of code that worked for me.
library(scatterplot3d)
df <- data.frame(workload=c(1,2,-1,2,0),
dist2work=c(.2,0,.1,.2,-.4),
salary=c(1.2,.3,-1,-.1,-.4))
rownames(df) <- c(“Smith”,”Johnson”,”Williams”,”Jones”,”Davis”)
s3d <- scatterplot3d(df, angle=55, pch=16, color=”blue”, main=”3D Scatter Plot”)
text(s3d$xyz.convert(df), labels=rownames(df), cex=1.2, col=”black”)
model <- lm(salary ~ workload + dist2work, df)
s3d$plane3d(model)