similar to: help with regular expressions in R

Displaying 20 results from an estimated 1300 matches similar to: "help with regular expressions in R"

2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called heatmap.w.row.and.col.clust which auto-generates breaks using breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20, digits = 2) #(stddev in this case = 2.5) This has always worked well in the past but now I am getting an error that non-finite breaks are being generated. Drilling down, it seems that my wrapper is generating finite
2008 Oct 17
1
how to list variables enclosed in an environment
I'm having trouble with a Bioconductor package, an variable expected in an environment does not seem to be there. As part of my investigation of the problem (most likely on my end) I'd like to list the variables contained in an environment. If you have an environment loaded, lets call it "pkgEnv', how does one find what it does contain? Mark
2009 Nov 12
2
package "tm" fails to remove "the" with remove stopwords
I am using code that previously worked to remove stopwords using package "tm". Even manually adding "the" to the list does not work to remove "the". This package has undergone extensive redevelopment with changes to the function syntax, so perhaps I am just missing something. Please see my simple example, output, and sessionInfo() below. Thanks! Mark require(tm)
2009 Jul 04
4
help with dealing with integer(0) returns from grep used within a conditional loop
I am using grep to locate colnames to automate a report build and have run into a problem when a colname is not found. The use of integer(0) in a conditional statement seems to be a no no as it has length 0. Below is a self-contained trivial example. I would like to get something like "NA" or -1 for the position when it is not found OR learn a way to use integer(0) or some
2009 May 30
2
'options=utils::recover' not working in .Rprofile or within R
For years I have been using options(error = recover) either in .Rprofile or from within R for debugging purposes. The functionality of this appears to have changed and I can't recover it (no pun intended) using the ?options help page. How can I get the old functionality back, particularly from within .Rprofile? A specific line entry would be appreciated. An example, the help page, and
2008 Oct 14
1
XML_1.98-0 fails to build on Debian Lenny with gcc 4.3.2 and R-beta 2.8.0
Subject pretty much says it all. Wonder if there is there is some code in XML that the new gcc doesn't like? See output below: * Installing *source* package 'XML' ... checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking
2009 Aug 28
1
problems with strsplit using a split of ' \\\ ' : a regex problem
I have a vector of gene symbols, some of which have multiple aliases. In the case of an alias, they are separated by ' \\\ '. Here is a real world example, which would represent one element of my vector: Eif4g2 /// Eif4g2-ps1 /// LOC678831 What I would like to do is input the vector into a function and output a vector with just the first alias of each element (or, if there are no aliases,
2009 Jul 08
2
can't get rJava to install on Linux
Having difficulties getting rJava to install on my Debian Squeeze box. Perused the R-help list and tried some things that have worked for others but not for me. Below is the output of my attempted build, R CMD javareconf -e, and sessionInfo(). Note I tried the R CMD javareconf also as root, restarted R after each of these, all no help. * Installing *source* package ?rJava? ... checking for
2009 Jun 17
1
problem with scan recognizing newline '\n'
I'm using R to do some file processing in Linux and am trying to read in the output of find . -type f -print > ~/Music_Archives_search_problem/ls.output.find.txt This command yields a text file with each line representing the full path name of all files in the directory and subdirs. Unfortunately, there seem to be some special characters that interfere with scan recognizing '\n' as
2010 Jun 28
6
Basic question - more efficient method than loop?
I'm guessing there's a more efficient way to do the following using the index features of R. Appreciate any thoughts.... for (i in 1:nrow(dbs1)){ if(dbs1$Payor[i] %in% Payor.Group.Medicaid) dbs1$Payor.Group[i] = "Medicaid" if(dbs1$Payor[i] %in% Payor.Group.Medicare) dbs1$Payor.Group[i] = "Medicare" if(dbs1$Payor[i] %in% Payor.Group.Commercial)
2009 Aug 17
2
reading in MS Word files
I am familiar with packages that read and write Excel files on both Windows and Linux platforms. Do any packages provide similar functionality for MS Word files? I have a lot of text processing to do and the text is embedded in ~200 different Word files (.doc format Office 2003). All I need to do is read, not write. Thanks, Mark ------------------------------------------------------------ Mark
2009 Aug 13
1
using package tm to find phrases
I am using the package "tm" for text-mining of abstracts and would like to use it to find instances of gene names that may contain white space. For instance "gene regulatory protein 1". The default behavior of tm is to parse this into 4 separate words, but I would like to use the class constructor "dictionary" to define phrases such as just mentioned. Is this
2008 Nov 08
2
question about the "Y of R" article in the latest R news
I found the article the "Y of R" in the latest R news to be very interesting. It is certainly challenging me to learn more about how R works "under the hood" as the author states. What is less clear to me is whether this approach is primarily for teaching purposes or has a real world application. What is meant by "fragility of reliance on the function name defined as a
2008 Nov 13
1
readPDF() -- unsure how to install xpdf to make this work?
Dear R-Help, I need to convert a set of '.pdf' files into an equivalent set of '.txt' files. This is so that i can do some text mining on the content. In the latest R-News letter (http://cran.r-project.org/doc/Rnews/ Rnews_2008-2.pdf), the package 'tm' for text mining is mentioned. In that lovely package, there is a function called 'readPDF()'. In order to use
2008 May 06
3
rggobi is crashing R-2.7.0
I am running 64-bit Ubuntu 8.04 and when I invoke rggobi the interactive graph displays but R crashes. See my sessionInfo() and a short example below. Ggobi and rggobi installed without complaints. Mark > sessionInfo() R version 2.7.0 Patched (2008-05-04 r45620) x86_64-unknown-linux-gnu locale:
2008 May 03
4
interactive rotatable 3d scatterplot
I would like to create a 3d scatterplot that is interactive in the sense that I can spin it on its axes to better visualize some PCA results I have. What are the options in R? I've looked at RGL and perhaps it will suffice but it wasn't apparent from the documentation I found. Any demo scripts available for a package that will work? Mark -- Mark W. Kimpel MD ** Neuroinformatics **
2007 May 17
4
help with executing instruction every i-th run of loop
I am running a very long loop and would like to save intermediate results in case of a system or program crash. Here is the skeleton of what my code would be: for (i in 1:zillion) { results[[i]]<-do.something.function() if (logical.test(i)) {save(results, "results.tmp")} } logical.test would test to see if i/1000 has no remainder. What R function would test that?
2007 Jan 31
4
possible spam alert
The last two times I have originated message threads on R or Bioconductor I have received the message included below from someone named Patrick Connolly. Both times I was the originator of the message thread and used what I thought was a unique subject line that explained as best I could what my question was. Patrick seems to be implying that I am abusing the R and BioC help newsgroups in this
2008 Mar 12
2
subset list based on logical within element flag
I have a very long list that I'd like to subset based on a logical value within each element. Example below. I'd like to get just those list elements for further study whose $sig.cor slot is TRUE. In this example, I'd only want element [[2]]. Should be simple, I know. How can I do this? Thanks, Mark > gene.pair.tf.lst [[1]] [[1]]$gene.pair [1] "Lgals1:Pxmp2"
2009 Jul 15
2
rJava fails compilation on R-2.9.1 but not R-2.7.1 on Debian Lenny
I have been futzing around for days tying to get rJava to install on my freshly build Debian Lenny installation. I have R-2.9.1 installed from source in my R_HOME directory and R-2.7.1 installed via apt-get install r-recommended. I was tried many different things, but by accident started up R-2.7.1 as root and viola, successful install. I immediately exited out of R-2.7.1 and started R-2.9.1 as