Displaying 20 results from an estimated 10000 matches similar to: "Strsplit with a separator of ||"
2012 Feb 20
3
How to determine a subset of a binary strings?
Hi,
I need some neat ways of determing a subset of binary strings. For example,
x=c(0,0,1), y=c(0,1,1), z=c(0,1,0). So x is a subset of y and z is also a
subset of y, but x is not a subset of z.
I tried to search R functions and packages but no hits. Any ideas?
Best,
Jing
--
Jing Tang, PhD
Senior Researcher
Finnish Institute of Molecular Medicine (FIMM)
FI-00014 University of
2004 Nov 02
3
n-th power of a matrix
Hello all,
To calculate the power of a matrix, I used the command "mtx.exp(X, n)", but
there is an error saying "Error: couldn't find function "mtx.exp"". How can
I deal with this problem?
Jing
2013 Feb 06
2
The interpretation of lm(y~x)?
Hi,
I am reading the book "Mixed Effects Models in S and S-Plus" and come
across an example with the Rail data.
I tried to use lm(travel~Rail,data=Rail) and got the following result:
Call:
lm(formula = travel ~ Rail, data = Rail)
Residuals:
Min 1Q Median 3Q Max
-6.6667 -1.0000 0.1667 1.0000 6.3333
Coefficients:
Estimate Std. Error t value Pr(>|t|)
2004 Dec 14
4
Several questions in R
Hi,
I have several small question in R,
1) How to display all the variables in current workspace?
2) How to write a long command in two lines. Suppose one command line is
long to be put within one line.
Thanks!
tang
2013 Feb 08
1
Contrasts for a data
Hi,
I am using a data called Rail in the nlme package. The data contains two
variables: Rail and Travel.
>Rail
Grouped Data: travel ~ 1 | Rail
Rail travel
1 1 55
2 1 53
3 1 54
4 2 26
5 2 37
6 2 32
7 3 78
8 3 91
9 3 85
10 4 92
11 4 100
12 4 96
13 5 49
14 5 51
15 5 50
16 6 80
2012 Apr 11
1
strsplit help
Dear all,
I want to use string split to parse column names, however, I am having
some errors that I don't understand.
I see a problem when I try to rbind the output from strsplit.
please let me know if I'm missing something obvious,
thanks,
alison
here are my commands:
>strsplit<-strsplit(as.character(Rumino_Reps_agreeWalign$geneid),"\\.")
>
2006 Apr 04
1
extending strsplit(): supply pattern to keep, not to split by
strsplit() is a convenient way to get a
list of items from a string when you
have a regular expression for what is not
an item. E.g.,
> strsplit("1.2, 34, 1.7e-2", split="[ ,] *")
[[1]]:
[1] "1.2" "34" "1.7e-2"
However, sometimes is it more convenient to
give a pattern for the items you do want.
E.g., suppose you want to pull
2005 Oct 28
1
Error in ?strsplit
Hi all,
Came across an error in ?strsplit in the details section:
Details:
Arguments 'x' and 'split' will be coerced to character, so you
will see uses with 'split = NULL' to mean 'split = character(0)',
including in the examples below.
I caught myself trying to use strsplit() on a factor and the coercion on
'x' is not done.
According
2009 Sep 17
2
Why strsplit can be used with matrix but not data.frame?
Hi,
As show in the code below, strsplit can be applied to a matrix but not
a data.frame. I don't understand why R is designed in this way. Can
somebody help me understand it? How to split all the strings in x$y?
x=data.frame(x=1:10,y=rep("abc",10))
strsplit(x$y,'b') #Error in strsplit(x$y, "b") : non-character argument
y=cbind(1:10,rep("abc",10))
2010 Jul 08
2
strsplit("dia ma", "\\b") splits characterwise
\b is word boundary.
But, unexpectedly, strsplit("dia ma", "\\b") splits character by character.
> strsplit("dia ma", "\\b")
[[1]]
[1] "d" "i" "a" " " "m" "a"
> strsplit("dia ma", "\\b", perl=TRUE)
[[1]]
[1] "d" "i" "a" " "
2012 Feb 11
2
obtaining a true/false vector with combination of strsplit, length, unlist,
Hi,
A pared down version of the dataset I'm working with:
edm<-read.table(textConnection("WELLID X_GRID Y_GRID LAYER ROW COLUMN
SPECIES CALCULATED OBSERVED
w301_3 4428. 1389 2 6 18 1 3558
6490.
w304_12 4836. 6627 2 27 20 1 3509
3228.
02_10_12080 3.6125E+04 13875 1 56 145 1
2011 Feb 04
3
lapply, strsplit, and list elements
Hi there,
I have a problem about lapply, strsplit, and accessing list elements,
which I don't understand or cannot solve:
I have e.g. a character vector with three elements:
x = c("349/077,349/074,349/100,349/117",
"340/384.2,340/513,367/139,455/128,D13/168",
"600/437,128/903,128/904")
The task I want to perform, is to generate a list,
2006 Aug 29
3
Substring and strsplit
Dear R People:
I am trying to split a character vector into a set of individual
letters:
Ideal:
x3 <- c("dog")
"d" "o" "g"
I tried the following:
> strsplit(x3)
Error in strsplit(x3) : argument "split" is missing, with no default
> strsplit(x3,1)
[[1]]
[1] "dog"
I know that this is incredibly simple, but what am I doing
2011 Aug 03
2
strsplit and forward slash '/'
Hi All,
is there a way of using strsplit with a forward slash '/' as the splitting point?
For data such as:
1 T/T C/C 16/33
2 T/T C/C 33/36
3 T/T C/C 16/34
4 T/T C/C 16/31
5 C/C C/C 28/29
6 T/T C/C 16/34
strsplit(my.data[1,1], "/") # and any variation thereof
Error in strsplit(apoe[1, 1], "/") : non-character
2012 Nov 08
3
strsplit with invalid regular expression
Hi all,
> diff_operator <- "\\("
> strsplit(cond, diff_operator)
[[1]]
[1] "andsin" "log_angle_1_4)"
> diff_operator <- "\\sin("
> strsplit(cond, diff_operator)
Error in strsplit(cond, diff_operator) :
invalid regular expression '\sin(', reason 'Missing ')''
When I am going to split with "("
2007 Dec 03
3
strsplit on comma, with a trailing comma in input
I have a comma-separated data file in which trailing commas sometimes occur.
I am using strsplit to extract the data from this file, and it seems great
except in cases with trailing comma characters.
The example below illustrates. What I'd like is to get a fourth element in
the answer, being an empty string just like the second element. Is there a
way I can express my patter (or perhaps
2006 Apr 17
1
strsplit does not return correct value when spliting "" (PR#8777)
Full_Name: Charles Dupont
Version: 2.2.0
OS: linux
Submission from: (NULL) (160.129.129.136)
when
strsplit("", " ")
returns character(0)
where as
strsplit("a", " ")
returns "a".
these return values are not constiant with each other.
Charles Dupont
2012 Jan 25
4
help to slip a file name using "strsplit" function
Dear Researchers,
I have several files as this example: Myfile_MyArea1_sample1.txt
i wish to split in "Myfile", "MyArea1", "sample1", and "txt", becasue i
need to use "sample1" label. I try to use "strsplit" but I am able just to
split as "Myfile_MyArea1_sample1" and "txt" OR "Myfile", "MyArea1",
2007 Oct 22
3
strsplit
Hello R Gurus:
I would like to take a character string and split at the $ sign.
I thought that strsplit would do it, but here are the results:
> vv
[1] "whine$ts1"
> vv
[1] "whine$ts1"
> strsplit(vv,"$")
[[1]]
[1] "whine$ts1"
Does anyone have any suggestions, please?
Thanks,
Edna Bell
2019 Dec 18
2
A weird behaviour of strsplit?
Hi all,
In the help of strsplit one can read
split character vector (or object which can be coerced to such) containing regular expression<http://127.0.0.1:39783/help/library/base/help/regular%20expression>(s) (unless fixed = TRUE) to use for splitting. If empty matches occur, in particular if split has length 0, x is split into single characters. Ifsplit has length greater than 1, it is