similar to: Partial file name

Displaying 20 results from an estimated 2000 matches similar to: "Partial file name"

2006 Apr 25
1
Add qoutation marks and combine values in a vector
I wish to place quotation marks around each element of the following list; X1 1 Label 1 2 Label 2 3 Label 3 4 Label 4 and combine the values in the following format for use in another function; c("Label 1","Label 2","Label 3","Label 4") Many thanks, Jerry
2013 Mar 14
2
Grep with wildcards across multiple columns
I have a fairly large data set with six variables set up like the following dummy: # Create fake data df <- data.frame(code = c(rep(1001, 8), rep(1002, 8)), year = rep(c(rep(2011, 4), rep(2012, 4)), 2), fund = rep(c("10E", "10E", "10E", "27E"), 4), func = rep(c("110000",
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
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.
2015 Oct 04
2
Conditional importFrom (roxygen?)
Folks: I am getting a build failure when I: #' @importFrom utils shortPathName which roxygenizes it to the NAMESPACE. I suspect this is because this particular function is Windows-only, but I'm a bit confused how I should "properly" importFrom 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:
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]
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
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',
2007 Jan 22
1
Unusual behaviour get.hist.quote
I have been running this script regularly for some time. This morning the following error message appeared. Any suggestions to correct this change would be appreciated. EWL<-get.hist.quote("EWL",start=(today <- Sys.Date())-350,quote="Cl") trying URL 'http://chart.yahoo.com/table.csv?s=EWL&a=1&b&c 06&d=0&e!&f
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
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
2006 Aug 03
4
meta characters in file path
Hi, I need to read in some files. The file names contain come meta characters such as @, #, and white spaces etc, In read.csv, file= option, is there any way that one can make the function to recognize a file path with those characters? Thanks Johnny [[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
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 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
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: >
2005 Apr 25
2
problem with dir() in R-2.1.0?
Hi, I always use dir(pattern="*.RData") in all the earlier version of R (1.8, 1.9, 2.0.1). Error messege is as below: Error in list.files(path, pattern, all.files, full.names, recursive) : invalid 'pattern' regular expression Does anyone have an idea what's going on? How should I define the pattern I need in R-2.1.0? Thanks! Bin
2023 Jan 14
1
Removing variables from data frame with a wile card
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: grepl("^yr", colnames(mydata)) will tell you which 'colnames' start with "yr". If you'd rather you use globbing:
2010 May 20
1
use object within rda file in for loop
Dear users, I would like to process all the lists from all *.rda 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"),