similar to: problems with strsplit using a split of ' \\\ ' : a regex problem

Displaying 20 results from an estimated 1000 matches similar to: "problems with strsplit using a split of ' \\\ ' : a regex problem"

2010 Oct 26
4
divide column in a dataframe based on a character
Hello, If I have a dataframe: example(data.frame) zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll") ddd <- cbind(dd, group = zz) and I want to divide the column named group by the "_", how would I do this? so instead of the first row being x
2010 Aug 19
1
Help with Vectors and conditional functions
Good morning, I have something like this: names(coint_tests) <- apply(b,2,paste, collapse="_") which prints 15 names like: A_B, C_D, E_F, ... AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields "yes" or "no". I need to add a function to plot the time series Ai_Bi if the coint_tests vectors gives me a "YES".
2013 Mar 02
3
if value is in vector, perform this function
Hi, I'm trying to set up R to run a simulation of two populations in which every 3.5 days, the initial value of one of the populations is reset to 1.5. I'm simulation an experiment we did in which we fed Daphnia populations twice a week with algae, so I want the initial value of the algal population to reset to 1.5 twice a week to simulate that feeding. I've use for loops and if/else
2012 Aug 09
1
Zoo object problem: problem when I attempt to create a zoo object of only one column
Hi, Part of my program is to calculate the number of time series in a zoo object. It works well if it has more than one time series, but it fails if it has only one. How can I access the number of column (i.e. the number of time series) when I have only one column? Why is the number of an object of only one object "NULL"? It should be one, shouldn't it? (The following example
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
2012 Aug 10
2
Zoo object problem: Find the column name of a univariate zoo object
Hi everyone and Achim, Achim, I appreciate your help about the function "NCOL". When I use "NCOL" instead of "ncol", I can find out the number of columns (number of time series) in the presence of only one time series (one variable, one column). Now I want to know how I can find out the column names of the zoo objects? In case of more than one time series, the
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
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 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
2010 Jan 07
1
regex question on escaping "." (and a couple other regex questions as well)
I have an example where escaping "." does not seem to be behaving consistently, but perhaps it is due to my misunderstanding. Could someone explain to me why the below produces the output it does? It seems to me that in the second example, where I am being more precise about specifying that a "." (dot) should be between the numbers, should produce the same output as the first
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 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
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 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 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 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:
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
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 **