Re: [R] Help in R code

2016-03-01 Thread Deepak Aggarwal
Hahaha this is not homework..i am just trying to explore r vs sas

Sent from my iPhone

> On 01-Mar-2016, at 9:36 PM, Bert Gunter <bgunter.4...@gmail.com> wrote:
> 
> ... but if this is homework (it looks like it) ask your teachers for
> help, as there is a no homework policy on this list.
> 
> Cheers,
> Bert
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
>> On Tue, Mar 1, 2016 at 4:30 AM, deepak aggarwal <talk4dee...@gmail.com> 
>> wrote:
>> Hi ,
>> 
>> Seeking your help in coding following requirement in R.
>> 
>> Vector 1 has sentences for ex. vector 1="he is a nice human being","he is
>> smart and fast in his work"
>> 
>> vector 2 has keywords found in each sentence seperated by comma
>> for  ex. vector2 for vector 1 =nice,being
>> vector 2 for vector 1 =smart,work
>> 
>> I want output to be vector 3 which will show 2 words before and after where
>> match is found
>> 
>> vector 1   vector2vector 3
>> he is a nice human being  nice,beingis a nice
>> human,human being
>> he is smart and fast in his work   smart,workhe is smart,in his work
>> 
>> in all i want vector 3 to how 2 words before and aftr to each word of
>> vector 2 from vector 1.
>> 
>> really appriciate your quick help on this.
>> 
>> Thanks & Regards
>> Deepak
>> 
>>[[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help in R code

2016-03-01 Thread deepak aggarwal
Hi ,

Seeking your help in coding following requirement in R.

Vector 1 has sentences for ex. vector 1="he is a nice human being","he is
smart and fast in his work"

vector 2 has keywords found in each sentence seperated by comma
for  ex. vector2 for vector 1 =nice,being
vector 2 for vector 1 =smart,work

I want output to be vector 3 which will show 2 words before and after where
match is found

vector 1   vector2vector 3
he is a nice human being  nice,beingis a nice
human,human being
he is smart and fast in his work   smart,workhe is smart,in his work

in all i want vector 3 to how 2 words before and aftr to each word of
vector 2 from vector 1.

really appriciate your quick help on this.

Thanks & Regards
Deepak

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.