Displaying 20 results from an estimated 1000 matches similar to: "matching problem"
2011 Feb 13
3
String manipulation
Please consider following string:
MyString <- "ABCFR34564IJVEOJC3434"
Here you see that, there are 4 groups in above string. 1st and 3rd groups
are for english letters and 2nd and 4th for numeric. Given a string, how can
I separate out those 4 groups?
Thanks for your time
[[alternative HTML version deleted]]
2007 Aug 02
4
Finding multiple characters in the same string
Hi
I have this problem where I need to find if there is any numbers in a
string, this is no problem if theres only one number per string. I would
then simply use the regexpr() funtion togheter with the substring function
to extract the number. But regexpr only picks one number per string either
from the beginning or the end, but not multiple. Can this be done? And how
for example
My string <-
2008 Oct 28
1
gsubfn, strapply, REGEX Problem
Hi all,
I swear this used to work:
library(gsubfn)
strapply("S(AC,P)TVDK(8)EELVQK(8), ".[(].{1,2}[)]|.")[[1]]
But somewhere along the update path it stopped ... now giving me this
Error in base::gsub(pattern, rs, x, ...) :
invalid backreference 2 in regular expression
Can't figure it out. What am I doing wrong?
Thanks for any hints, Joh
2008 Feb 12
6
Matching Problem
Hi
I have this vector of strings.
MyData <- c("Test1","Test2","I(Test1^2)","I(Test2^3)","I(Test1.Test2^2)")
where I want to extract only the text after "I(" and before "^" so that the
string returned only contain c("Test1","Test2","Test1.Test2")
I am not very skilled in the use of matching
2010 Feb 08
2
the hat ^ in regular expression
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100208/52a6d080/attachment.pl>
2009 Feb 12
3
getting all pairwise combinations of elements in a character string
I'm able to do this as follows, but am wondering if anyone knows a
simpler way which still avoids explicit loops?
> (mystring <- letters[1:5])
[1] "a" "b" "c" "d" "e"
> unlist(sapply(mystring[-length(mystring)],
+ function(x)
paste(x,mystring[(grep(x,mystring)+1):length(mystring)],sep="")))
a1 a2 a3
2007 May 28
2
[LLVMdev] Problem in llvm gcc back-end
HI,
While I testing some code, I found some problem on Union handling.
I've wrte following test code, and it has union assignment.
The code's output is
from pointerToUnion: chars mystring, length 64
from original: chars mystring, length 8000
It's caused by second char member(charlength) of LongestMember.
For union assignment, llvm-backend seems generates assigning each
member of
2007 Nov 20
3
How to test views with Nested Resources and Partials
Hi everyone,
I am relatively new to rspec and I am running into a wall in testing my
views. I have a RESTful resource Contracts with a nested resource of
Line_items.
I am trying to figure out how to test the "edit" form of the Line_items.
What complicates this is the nested routing and how to account for it,
and that there is a partial form (_form.haml) that both the edit.haml
and
2009 Oct 03
1
Named backreference in gsub()?
Hi,
I'm running out of the *numbered* backreferences \\1, \\2, ..., \\9
for gsub(). Does R support *named* backreferences, and if so, what is
the syntax?
Thanks
Henrik
2010 Mar 26
6
Rake argument error
Hi,
I''m having a problem loading a sample data with simple rake command.
rake db:fixtures:load
When I run the above command,I get the following error
$rake db:fixtures:load
(in /home/raghu/www/photos)
rake aborted!
a YAML error occurred parsing
/home/raghu/www/photos/test/fixtures/photos.yml. Please note that YAML
must be consistently indented using spaces. Tabs are not allowed. Please
2011 Oct 05
1
Weird behaviour of tab characters in a string in R (vs Python)
Hello,
I wanted to parse some information from a text, where fields are tab
separated.
When I copy the text into an R session (under emacs) like:
mystring <- "field1 field2 field3"
the tab character is replaced by a single space!
For ex, if I type mystring, I get:
"field1 field2 field3"
The tabs have disappeared!!!
I checked with Python that the text I copied was tab
2007 Aug 23
2
Splitting strings
I'm having a Thursday morning mental block, any suggestions on the following
would be most appreciated...
I have (as an example)
surgery = c("d48", "d67", "dnc37", "a75", "d10", "a78", "d31",
"d55", "d1")
before each number part the possibilities are c("a", "d",
2012 Jan 04
1
Warning message about closing a connection XXXX
Hello everyone,
After running the following code, I obtain this error message.
> mydata <- read.table(textConnection(mystring),
+ header=TRUE, sep=",",
+ row.names="id", na.strings=" ")
> mydata
Warning message:
closing unused connection 3 (mystring)
=====
However, when I attempt to run read.table() again and immediately submit
the close() function
2011 Aug 04
3
#create tests fail when I add FriendlyId to my model
I am doing controller testing, and I can''t seem to get the create
method test to pass when friendly_id is added to the mix. If I comment
it out of the model, the tests all pass perfectly. The moment I add it
back in, the error looks like this:
1) Error:
test_create_valid(BrandsControllerTest):
FriendlyId::BlankError: FriendlyId::BlankError
2006 Jun 29
3
stylesheets
hi,
all
i have been playing around with rails for sometime,
i have seen most not all of the rails sites have similar look and feel (good
one)
i want to know how to use the stylesheets provided by the RoR framework if
any
or is it that we have to define on our own from scratch.
basiclly i need information regarding how can i make my view better
looking(the visuals)
Thanks in advance
warm
2006 Nov 29
1
Extract some character from a character vector of length 1
the content of th character vector (of length 1) is as follows:
a <- "something2 ....pat1 name1 pat2 something2....pat1 name2
pat2....pat1 name3 pat2 "
I would like to extract the character bewteen pat1 and pat2. That's to
say, I would like to get a vecter of c("name1", "name2","name3").
What I did is use strsplit() twise. But I wonder if there
2007 Jul 26
1
Create Strings of Column Id's
Does anyone know how this is don?
I have a large matrix where I extract specific columns into txt files for
further use. To be able to keep track of which txt files contain which
columns I want to name the filenames with the column Id's.
The most basic example would be to use an for() loop together with paste(),
but the result is blank. Not even NULL.
this is the concept of thecode i use:
2009 Mar 30
1
Retrieving the context
Dear list,
I have a general problem that I really don't know how to solve efficiently
in R. Lets say we have a sequence of things, like for instance a string of
words, that is stored in a file. We need all the words in a table format, so
therefore we create an id for the word, that links the word to a file and
the position of the word within the file, like:
#In this case a very short file
2007 Jun 08
3
Barplots: Editing the frequency x-axis names
Hi
I have a timeSeries object (X) with monthly returns. I want to display the
returns with a barplot, which I can fix easily. But my problem is labaling
the x-axis, if I use the positions from the timeseries It gets very messy. I
have tried rotating and changing the font size but it doesn't do the trick.
I think the optimal solution for my purpose is too only display every second
or third
2006 Jul 06
6
Class variables in templates/layouts
I''m having problems with class variables.. I have a class:
class Content::ApplicantsController < ApplicationController
layout "mylayout"
@@tab = "mystring"
[... the rest is standard scaffold-created stuff ...]
and a layout (mylayout.rhtml):
[...]
<title><%= @@tab.capitalize %></title>
[...]
And I keep getting this error:
uninitialized