Displaying 20 results from an estimated 160 matches similar to: "gsub for numeric characters in string"
2008 Mar 12
0
R code for kernel density using kd-tree, looking for speed up
Dear R-help-list,
The following is R function I wrote for computing multi-dimensional kernel density. I am seeking R experts who can make the code to run faster, 50 times faster ideally.
Specifically, for function
kernel.estimate = function(points, bw),
the argument points is a d by n matrix as the n points in the d-dimensional space, bw is the bandwidth. The function will compute the kernel
2009 Feb 08
5
glmmBUGS: logistic regression on proportional data
Hello,
I am trying to run a logistic regression with random effects on
proportional data in glmmBUGS. I am a newcomer to this package, and
wondered if anyone could help me specify the model correctly.
I am trying to specify the response variable, /yseed/, as # of successes
out of total observations... but I suspect that given the error below,
that is not correct. Also, Newsect should be a
2010 Oct 05
1
binary tree construction in R
Hi all,
I'm very new to R and I'm trying to construct a threaded binary tree using
recursive functions.
I'm very confused was wondering if anyone had any R sample code they would
share. I've come across a lot of C++ code(nothing in R) and this is not
helping.
best,
MK
--
View this message in context:
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
2009 Sep 30
3
How to search and replace all urls on a HTML string using RUBY gsub
Hi ,
I trying to search and replace all urls on a HTML string
using gsub .
CODE
html = "<a href=''http://site.com.br''><img src=''http://site3.com/
image.jpg''></a><a href=''http://newx.com.br''><img src=''http://localhost/
imagem.jpg''></a>";
pattern = /<a
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
2009 Jan 21
1
Bug in sub and gsub (PR#13460)
Full_Name: Leon C. Banza
Version: 2.8.1
OS: Windows Vista
Submission from: (NULL) (195.69.243.253)
I believe there is a serious bug in the code for sub and gsub. I do as
following:
gsub("\\", "-", "some\\backslashed\\string")
This ought return "some-backslashed-string", but prints warnings instead:
Error in sub("\\", "",