Displaying 20 results from an estimated 4000 matches similar to: "grep negation"
2007 Feb 16
2
if() for() { }
Dear R'helpers,
I guess the solution is trivial but despite some hours of testing and
looking at the doc, I was unable to fix the following problem.
I want to do either:
for (i in 1:lat) a[i,which(a[i,]==0] <- NA
or:
for (i in 1:lat) a[i,which(a[i,]==-9999|a[i,]==9999|a[i,]==9998|a[i,]
==-9998)] <- NA
if the word "Time" is or is not present in variable
1999 Oct 11
1
if(grep())
Would anyone care to comment if this is the best solution to this problem?
> trygrep <-function(x,y)
+ if(grep(x,y))
+ print("yes") else
+ print("NO")
>
>trygrep("foo","bafoobar")
[1] "yes"
>
> trygrep("foo","bar")
Error in if (grep(x, y)) print("yes") else print("NO") : missing value
2006 Nov 09
1
invert argument in grep
Hello,
What about an `invert` argument in grep, to return elements that are
*not* matching a regular expression :
R> grep("pink", colors(), invert = TRUE, value = TRUE)
would essentially return the same as :
R> colors() [ - grep("pink", colors()) ]
I'm attaching the files that I modified (against today's tarball) for
that purpose.
Cheers,
Romain
--
2018 Mar 25
2
Suggesting patch to link DOIs against secure resolver
Dear Madams and Sirs,
because the DOI foundation recommends a new, secure resolver [1], I
wanted to suggest the attached patch. It
a) updates a static DOI link in the docu,
b) the code chunks that generate new ones, and
c) a reg-ex that detects DOI links.
Hopefully, my first venture into SVN & patch files was done correctly.
My apologies, if there is anything amiss. In that case, I'll
2009 Jun 22
2
negation in grep
Does anybody know how to negate a string in a grep command, i.e.,
what I need is to return only strings that do NOT contain a second
string anywhere in the entire string.
for
txt <- c("boo","goo","doob","foo","boofoo")
I need a grep command that returns strings with "oo" except when "b"
is present anywhere. I know that
2005 May 25
3
Rounding fractional numbers to nearest fraction
Hi all,
I've got a matrix of fractional data that is all positive and greater than
zero that I would like to "loosely" classify, for lack of a better word. It
looks something like this :
1.07 1.11 1.27 1.59 0.97 0.76
2.23 0.98 0.71 0.88 1.19 1.02
What I'm looking for is a way to round these numbers to the nearest 0.25,
i.e. the above matrix would be
2004 Sep 24
3
Error with repeat lines() in function
I have a function that does some plotting. I then add lines to the
plot. If executed one line at a time, there is not a problem. If I
execute the function, though, I get:
Error in ans[[1]] : subscript out of bounds
This always occurs after the second lines command, and doesn't happen
with all of my data points (some do not have errors). Any ideas?
Thanks,
Sean
2004 Oct 07
3
Read.Table Reading a Text file
Dear R users and Helpers
I am beginner with using R and interested in carrying out certain task for my statistical research.
I am reading data for a text file, which could contain data in following pattern
x y
8 10
11 14
16 16
18 15
6 20
4 4
20 18
As per the example I have two columns and 7 rows of data in each.
However is real life data situation I may not know how many columns are present
2015 Oct 20
2
[compiler-rt] Undefined negation in float emulation functions
Hi,
I recently came across the following in __floatsidf in compiler-rt:
__floatsidf(int a) {
...
if (a < 0) {
...
a = -a;
In the case where a == INT_MIN, is this negation not undefined behaviour? AIUI this function is used for software
emulation on targets that have no hardware floating point support. Perhaps there is an in-built assumption
2003 Jun 19
1
Problem reading a PDF output
I generated a PDF output file of 10 plots. When I try to view it with
Adobe reader (R4 & R5), it will lockup the reader (it is consuming 100% of
the CPU) after presenting the 4th plot. I can generate the plots just fine
in Windows and as a postscript file reading it with GSview.
Is there anyway to tell what might be wrong with the PDF output? The file
is 890KB in size if anyone would like
2014 Aug 28
3
PXE booting WinPE with UEFI architecture
Anyone have luck with pxechn32 and bootmgfw.efi?
I'm getting the "Unable to retrieve first package" issue as reported by others.
Really, any advice for UEFI booting into a winpe environment off of pxelinux 6.03 would be beneficial.
Jason Jones
Sr. Associate, Network Services | End User Computing
3947 N Oak St Ext | Valdosta, GA 31605
O +15137844955
E jason.s.jones at
2002 Feb 22
1
Summary: read.table on Mac OS X, CARBON vs. DARWIN
Thanks a lot, James!!
The problem is fixed. On the version 1.4.0 Mac/darwin (the latest
available version for this system) the function read.table (which is
called from read.delim etc., too) has the bug you explained.
Inserting the row
nlines <- nlines+1
after
lines <- c(lines, line)
removes this bug.
M.
On Friday, February 22, 2002, at 02:33 PM, james.holtman at convergys.com
2005 Jan 21
6
Avoiding a Loop?
Dear R-Helpers,
I have a matrix where the first column is known. The second column is
the result of multiplying this first column with a constant "const". The
third column is the result of multiplying the second column with
"const".....
So far, I did it like this (as a simplified example):
nr.of.columns <- 4
myconstant <- 27.5
mymatrix <- matrix(numeric(0), nrow=5,
2007 May 17
7
[Bug 1315] New: Match Group does not support negation
http://bugzilla.mindrot.org/show_bug.cgi?id=1315
Summary: Match Group does not support negation
Product: Portable OpenSSH
Version: 4.6p1
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: sshd
AssignedTo: bitbucket at mindrot.org
ReportedBy: wknox at
2004 Jan 16
2
reference to objects
Hi,
is there a way to reference to a data object without copying it?
For example I have a huge matrix called dist and I want two objects
obj1 and obj2 to have a memeber dist that points to the matrix, but
I don't want, for memory reasons, to copy the matrix twice.
As far as I understand the following code will generate three copies
of my data:
dist <- some_code_that_generates_data
2004 Nov 05
1
text colour in legend
hello,
the following example gives a plot with a legend:
plot(-10:10,-10:10,type="n")
x=1:10
y=1:10
tt=c("A","B","C","D","E","F")
text(x,y,tt,cex=.8)
legend(-10,10,paste(tt," ",x,y),text.col=c(2:4)) # each row in different
colour
but how can I colour the legend text by "column" meaning tt in red, x in
2003 Sep 17
5
using matrix data for function
Hi All,
I have a function, f(x,y)
I have a matrix of data, m, with the 1st column is x and the 2nd column is y
What's the best way to get f(x,y) for each row of the matrix?
I tried
result<-f(m[,1],m[,2]) but it doesn't work.
Thanks!
Bing
---------------------------------
1060 Commerce Park
Oak Ridge National Laboratory
P.O. Box 2008, MS 6480
Oak Ridge, TN 37831-6480
Phone:
2002 Feb 04
2
maximal dataset size
Hi, there,
I am using PC window version R and dealing with big dataset usually. May
anyone let me whether the maximal dataset size in R is limited by computer
memory or hard drive capacity?
Thanks in advance.
Yiling Cheng, M.D., Ph.D.
Project Manager
The Cooper Institute for Aerobics Research
12330 Preston Road, Dallas, Texas 75230
phone: (972) 3413248; Fax: (972) 3413224
2015 Oct 25
2
[compiler-rt] Undefined negation in float emulation functions
On 26/10/15 02:54, Joerg Sonnenberger wrote:
> On Sun, Oct 25, 2015 at 06:46:48AM -0400, Steve Canon via llvm-dev wrote:
>> On Oct 24, 2015, at 6:02 PM, Chris Lattner <clattner at apple.com> wrote:
>>>
>>>
>>>> On Oct 23, 2015, at 7:43 PM, Matthew Fernandez via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>>>> On 21/10/15 00:15,
2001 Aug 03
1
large address spaces in R
I have been using SPLUS on UNIX to do performance analysis of our computers
and have some matrices that are about 15M rows with 8 columns. These are
'integers' and therefore take up about 500M of memory. I run on a system
with 2G of memory and will utilize over a 1G when processing this data.
I am considering using R and was wondering how large addresses spaces are
handled under