TOI_News_Articles: Extract Media News

Description Usage Arguments Value Author(s) See Also Examples

View source: R/TOI_News_Articles.R

Description

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

Usage

1
2
3
4
5
6
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

Author(s)

Vatsal Aima, vaima75@hotmail.com

See Also

TOI_News_Dataset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#### Creates Dataset by filtering 31 days from current date

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)

MediaNews documentation built on Nov. 26, 2020, 5:09 p.m.