Displaying 20 results from an estimated 2000 matches similar to: "regex question on escaping "." (and a couple other regex questions as well)"
2010 Oct 20
2
ascii or regex code for alt-enter for Excel
I need to write a table that can be opened in Excel or OpenOffice such that
there are newlines embedded within cells.
After much Googling and futzing, I can't figure out how to do this. The way
to do this within Excel is alt-Enter and I've tried '/n', '/n/r', '/r/n' per
some web suggestions without luck.
Anybody know what character or ASCII code to use for this?
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 Aug 20
5
help with regular expressions in R
I'm having trouble achieving the results I want using a regular expression.
I want to eliminate all characters that fall within square brackets as well
as the brackets themselves, returning an "". I'm not sure if it's R's use of
double slash escapes or something else that is tripping me up. If I only use
one slash I get
1: '\[' is an unrecognized escape in a
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 **
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
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"
2008 Sep 24
1
splitting strings efficiently
I have a very long list of strings. Each string actually contains multiple
values separated by a semi-colon. I need to turn each string into a vector
of the values delimited by the semi-colons. I know I can do this very
laboriously by using loops, nchar, and substr, but it is terribly slow. Is
there a basic R function that handles this situation? If not, is there
perhaps a faster way to do it than
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?
2008 Mar 05
4
vertex labels in igraph from adjacency matrix
I am getting some unexpected results from some functions of igraph and
it is possible that I am misinterpreting the vertex numbers. Eg., the
max betweenness measure seems to be from a vertex that is not connected
to a single other vertex. Below if my code snippet:
require(igraph)
my.graph <- graph.adjacency(adjmatrix = my.adj.matrix, mode=c("undirected"))
most.between.vert <-
2008 Aug 05
2
creating overall title for plots made with par(mfrow=c(2,2))
I'm making some plots on the same page and would like to include an overall
title instead of individual main titles as they are similar and their x and
y axis labels are sufficient to distinguish them.
Is there a way to assign an overall "main" to this page of plots?
Mark
--
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine
15032
2009 Sep 16
4
2.10.0 Under development (unstable) (2009-09-15 r49711) just built segfaults on Debian Squeeze
I just downloaded R-devel and when loaded it immediately segfaults. I'm not
sure how much or what sort of diagnostic info and can provide, but below is
my build script, my console output, and the output of uname -r. I am
currently dependent on the development version of a package, so I'd like to
get R-devel up and running if possible. I am sure there is more info I can
provide, but before
2010 Mar 07
2
vectorizing ANOVA over a vectorized linear model
Is it possible to vectorize anova over the output of a vectorized lm? I
have a gene expression matrix with each row being a gene and columns for
samples. There are several factors with interactions. I can get p values by
looping over the matrix with lm and anova, but I would like to make this as
computationally efficient as possible. I am able to vectorize the lm
command, but when I try to use
2007 Aug 03
2
RSPython won't load in R 2.6.0 under Linux
I can compile RSPython without difficulty, been when I try to load it, I
get the error messages below. Also below are some cryptic warnings I get
on R boot (in case these are pertinent) and my sessionInfo().
Any help is appreciated. Thanks, Mark
Warning messages:
1: In .updateMethodsInTable(fdef, where, attach) :
Couldn't find methods table for "conditional", package
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 Oct 12
3
help with the use of mtext to create main title over multiple plots
I'm trying to use mtext to create a main title over multiple plots. Below is
a simple self-contained example and my sessionInfo (I should note I've also
tried this with R-2.8.1 with the same results). When I execute the code
chunk below, I get the plots, but no title. I've tried this using the screen
driver, pdf, and postscript. I've used different sizes of paper. I suspect I
am
2008 Jun 24
2
problem with rgl interactivity with R-2.7.1 and Ubuntu Hardy
I'm trying to use the rgl package on R-2.7.1 running on top of Ubuntu
Hardy amd64. using open3d() and plot3d() I get a plot, but it is not
interactive. Furthermore, changes to par3d("FOV"=my.new.value) do
nothing. I suspect something is wrong with the rendering engine or
interface to it. I do have an Nvidia driver installed and compiz works
correctly on the desktop.
I've
2009 Oct 28
2
how to model a numeric factor as a non-ordinal factor
I am analyzing an experiment in which time is a factor, represented by
numbers indicating time since last treatment, but in this particular case
there is no reason to think that time has a numeric meaning in the sense
that 24 would be greater than 6. We have no idea which genes will be
increasing or decreasing at different times.
So I have the following model (to be applied over many genes):
mod
2008 Jun 03
2
benchmarking R installations
Recently I posted to this list with a question about using the Intel 10.1
compilers in building R and one response was basically, "why in the heck
would you want to do that?" The answer is that my sysadmin believes that
there will be a performance boost with the Intel vs. Gnu compilers on our
Linux cluster, of which I am one of many users. Wanting to be a good citizen
and use my machine
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