Sample of 2 (made-up) example rows in df:
userid facultyid courseid schoolid
167 265 NA 1678
167 71111 301 NA
Here's a simple one-liner from plyr. I wrote it a bit more generally than you asked:
a <- data.frame(x=c(1,2,3,1,2,3,1,2,3),y=c(2,3,1,1,2,3,2,3,1),
z=c(NA,1,NA,2,NA,3,4,NA,5),zz=c(1,NA,2,NA,3,NA,4,NA,5))
ddply(a,~x+y,summarize,z=first(z[!is.na(z)]),zz=first(zz[!is.na(zz)]))
Specifically answering the original question, if your data frame is named a, :
ddply(a,~userid,summarize,facultyid=first(facultyid[!is.na(facultyid)]),
courseid=first(courseid[!is.na(courseid)],
schoolid=first(schoolid[!is.na(schoolid)])