Learn R Programming

MediaNews (version 0.2.1)

TOI_News_Articles: Extract Media News

Description

Creates a DataFrame or Write files to disk by extracting text data from source based on user's keywords.

Usage

TOI_News_Articles(
  keywords,
  AsDataFrame = TRUE,
  start_date = NULL,
  end_date = NULL
)

Arguments

keywords

A String, user-defined.

AsDataFrame

Boolean Value, to determine whether the outcome should be a Dataframe or files written to disk. if set to FALSE then retuns the files will be written to disk at stated working directory (default TRUE).

start_date

Date (Character) Value, provide the starting date FROM where the data should be extracted. NOTE: only provide start_date when IsDate is set TRUE.

end_date

Date (Character) Value, provide the ending date TO where the data should be extracted. NOTE: only provide end_date when IsDate is set TRUE.

Value

Returns DataFrame or write files to the disk based on keywords

See Also

TOI_News_Dataset

Examples

Run this code
# NOT RUN {
#### Creates Dataset by filtering 31 days from current date
# }
# NOT RUN {
NewsDataset1 = TOI_News_Articles(keywords = "Politics In US",
start_date = Sys.Date()- 31,
end_date = Sys.Date())

# Creates Dataset by custom filtering through dates
NewsDataset2 = TOI_News_Articles(keywords = "BaseBall",
start_date = "2019-09-20",
end_date = "2019-10-20")

# Write files to disk
TOI_News_Articles(keywords = "AirLines", IsDataFrame = FALSE)
# }

Run the code above in your browser using DataLab