UserData: Last.FM last.year data

Description Usage Arguments Format Fields Methods

Description

This class can be used to import data for a specific http://www.last.fm user from a specific year by calling the user.getRecentTracks (https://www.last.fm/api/show/user.getRecentTracks) function. The whole data will be stored inside the data_table data.frame of the class.

Usage

1
2
3
data <- UserData$new(username, API_KEY, year, timezone)

album_analysis <- data$albumstats()

Arguments

username

character username character The http://www.last.fm user whos data shall be taken

API_KEY

character The http://www.last.fm API key of your app or any app

year

integer Year which shall be analyzed

timezone

numeric Compared time to GMT, for Warsaw or Berlin it's +1

Format

An R6Class generator object

Fields

username

character The http://www.last.fm user whos data shall be taken

apikey

character The http://www.last.fm API key of your app or any app

timezone

numeric Compared time to GMT, for Warsaw or Berlin it's +1

data_table

data.frame A data table containing the last years tracks of the user in the columns

  • artist: Artist Name

  • track: Track Name

  • album: Album Name

  • uts: Time as a Javascript time starting 1970-01-01

  • datetext: Time as Human readible text

Methods

create_api(page)

This method uses page to create the API json call needed for last.fm

get_data(year)

This method downloads the last.fm data of a specific year into the data_table field

clean_data_duplicates()

This method will delete scrobbles that are duplicated due to issues of the last.fm / Spotify API

album_stats(exclude_artist="Die drei ???",exclude_album="",min_tracks=5,sort_by=c("by_total_count","by_album_count"))

This method creates a table with album statistics for the specific year


zappingseb/analyze_last_fm documentation built on Dec. 10, 2019, 1:19 a.m.