similar to: subset by multiple letters condition

Displaying 20 results from an estimated 700 matches similar to: "subset by multiple letters condition"

2016 Apr 22
0
subset by multiple letters condition
You can use the grepl() function to give you logicals for each criterion, then combine them as needed. For example: # example version of Command Command <- paste0("_localize_", c("PD","t2","t1_seq", "abc", "xyz", "PD_t1")) hasPD <- grepl("PD", Command, fixed=TRUE) hast1 <- grepl("t1", Command,
2016 Apr 23
1
subset by multiple letters condition
Thanks Jean, Does anyone know how to set these [hast1] and [hast2] as the colors of a plot? On Friday, April 22, 2016 7:39 AM, "Adams, Jean" <jvadams at usgs.gov> wrote: You can use the grepl() function to give you logicals for each criterion, then combine them as needed. For example: # example version of Command Command <- paste0("_localize_",
2016 Apr 24
1
assign color to subsets
'grepl' returns a logical vector; you have to use this to get your subset. You can use: df_tq <- subset(df, grepl("t1", Command)) df_t2 <- subset(df, grepl("t2", Command)) # if you want to also get a subset that has both, use df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command)) Jim Holtman Data Munger Guru What is
2016 Apr 23
4
assign color to subsets
Hi I have the following df and I created two subsets but I don't know how to use these subsets as the colors of my plot. data.frame': 36919 obs. of 162 variables $TE :int 38,41,11,52,48,75,..... $TR :int 100,210,548,546,..... $Command :factor W/2229 levels
2016 Apr 24
0
assign color to subsets
now after this: df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command)) I use factor to apply the subset to df but then the Command level becomes 0 df_both$Command=factor(df_both$Command) str(df_both) $ Protocol : Factor w/ 0 levels: Do you know what is the reason? Thanks for replying On Sunday, April 24, 2016 12:18 PM, jim
2016 Apr 30
3
how to use AND in grepl
Hi all, I have one factor variable in my df and I want to extract the names from it which contain both "t2" and "pd": 'data.frame': 36919 obs. of 162 variables $TE :int 38,41,11,52,48,75,..... $TR :int 100,210,548,546,..... $Command :factor W/2229 levels
2016 Apr 24
0
assign color to subsets
my problem is that in Command I have 2229 levels and I want to do subsets based on the names I have in Command. for example if the name has t1 or t2 in it or if it has both of them.and then I need to plot in a way that colors are names with t1,names with t2 and names with both. But now even the grepl I use for the subsets does not work correct! :((( hast1=grepl("t1", df$Command,
2012 Mar 13
3
Driver Installation for HASP dongle in Kubuntu
Hello, I want to emulate the software CAD Architecture "IntelliPlus" Website: http://www.dp-cad.com/logiciel-architecture-3d/ This software is locked with a HASP dongle Or the download page http://www3.safenet-inc.com/support/hasp/enduser.aspx # latestDD I can not install the driver for it to be recognized. How can I do? The HASP dongle does it work with WINE? Thank you for your help
2012 Aug 06
3
test if elements of a character vector contain letters
Dear all I'm pretty sure that I'm approaching the problem in a wrong way. Suppose the following character vector: > (x[1:10] <- paste(x[1:10], sample(1:10, 10), sep='')) [1] "a10" "b7" "c2" "d3" "e6" "f1" "g5" "h8" "i9" "j4" > x [1] "a10" "b7"
2009 Nov 23
4
Check if string has all alphabets or numbers
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091123/470946bc/attachment-0001.pl>
2011 Jun 09
2
scatterplot3d - help assign colors based on multiple conditions
Hi I am relatively new to R and am trying to figure out to plot 3d scatter plot using defined colors based on x-axis and y-axis values. Right now in the code below, I assign colors based on certain values in the names of the x-axis. Now if I want to extend the condition to assign a color based on the names of both x-axis and y-axis values, what should I be doing? Any help or ideas would be
2023 May 30
3
why does [A-Z] include 'T' in an Estonian locale?
Inspired by this old Stack Overflow question https://stackoverflow.com/questions/19765610/when-does-locale-affect-rs-regular-expressions I was wondering why this is TRUE: Sys.setlocale("LC_ALL", "et_EE") grepl("[A-Z]", "T") TRE's documentation at <https://laurikari.net/tre/documentation/regex-syntax/> says that a range "is shorthand for
2012 Feb 14
3
Wildcard for indexing?
Hi, I'd like to know if it is possible to use wildcards * for indexing... E.g. I have a vector of strings. Now I'd like to select all elements which start with A_*? I'd also need to combine that with logical operators: "Select all elements of a vector that start with A (A*) OR that start with B (B*)" Probably that is quite easy. I looked into grep() which I think might
2010 Oct 08
2
Memory management in R
Dear All, I am experiencing some problems with a script of mine. It crashes with this message Error in grepl(fut_string, past_string) : invalid regular expression
2019 Aug 09
3
Underscores in package names
I do not follow you Gabriel. Package name must not use digit numbers. Tarbal will use them, taken from the DESCRIPTION file, version field. That's why I consider the weird case name you presented as irrelevant, and not to be considered. Le ven. 9 ao?t 2019 ? 20:41, Gabriel Becker <gabembecker at gmail.com> a ?crit : > > > On Fri, Aug 9, 2019 at 11:05 AM neonira Arinoem
2019 Aug 09
7
Underscores in package names
Won't it be better to have a convention that allows lowercase, dash, underscore and dot as only valid characters for new package names and keep the ancient format validation scheme for older package names? This could be implemented by a single function, taking a strictNaming_b_1 parameter which defaults to true. Easy to use, and compliance results will vary according to the parameter value,
2023 Jan 14
2
Removing variables from data frame with a wile card
Thanks to all. Very helpful. Steven from iPhone > On Jan 14, 2023, at 3:08 PM, Andrew Simmons <akwsimmo at gmail.com> wrote: > > ?You'll want to use grep() or grepl(). By default, grep() uses extended > regular expressions to find matches, but you can also use perl regular > expressions and globbing (after converting to a regular expression). > For example: >
2013 Feb 05
2
R Regular Expressions - Metacharacters
I thought that I can use metacharacters such as \w to match word characters with one backslash. But for some reason, I need to include two backslashes. > grepl(pattern='\w', x="what") Error: '\w' is an unrecognized escape in character string starting "\w" > grepl(pattern='\\w', x="what") [1] TRUE I can't find the reason for this
2011 May 02
3
subseting data
Hi, Is it possible (i am sure it is) to subset data from a data.frame on the basis of SQL >LIKE< operator. I.e., i would like to subset a data where only values which contains a string >GP< would be used? Example: Gp<-subset(DF, DF$USCS like >GP<) This like of course is not working, Thanks, m [[alternative HTML version deleted]]
2016 Apr 10
5
what is the faster way to search for a pattern in a few million entries data frame ?
Hi Duncan, > Didn't you post the same question yesterday? Perhaps nobody answered > because your question is unanswerable. sorry, I got a email that my message was waiting for approval and when I look at the forum I didn't see my message and this is why I sent it again and this time I did check that the format of my message was text only. Sorry for the noise. > You need to