Skip to content

Problem with Extracting Hash Tagged Words from Tweets

7 messages · Adedoyin-Olowe Mariam, Sarah Goslee, R. Michael Weylandt

#
Hi,

A small reproducible bit of your data would have been nice, and I have
no idea what "manually remove all regular expressions" might mean, but
take a look at this:

x <- list("marymaryw: Get an insight into how journalists operate at
The News by following #dayatthenews today #pompeyhacks #portsmouth
#southsea", "VouchAR_Ports: ?5 instead of ?60 for 1 month of unlimited
fitness classes at Outdoor Fitness Leeds - get bikini...
http://t.co/BUrkjtCh #Portsmouth", "BillieRaePhoto: RT @vintagesecret:
My dad has just sent me this picture. Looks like @GunwharfQuays is on
fire?! #portsmouth http://t.co/HbAV7Hw0")
[[1]]
[1] "#dayatthenews" "#pompeyhacks"  "#portsmouth"   "#southsea"

[[2]]
[1] "#Portsmouth"

[[3]]
[1] "#portsmouth"

Sarah

On Tue, May 22, 2012 at 7:00 AM, Adedoyin-Olowe Mariam
<mariamolowe2008 at yahoo.com> wrote:

  
    
#
Hi,

On Tue, May 22, 2012 at 10:55 AM, Adedoyin-Olowe Mariam
<mariamolowe2008 at yahoo.com> wrote:
Those aren't part of the tweets. Those are the numbers R uses when
displaying portions of a list.
What error? You'll need to give us an actual reproducible example,
since what you are describing is unclear.

Although I suppose it's possible that you simply want:
[1] "#dayatthenews" "#pompeyhacks"  "#portsmouth"   "#southsea"
[5] "#Portsmouth"   "#portsmouth"

It's impossible for me to tell precisely what the problem is.

Sarah

  
    
#
"The presence of these numbers in square brackets is reporting error."

You mean the square brackets that show up on the left hand side when
you do something like

x <- 1:100
print(x)

?

Don't worry -- those aren't part of x -- they're just added on
printing to make things easier for the user to see where he is in the
vector. They won't be included in any analysis. If you need control
over the printing to avoid them, take a look at cat()

Michel
On Tue, May 22, 2012 at 11:02 AM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
#
Nope -- those are still printing brackets. The double bracket tells
you which list element you're looking at and the single indicates that
you're looking at the first element of the vector (everything (almost)
in R is a vector)

Michael

On Tue, May 22, 2012 at 6:20 PM, Adedoyin-Olowe Mariam
<mariamolowe2008 at yahoo.com> wrote: