similar to: Conditional importFrom (roxygen?)

Displaying 20 results from an estimated 300 matches similar to: "Conditional importFrom (roxygen?)"

2015 Oct 04
0
Conditional importFrom (roxygen?)
On 04/10/2015 10:10 AM, Jonathan Greenberg wrote: > 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
2015 Oct 04
2
Conditional importFrom (roxygen?)
Duncan Murdoch <murdoch.duncan <at> gmail.com> writes: > > On 04/10/2015 10:10 AM, Jonathan Greenberg wrote: > > Folks: > > [snip snip snip] > > > > Is there a way to do a conditional importFrom based on the OS? Or can I > > safely ignore this (I'm trying to submit to CRAN). > > > > Yes, you can put conditionals into the
2015 Oct 04
0
Conditional importFrom (roxygen?)
On 04/10/2015 7:34 PM, Ben Bolker wrote: > Duncan Murdoch <murdoch.duncan <at> gmail.com> writes: > >> >> On 04/10/2015 10:10 AM, Jonathan Greenberg wrote: >>> Folks: >>> > > [snip snip snip] > >>> >>> Is there a way to do a conditional importFrom based on the OS? Or can I >>> safely ignore this (I'm trying
2007 Mar 31
1
Too long pathname in bitmap() crashes R on WinXP
Hi, using too long pathnames for bitmap() crash R on WinXP. I've verified that this is the case with R version 2.4.1 Patched (2007-03-25 r40958) and R version 2.5.0 alpha (2007-03-30 r40957). I cannot reproduce it on Linux. REPRODUCIBLE EXAMPLE: % Rterm --vanilla # Tell R where Ghostscript is gsexe <- "C:/gs/gs8.54/bin/gswin32c.exe"; gsexe <- "C:/Program
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
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",
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
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',
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
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: >
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"),
2007 Feb 05
1
Build error with last R-devel tarball
Hi, On Windows, with last R-devel tarball (r40647) from ftp://ftp.stat.math.ethz.ch/Software/R/R-devel_2007-02-04.tar.gz I get the following build error: E:\biocbld\bbs-2.0-bioc\R\src\gnuwin32> make ... ... ---------- Making package utils ------------ adding build stamp to DESCRIPTION installing NAMESPACE file and metadata installing R files Error in namespaceExport(ns, exports) :
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
3
Removing variables from data frame with a wile card
Steven, Just want to add a few things to what people wrote. In base R, the methods mentioned will let you make a copy of your original DF that is missing the items you are selecting that match your pattern. That is fine. For some purposes, you want to keep the original data.frame and remove a column within it. You can do that in several ways but the simplest is something where you sat the
2016 Aug 30
1
cat(..., append=TRUE) on sftp share
Dear R-SIG-Debian Team, r-devel sent me to you. Situation: Ubuntu 16.04, R-3.3.1, and a file in a folder mounted with sftp via gnome virtual file system. for(i in 1:10){cat(i,file = "/run/user/1001/gvfs/sftp:host=server/path on server/test2",append = TRUE)} gives a file that reads |10| and not |12345678910| Further checking: * A mapped network drive on Windows 7 and
2023 Feb 12
2
Removing variables from data frame with a wile card
x["V2"] is more efficient than using drop=FALSE, and perfectly normal syntax (data frames are lists of columns). I would ignore the naysayers, or put a comment in if you want to accelerate their uptake. As I understand it, one of the main reasons tibbles exist is because of drop=TRUE. List-slice (single-dimension) indexing works equally well with both standard and tibble types of data