R Mapreudce Year and Top n word count

Skip to first unread message

Rajendra Nigam

Jun 12, 2015, 1:35:35 PM6/12/15
to rha...@googlegroups.com

I have a data with 2 columns first is year and another one is summary which has text.
Year Summary
2010 The adjective or adverb in each of these samples can be dropped: official business, current trend, new innovation, advance planning, end result, first priority, basic
2010 Vague expressions. Don't use vague, wordy expressions to mask uncertainty, as when you can't be precise about a number. Instead, use one simpl
2010 In the printed form, that acreage is priceless as publishers have to murder more trees to get in more words. 
2010 So when getting their attention is so valuable, we should husband time and space as frugally as possible
2010 his may seem to be persnickety, but you would be surprised at how many useless and sometimes silly words take up valuable space
2010 given economy is the result of a set of processes that involves its culture, values, education, technological evolution, history, social organization, political structure and
2010 Shortages are common problems with a command-based economy, as there is no mechanism to 
2010 re driven by public and private investments that reduce carbon emissions and p
2011 based economy, as there is no mechanism to manage the information (pric
2011 st recorded sense of the word "economy" is in the phrase "the management of œconomic affairs", found in a work possibly
2011 The first economist in the true meaning of the word was the Scotsma
2011 The economy may be considered as having developed through the following Phases or Degrees of Precedence.
2011 nd threatened people, transport facilities, air/sea ports, post-natal care, hospitals
2011 formal economic activity is a dynamic process which includes many aspects of econ
2011 strial Revolution marked a major turning point in human history; almost every aspect of daily
2011 The ancient economy was mainly based on subsistence farming. The Shekel referred to an ancient un
2011 As long as someone has been making, supplying and distributing goods or services, there has been some sort of economy; economies 

using rm2 or plyrmr, I want to see output as follows (each year will have 5 entires/rows and top 5 words will be against it)
First Column: Year
Second Column: Words (Top 5 words by each year)
Thrid Column: Count of Words

Can some one please share the code??

Reply all
Reply to author
0 new messages