search for: glob2rx

Displaying 20 results from an estimated 38 matches for "glob2rx".

2006 Feb 20
2
glob2rx function not working
Dear R users, Inspired by previous list discussion of the glob2rxc function, I am attempting to create a new vector called TOTAL by summing all vectors whose names begin with ABC: TOTAL = sum(list = ls(pattern = glob2rx("ABC*"))) I'm running R 2.2.1 on Windows XP. Can anyone say what I'm missing? Thank you, Mark
2015 Oct 04
2
Conditional importFrom (roxygen?)
...rtFrom a function like this so it doesn't cause a build failure, but I don't get a note in my R CMD CHECK if I DON'T have it: gdal_setInstallation : correctPath: no visible global function definition for 'shortPathName' gdalinfo: no visible global function definition for 'glob2rx' gdallocationinfo: no visible global function definition for 'write.table' gdaltransform: no visible global function definition for 'write.table' get_subdatasets: no visible global function definition for 'glob2rx' mosaic_rasters: no visible global function definition...
2013 Mar 14
2
Grep with wildcards across multiple columns
...d searches in each of three columns: "1?E" in fund, "1??????" in func, and "???" in obj. I'm OK turning these into regular expressions: # Set parameters par.fund <- "10E"; par.func <- "100000"; par.obj <- "000" par.fund <- glob2rx(gsub("0", "?", par.fund)) par.func <- glob2rx(gsub("0", "?", par.func)) par.obj <- glob2rx(gsub("0", "?", par.obj)) The problem occurs when I try to apply multiple greps across columns. I'd prefer to use data.table since it'...
2015 Oct 04
0
Conditional importFrom (roxygen?)
...> it doesn't cause a build failure, but I don't get a note in my R CMD CHECK > if I DON'T have it: > > gdal_setInstallation : correctPath: no visible global function > definition for 'shortPathName' > gdalinfo: no visible global function definition for 'glob2rx' > gdallocationinfo: no visible global function definition for > 'write.table' > gdaltransform: no visible global function definition for 'write.table' > get_subdatasets: no visible global function definition for 'glob2rx' > mosaic_rasters: no visible gl...
2007 Oct 15
2
Wildcards
Care to explain how i can use a wildcard expression to "source" all files ending with .R in a subdirectory ? I've tried something like this 'source(glob2rx("*.R"))' without success. Thank you -- View this message in context: http://www.nabble.com/Wildcards-tf4627981.html#a13214214 Sent from the R help mailing list archive at Nabble.com.
2010 Apr 19
3
stupid regexp question
Hello, I have a stupid regexp question. I have a large data frame of strings. I would like to convert all occurences of : "W.m^{-2}" to "W/m2" I make the following test : gsub(glob2rx("W.m^{-2}"), "W/m2", "W.m^{-2}") but it does not seem to work. I don't know how to do it otherwise as I could never learn how to deal with the special characters (like .^{}) in regexps. Thanks from advance for your kindly help servet
2010 Nov 16
2
Pass character vector to function argument
A bit embarrassed to post this seemingly trivial question, but I can't find anything in the archive that's quite relevant: a1=1 a2=2 obs=objects(pattern=glob2rx("a?")) I want to utilize 'obs' as a function argument to produce something like: sum(a1,a2) Obviously, sum(obs) doesn't work, but I've tried variations of 'eval', 'parse', 'mget', and 'noquote' without success. What am I missing? Thanks,...
2011 Jan 21
3
How to find data that includes certain values
I am trying to return an index for a data set by searching using filenames. The name may be ANG_AUT.N.0734C70411A-1_1sA_0734C70411A.fasta, but i'd just like to search it using the term "0734C70411" as the file may be 0734C70411A or 0734C70411C or 0734C70411D Any way to do this other than doing something like this. where 0734C70411A is part of matrix list[,8]
2008 Dec 21
3
Globbing Files in R
Dear all, For example I want to process set of files. Typically Perl's idiom would be: __BEGIN__ @files = glob("/mydir/*.txt"); foreach my $file (@files) { # process the file } __END__ What's the R's way to do that? - Gundala Viswanath Jakarta - Indonesia
2012 Oct 14
4
listing the files in a directory using regular expressions
Hi Experts, This might be silly question that I am asking, but no way as I am new to R. I want to list the files in a directory using regular expression like A_B*_C*.csv etc. How to make this possible in R ? I tried like this list.files(dir=".", pattern="A_B*_C*.csv") but this gives no output, whereas list.files(.... pattern="*.csv") giving all the .csv files in
2023 Jan 14
2
Removing variables from data frame with a wile card
...o use perl regular > expressions and globbing (after converting to a regular expression). > For example: > > grepl("^yr", colnames(mydata)) > > will tell you which 'colnames' start with "yr". If you'd rather you > use globbing: > > grepl(glob2rx("yr*"), colnames(mydata)) > > Then you might write something like this to remove the columns starting with yr: > > mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE] > >> On Sat, Jan 14, 2023 at 1:56 AM Steven T. Yen <styen at ntu.edu...
2006 Aug 28
2
regex scares me
Hi, apologies if this is too simple but I've been stuck on the following for a while: I have a vector of strings: filenames with a name before the extension and a variety of possible extensions I want to select only those files with: 1) a ".tab" extension AND 2) the character sequence "lad" anywhere in the name of the file before the extension. Surely this
2005 Oct 10
2
wildcards and removing variables
All, Is there are a wildcard in R for varible names as in unix? For example, rm(results*) to remove all variable or function names that begin w/ "results"? cheers, Dave ps - please respond directly to afshar@miami.edu [[alternative HTML version deleted]]
2006 Sep 23
1
Regular expressions
When I type ls("package:base", pattern="log*") functions with names like "floor" and "Sys.setlocale" are included. I don't think this is how "*" is supposed to work. To get the desired response I have to use: ls("packge:base", pattern="logg*") I thought "log*" means "log" followed by anything? Thanks
2012 Nov 14
1
R wildcards, sapply and as.factor
I want to change the type to factor of all variables in a data frame whose names match a certain pattern. So here I am trying to change the type to factor of all variables whose name begins with?namestub?in the dataframe?df. attach(df)sapply(grep(glob2rx("namestub*"),names(df)),as.factor) But this doesn't work since >levels(df$namestub1)NULL
2023 Jan 14
1
Removing variables from data frame with a wile card
...expressions to find matches, but you can also use perl regular expressions and globbing (after converting to a regular expression). For example: grepl("^yr", colnames(mydata)) will tell you which 'colnames' start with "yr". If you'd rather you use globbing: grepl(glob2rx("yr*"), colnames(mydata)) Then you might write something like this to remove the columns starting with yr: mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE] On Sat, Jan 14, 2023 at 1:56 AM Steven T. Yen <styen at ntu.edu.tw> wrote: > > I have a...
2010 May 20
1
use object within rda file in for loop
...a files that I have in one folder. Up to now, I can load all the *.rda files without any problem. The problem is when I want to access the list saved within each *.rda file (only one list per rda file). Here is my code: fpath <- "D:/R" listnames <- list.files(path=fpath, pattern=glob2rx("*.rda"), full.names=FALSE) for (i in 1:length(listnames)) { load(paste(fpath, listnames[i], sep="/")) z <- list_in_listnames[i] ## here is my problem **do something on z** } It might be really simple, but listnames is a character vector and I cannot find how to...
2007 Feb 05
1
Build error with last R-devel tarball
....url, count.fields, data, data.entry, dataentry, de, de.ncols, de.restore, de.setup, debugger, d emo, download.file, download.packages, dump.frames, edit, emacs, example, file_test, file.edit, find, fix, fixInNamespace, flush.console, formatOL, formatUL, getAnywhere, getFromNamespace, getS3method, glob2rx, head, head.matrix, help, help.search, help.start, history, index.search, install.packages, i nstalled.packages, limitedLabels, loadhistory, localeToCharset, ls.str, lsf.str, make.packages.html, make.socket, memory.limit, memory.size, menu, methods, mirror2html, modifyList, new.packag In addition:...
2023 Jan 14
3
Removing variables from data frame with a wile card
...use > perl regular expressions and globbing (after converting to a regular expression). > For example: > > grepl("^yr", colnames(mydata)) > > will tell you which 'colnames' start with "yr". If you'd rather you > use globbing: > > grepl(glob2rx("yr*"), colnames(mydata)) > > Then you might write something like this to remove the columns starting with yr: > > mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE] > >> On Sat, Jan 14, 2023 at 1:56 AM Steven T. Yen <styen at ntu.edu...
2023 Feb 12
2
Removing variables from data frame with a wile card
...ssions and globbing (after converting to a regular expression). >> For example: >> >> grepl("^yr", colnames(mydata)) >> >> will tell you which 'colnames' start with "yr". If you'd rather you >> use globbing: >> >> grepl(glob2rx("yr*"), colnames(mydata)) >> >> Then you might write something like this to remove the columns starting >> with yr: >> >> mydata <- mydata[, !grepl("^yr", colnames(mydata)), drop = FALSE] >> >> On Sat, Jan 14, 2023 at 1:56 AM Steven T...