track.getTopFans {RLastFM} | R Documentation |
API call to track.getTopFans
track.getTopFans(track = NA, artist = NA, mbid = NA, key = lastkey, parse = TRUE)
track |
track title |
artist |
artist name |
mbid |
optionally, artist MBID |
key |
API key, defaults to global variable lastkey |
parse |
Parse the returned XML into a list? |
If parse = TRUE,
username |
username |
weight |
match weight |
If parse = FALSE,
a object of type "XMLInternalDocument" and "XMLAbstractDocument"
API is sensitive to spelling.
Greg Hirson <ghirson@ucdavis.edu>
http://www.last.fm/api/show?service=312
genres = c("jazz", "rock", "rap") tracks = do.call("rbind", lapply(genres, function(x)do.call("cbind", tag.getTopTracks(x))[1,])) weight = apply(tracks, 1, function(x)track.getTopFans(x[1], x[2])$weight) ##Not Run - Plot weights by genre #matplot(w, type = "l", xlab = "rank", ylab = "match", col ="black", lty =1:3) #legend("topright", labels = genres, col = "black", lty =1:3)