Hi. Yes that can be done. Which part are you stuck on? On Sat, 2012-02-18 at 11:38 -0500, D wrote: > Hi Matt, > Is there a way to do the following in data.table: > > (select ave(rating) from data x > where x.itemid=a.itemid and x.userid!=a.userid > and exists (select 1 from > (select * from data y where y.userid=x.userid) y, > (select * from data z where z.userid=a.userid) z > where y.itemid=z.itemid > and y.itemid!=a.itemid > and abs(y.rating-z.rating)>=4 ) > ) pred_rating_disimilar > from data1 a') > > This is based on movielens movie data of (userid, itemid, rating and > timestamp). > > its finding average rating on movie by all users who rated a movie > differently from the current user in the row. > > thanks > Dhruv > > _______________________________________________ > datatable-help mailing list > [email protected] > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
_______________________________________________ datatable-help mailing list [email protected] https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
