Displaying 20 results from an estimated 900 matches similar to: "Flummoxed by gsub()."
2017 Aug 23
0
Flummoxed by gsub().
Hi Rolf
I am not at all an expert in regex but
gsub("[[:alpha:]]","",x)
Works as you expected. Do not ask me why.
Cheers
Petr
> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Rolf Turner
> Sent: Wednesday, August 23, 2017 7:46 AM
> To: r-help mailing list <r-help at r-project.org>
> Subject: [R]
2017 Aug 23
0
Flummoxed by gsub().
> On 23 Aug 2017, at 07:45, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> 
> My reading of ?regex led me to believe that
> 
>    gsub("[:alpha:]","",x)
> 
> should give the result that I want. 
That's looking for any of the characters a, l, p, h, : .
What you meant to say was
	gsub("[[:alpha:]]","",x)
i.e. the character
2017 Aug 23
0
Flummoxed by gsub().
Inline.
-- 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 Wed, Aug 23, 2017 at 2:29 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
>
> On 23/08/17 18:33, Stefan Evert wrote:
>
>>
>>> On 23 Aug 2017,
2017 Aug 23
1
Flummoxed by gsub().
On 24/08/17 02:46, Bert Gunter wrote:
> Inline.
> 
> -- 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 Wed, Aug 23, 2017 at 2:29 AM, Rolf Turner <r.turner at
2017 Aug 24
0
Flummoxed by gsub().
> On Aug 23, 2017, at 2:29 AM, Rolf Turner <r.turner at auckland.ac.nz> wrote:
> 
> 
> On 23/08/17 18:33, Stefan Evert wrote:
> 
>>> On 23 Aug 2017, at 07:45, Rolf Turner <r.turner at auckland.ac.nz> wrote:
>>> 
>>> My reading of ?regex led me to believe that
>>> 
>>>    gsub("[:alpha:]","",x)
>>> 
2017 Aug 23
4
Flummoxed by gsub().
On 23/08/17 18:33, Stefan Evert wrote:
> 
>> On 23 Aug 2017, at 07:45, Rolf Turner <r.turner at auckland.ac.nz> wrote:
>>
>> My reading of ?regex led me to believe that
>>
>>     gsub("[:alpha:]","",x)
>>
>> should give the result that I want.
> 
> That's looking for any of the characters a, l, p, h, : .
OK.  I see
2009 Mar 22
0
gsub('(.).(.)(.)', '\\3\\2\\1', 'gsub')
there seems to be something wrong with r's regexing.  consider the
following example:
    gregexpr('a*|b', 'ab')
    # positions: 1 2
    # lengths: 1 1
    gsub('a*|b', '.', 'ab')
    # ..
where the pattern matches any number of 'a's or one b, and replaces the
match with a dot, globally.  the answer is correct (assuming a dfa
engine). 
2009 Mar 22
0
gsub('(.).(.)(.)', '\\3\\2\\1', 'gsub') (PR#13617)
Full_Name: Wacek Kusnierczyk
Version: 2.10.0 r48181
OS: Ubuntu 8.04 Linux 32bit
Submission from: (NULL) (129.241.199.135)
there seems to be something wrong with r's regexing.  consider the following
example:
    gregexpr('a*|b', 'ab')
    # positions: 1 2
    # lengths: 1 1
    gsub('a*|b', '.', 'ab')
    # ..
where the pattern matches any number of
2012 Sep 30
3
How to escape a forward slash with gsub, also does interpolation work with gsub?
I am trying this:
I want to replace all the text in between java comments:
/* start */
replace this text here
/* end */
I''m trying:
text.gsub(//* start */(.*)/* end *//im, replace_with)
But i''m getting errors relating to expecting keyword_end.
How should I be escaping /* and */   ?
Also, does string interpolation work in gsub regex?  Say I had variables
like:
start_tag =
2006 Jul 31
2
The error occured while evaluating nil.gsub!
#{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create''
---
class StartController < ApplicationController
def create
#------------Remove Tag---------------------------
@name = params[:name]
@file = params[:filepath]
@file = @file.gsub!(/^.*(\\|\/)/, '''')   # replace html tags with blank
post = Post.save(@params["removetag"])
end
end
-- 
2006 Mar 22
0
Private method gsub Error
Hi,
I keep getting this error when trying to use a condition in one of my habtm.
I''ve used conditions in habtm before in other projects and they work fine. Now I''m getting this:
private method `gsub'' called for ["user_id = ?", "1"]:Array
This is what I''m doing.
has_and_belongs_to_many :TenSpeed, :class_name => "Bike",
2006 Jan 10
0
auto_link generating error (nil.gsub) in functional test
Hi everyone,
When running tests, I get this error for running auto_link on a set of
column data:
test_list(PersonnelControllerTest):
ActionView::TemplateError: You have a nil object when you didn''t expect it!
The error occured while evaluating nil.gsub
    On line #28 of app/views/personnel/list.rhtml
    25:   <tr valign="top" class="<%= alternate_rows
2008 Oct 08
2
private method `gsub' called for 2:Fixnum
RoR Error: “private method `gsub'' called for 2:Fixnum”
I am new to RoR and trying to complete “RailsSpace Social Networking”
example, all works fine until I have implemented cookies using
authorization_token, and start getting following error when trying to
login.
“private method `gsub'' called for 2:Fixnum”
I can make out that there is something related to String conversion
2011 Jul 04
1
puppetlabs-firewall gsub error
Hi,
I am testing https://github.com/puppetlabs/puppetlabs-firewall and get 
this error:
err: Could not prefetch firewall provider ''iptables'': private method 
`gsub'' called for nil:NilClass
I don''t know ruby so any help appreciated!
-- 
Bjørge Solli
-- 
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
2009 Nov 03
2
R 2.10.0: Error in gsub/calloc
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this
is a Mac-specific problem.
I have a very large (158,908 possible sentences, ca. 58 MB) plain text
document d which I am
trying to tokenize:  t <- strapply(d, "\\w+", perl = T).  I am
encountering the following error:
Error in base::gsub(pattern, rs, x, ...) :
  Calloc could not allocate (-1398215180 of
2009 Nov 10
2
gsub does not support \b?
Hello, can someone help?  How come
 
>     gsub("\bINDS\b","INDUSTRIES","ADVANCED ENERGY INDS")
[1] "ADVANCED ENERGY INDS"
 
not ADVANCED ENERGY INDUSTRIES
 
Thanks.
Richard
	[[alternative HTML version deleted]]
2009 May 29
1
tests problem - NoMethodError: private method `gsub' called for 117681882:Fixnum
Hi,
i got very strange problem connected to tests in Rails. I got the same 
application code version as my team has, and on their computer all tests 
pass, and on my laptop (debian 5, ruby 1.8.6/1.8.7 (tried both), rails 
2.3.2) i got more then 50 errors - majority of them is variations of 
"NoMethodError: private method `gsub'' called for 117681882:Fixnum" error 
in controller.
2001 Aug 02
0
gsub() and parenthesis symbols -- solved
Hello again --
inevitably, I discovered the (documented) answer 30 seconds after
sending my question.
Using gsub(...,extended=FALSE) is the way to avoid this issue. 
Cheers,
Kieran
--
Kieran Healy, Assistant Professor,
Sociology Dept, University of Arizona.
kjhealy at u.arizona.edu :: (520) 621-3480
http://www.u.arizona.edu/~kjhealy
-------------- next part --------------
An embedded message
2011 Apr 29
1
regular expression in gsub() for strings with leading backslash
Hello,
Can anyone help on gsub() in R?  I have a string like something below, and
wanted to delete all the strings with leading backslash, including "\xa0On",
"\023, "\xab", and many others.   How should I write a regular expression
pattern in gsub()?  I don't care how many characters following backslash.
txt <- "Is This Thing\xa0On? http://bit.ly/jAbKem 
2008 Jan 10
0
gsub With unicode characters
Hi
I am writing a RoR application that needs to work with a database full
of french unicode characters, unfortunately whenever I try to display a
field with those values in a show I just get a question mark or no
character displayed.
So I decided to run a gsub (there''s only 2 fields with this problem) on
the field before displying it to replace the characters with their HTML