search for: substrings

Displaying 20 results from an estimated 1509 matches for "substrings".

Did you mean: substring
2019 Feb 20
2
Bug: time complexity of substring is quadratic as string size and number of substrings increases
Hi all, (and especially hi to Tomas Kalibera who accepted my patch sent yesterday) I believe that I have found another bug, this time in the substring function. The use case that I am concerned with is when there is a single (character scalar) text/subject, and many substrings to extract. For example substring("AAAA", 1:4, 1:4) or more generally, N=1000 substring(paste(rep("A", N), collapse=""), 1:N, 1:N) The problem I observe is that the time complexity is quadratic in N, as shown on this figure https://github.com/tdhock/namedCapture-ar...
2019 Feb 22
1
Bug: time complexity of substring is quadratic as string size and number of substrings increases
...especially hi to Tomas Kalibera who accepted my patch sent >> yesterday) >> >> I believe that I have found another bug, this time in the substring >> function. The use case that I am concerned with is when there is a single >> (character scalar) text/subject, and many substrings to extract. For example >> >> substring("AAAA", 1:4, 1:4) >> >> or more generally, >> >> N=1000 >> substring(paste(rep("A", N), collapse=""), 1:N, 1:N) >> >> The problem I observe is that the time complexity is quad...
2020 Oct 05
2
isc-dhcp dynamic update problem
Hi, I have a buster system configured as a DC running 4.11.13 from Louis's repo. I am trying to get https://wiki.samba.org/index.php/Configure_DHCP_to_update_DNS_records_with_BIND9 working. Mostly it seems to work but there seems to be a problem with what dhcpd writes into the leases file in the "on release" stanza. When dhcpd writes the On Release stanza I get something like the
2019 Feb 20
0
Bug: time complexity of substring is quadratic as string size and number of substrings increases
...: > Hi all, (and especially hi to Tomas Kalibera who accepted my patch sent > yesterday) > > I believe that I have found another bug, this time in the substring > function. The use case that I am concerned with is when there is a single > (character scalar) text/subject, and many substrings to extract. For example > > substring("AAAA", 1:4, 1:4) > > or more generally, > > N=1000 > substring(paste(rep("A", N), collapse=""), 1:N, 1:N) > > The problem I observe is that the time complexity is quadratic in N, as > shown on this fi...
2010 Jun 04
2
Argument recycling in substring()
Hi, According to its man page substring() "expands (its) arguments cyclically to the length of the longest _provided_ none are of zero length". So, as expected, I get an error here: > substring("abcd", first=2L, last=integer(0)) Error in substring("abcd", first = 2L, last = integer(0)) : invalid substring argument(s) But I don't get one here:
2018 Jan 21
3
substr gives empty output
Dear all, I have a string, let's say "testing", and I would like to extract in sequence each letter (character) from it. But when I use substr() I only properly get the first character, the rest is empty (""). What am I getting wrong? For example, I have this code: >>> x <- "testing" k <- nchar(x) for (i in 1:k) { y <- substr(x, i, 1)
2009 Dec 19
3
integer(0) and NA do not equal FALSE
Hi, A noobie question: I'm simply trying to run a conditional statement that evaluates if a substring is found within a larger string. I find that if it IS found, my function returns TRUE (great!), but if not, the condition does not evaluate to FALSE. ex): if( grep("hi", "hop", fixed = TRUE) ) print('yes, your substring is in your string') else
2018 Jan 22
2
substr gives empty output
In y <- substr(x, i, 1) your third integer needs to be the location not the number of digits, so change it to y <- substr(x, i, i) and you should get what you want. Cheers, Tim > Date: Sun, 21 Jan 2018 10:50:31 -0500 > From: Ek Esawi <esawiek at gmail.com> > To: Luigi Marongiu <marongiu.luigi at gmail.com>, r-help at r-project.org > Subject: Re: [R] substr
2009 Dec 01
1
explanation for left-side behaviour
Hi there, I'm pretty sure that it's written down somewhere but I cannot find it so far. The little example shows different approaches to replace a substring. Only the last one works. I think it has something to do with the fact that "substr" is used on the left side. Can anybody refer to an explanation for this behaviour? Thanks a lot in advance! Antje values <-
2013 Jan 30
2
substring from behind
Hello together, i have a question for "substring". I know i can filter a number like this one: bill$No<-substring(bill$Customer,2,4) in this case i get the 2nd, 3rd and 4th number of my Customer ID. But how can i do this, if i want the 2nd, 3rd and 4th number of a column. Like this one. I have: Mercedes_02352 Audi_03555 and now i want to filter this data.frame to 235 355 can you
2007 Jan 25
1
Substring error
Hi, Do anybody know when and why the below error we get? Error in substr(x, as.integer(start), as.integer(stop)) : invalid substring argument(s) in substr() Thanks in advance, Shubha [[alternative HTML version deleted]]
2011 Apr 11
1
Getting many substrings but only loading the original string one time.
Hi All, I'm looking for a way to get many substrings from a longer string and then stitch them together. But, since the longer string is really, really long (like 250 MB long), I don't want to do this in a loop and load and re-load the longer string many times. Does anybody have an idea? Maybe I could pass in two vectors (the first would have...
2013 Dec 13
1
substring() and propagation of names
Hi, In R < 3.0.0, we used to get: > substring(c(A="abcdefghij", B="123456789"), 2, 6:2) A B A B A "bcdef" "2345" "bcd" "23" "b" But in R >= 3.0.0, we get: > substring(c(A="abcdefghij", B="123456789"), 2, 6:2) [1] "bcdef"
2007 May 10
3
Getting the last day of the month.
Hi, Given a date, how do I get the last date of that month? I have data in the form YYYYMM, that I've read as a date using > x$Date <- as.Date(ISOdate(substr(x$YearEnd,1,4),substr(x$YearEnd,5,6),1)) But this gives the first day of the month. To get the last day of the month, I tried > as.Date(as.yearmon(x$Date,frac=0)) But I don't get the last day of the month here. (Tried
1999 Aug 03
3
RW 0.64.2 substring() string truncation?
Hi, (First, apology for my earlier incorrectly addressed "subscribe" post.) Can somebody tell me what exactly is going on below. Basically, I am running into some kind of "string truncation" problem when I try to get a substring starting past the 8192nd character (see sample session below). There doesn't appear to be any problem creating the string, and nchar()
2006 Aug 14
4
Test for string in string
Hi, Is there an easy way to test if a substring exists in a string? I''m using this check: if mystring.index(substring) > 0 but it doesn''t seem to be working.... Thanks! -- Posted via http://www.ruby-forum.com/.
2010 Jul 19
1
Help with replacing a substring in a string
Dear R Users, I am trying to replace a substring in a string with something else. For example: if we have "abc.degg.hijk" I would like to replace all the "." with a SPACE to become "abc degg hijk" I have tried the replace.substring.wild function in the Hmisc package but get this error: > replace.substring.wild("abc.degg.hijk","*.*","
2009 Aug 25
1
Filling in empty arrays/lists from using "paste" function
Dear R users, I am trying to fill in arrays (5 different according to distinct "id") from objects produced from arbitrary data set below. a <-
2001 Sep 07
2
Why does substr<- truncate and not replace...
... when the replacement string is shorter than the portion of the string to be replaced? The documentation to substr (in R 1.3.1) gives me: If the portion to be replaced is longer than the replacement string, then only the portion the length of the string is replaced. And so I try: R> x <- "abcdef" R> substr(x,2,3) <- "xy" #ok R> x [1]
2001 Sep 07
2
Why does substr<- truncate and not replace...
... when the replacement string is shorter than the portion of the string to be replaced? The documentation to substr (in R 1.3.1) gives me: If the portion to be replaced is longer than the replacement string, then only the portion the length of the string is replaced. And so I try: R> x <- "abcdef" R> substr(x,2,3) <- "xy" #ok R> x [1]