Displaying 20 results from an estimated 700 matches similar to: "gsub - replace multiple occurences with different strings"
2008 Aug 26
1
more dot plots on 1 page
Hi,
I would like to have six dot plots on one page. I make the plots in a
'for loop' because it is six times the same graph but for different
subjects (species).
I tried it with "par(mfrow=c(3,2), oma=c(3,3,2,0), mar=c(2,2,2,2))"; but
this does not work for dot plots apparently.
Then I tried with print(). But then I had to give the dot plots names.
This also does not work.
2013 Jan 10
2
transparency in segments()
Dear all,
i would like to plot each value from my datasets as segment with defined
transparency
However, I didnt find out how to set the transparency.
definition by "col=" in par() or segments() doesnt seem to work
any suggestions?
Thanks in advance.
Kind regards,
Robert Pazur
example code:
xx2 <-read.table("http://www.scandinavia.sk/data/R/0_05.csv", sep=";",
2005 Sep 09
1
Changing User-Agent: Asterisk PBX
Hello Folks!
in my sip-logs i see that asterisk uses the User-Agent ID "Asterisk
PBX":
SipClient: Received: 16:34:03.023
---------------------------------
BYE sip:102141@131.130.XXX.XXX:44343;transport=udp SIP/2.0
Max-Forwards: 10
Record-Route: <sip:213.2XX.XXX.XX8;ftag=as2eb3c466;lr=on>
Via: SIP/2.0/UDP 213.2XX.XXX.XX8;branch=z9hG4bK539a.47e6e8a7.0 #this is SER
Via:
2020 Feb 09
2
[RFC PATCH] Add SHA1 support
From: Sebastian Andrzej Siewior <sebastian at breakpoint.cc>
This is a huge all-in-one patch and deserves a little cleanup and
splitting. However, I wanted to get it out here for some feedback.
My primar motivation to use SHA1 for checksumming (by default) instead
of MD5 is not the additional security bits but performance. On a decent
x86 box the SHA1 performance is almost the same as
2004 Feb 19
2
read.socket - Strange strings. How to force sub to remove all occurences of a pattern?
I am opening a connection to an apache server sending a get and then I am reading from the socket.
All works finde except that I am getting some strange strings disrupting the html
e.g.
<FON\r\nffb\r\nT COLOR ...
\r\na48\r\n
\r\nffb\r\n
They are not frequent ( a few of them) but of course make live hard.
I cant observe them with lynx --source they dont occure.
I am trying a workaround
2009 Jul 16
2
Count the number of occurences in ranges
I got a vector of probabilities like,
probs<-c(0.001,0.5,0.02,1,.....)
Is there any nice and easy builtin function to get the number of
occurences within some specified probabality range.
Like with 2% it would be
occur[1] = sum(probs[probs>0&probs<0.02])
occur[2] = sum(probs[probs>0.02&probs<0.04])
...
occur[50] =sum(probs[probs>0.09] & probs<1)
(If it was a
2004 Jun 07
3
Aggregate rows to see the number of occurences
Hi,
I have a set of data like the following:
[,1] [,2]
[1,] 10 2
[2,] 7 0
[3,] 1 0
[4,] 1 0
[5,] 15 0
[6,] 17 4
[7,] 4 0
[8,] 19 8
[9,] 10 2
[10,] 19 5
I'd like to aggregate it in order to obtain the frequency (the number of
occurences) for each couple of values (e.g.: (10,2) appears twice, (7,0)
appears once). Something cool
2011 Dec 01
2
Counting the occurences of a charater within a string
I am new to R but am experienced SAS user and I was hoping to get some help on counting the occurrences of a character within a string at a row level.
My dataframe, x, is structured as below:
Col1
abc/def
ghi/jkl/mno
I found this code on the board but it counts all occurrences of "/" in the dataframe.
chr.pos <- which(unlist(strsplit(x,NULL))=='/')
chr.count <-
2012 Feb 11
3
Counting occurences of variables in a dataframe
Hi everybody,
I have a large dataframe similar to this one:
knames <-c('ab', 'aa', 'ac', 'ad', 'ab', 'ac', 'aa', 'ad','ae', 'af')
kdate <- as.Date( c('20111001', '20111102', '20101001', '20100315',
'20101201', '20110105', '20101001', '20110504',
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
--
2017 Dec 01
3
tryCatch in on.exit()
The following example involves a function whose on.exit()
expression both generates an error and catches the error.
The body of the function also generates an error.
When calling the function wrapped in a tryCatch, should
that tryCatch's error function be given the error from the
body of the function, since the one from the on.exit has
already been dealt with? Currently the outer tryCatch
2007 Feb 24
3
gsub: replacing a.*a if no occurence of b in .*
I am trying to read a number of XML files using xmlTreeParse(). Unfortunately,
some of them are malformed in a way that makes R crash. The problem is that
closing tags are sometimes repeated like this:
<tag>value1</tag><tag>value2</tag>some garbage</tag></tag><tag>value3</tag>
I want to preprocess the contents of the XML file using gsub() before
2006 Sep 07
7
counting occurences of words in the result set
Hello, I need to be able to count the occurences of certain terms in the
reults.
Currently my setup is Ferret 0.10.1 aaf bleeding edge.
results = VoObject.find_by_contents(query,:offset=>page, :limit=>
20,:sort => sort_fields)
I use results.total_hits for pagination. This all works really nicely.
However i need to be able to know how many occurences of certain
predefined terms occur
2010 May 13
3
select subset based on another variable
Hi, dear R-helpers,
I have a simple question regarding selecting subset of a variable based on
another variable.
Here is the example:
xx=rnorm(10)
id=sample(1:10, 10)
temp=c(6, 1, 8, 2)
Now, all I want is xx's that their id are 6, 1, 8, 2, instead of the
position.
Any suggestions ?
Thank you all your help !!
Carrie
[[alternative HTML version deleted]]
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
2005 Oct 10
2
Throroughly confused about SetCallerID
Folks,
I've been trying to handle the problem where
blocked callerids appear as coming from
asterisk <asterisk>
on the email notification, and the message
envelope simply doesn't say anything (does not
actually play the vm-unknown message).
So, following the tip provided by several
previous posters, I tried putting this in my
extensions.conf (the xx's are my DID,
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 =
2010 Aug 27
6
dovecot - mac firewall problem
Hi,
I am running dovecot 1.2.11 on mac osx 1.5.8. Everything works
perfectly with the application-level firewall off, but enabling the
application firewall prevents dovecot connections. I have tried
explicitly authorizing dovecot in the firewall, but it does not work.
I have searched everywhere I can think of to look, and haven't found a
solution, but have seen a couple other
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",