Displaying 20 results from an estimated 500 matches similar to: "glob2rx function not working"
2006 Feb 19
2
changing names of vectors in list or data.frame
When I combine separate vectors into one list, there are new names
created. I'd like to change them to something more meaningful.
Here are two examples using data(zelazo) from library(ISwR):
> library(ISwR)
> data(zelazo)
> attach(zelazo)
> zelazo
$active
[1] 9.00 9.50 9.75 10.00 13.00 9.50
$passive
[1] 11.00 10.00 10.00 11.75 10.50 15.00
$none
[1] 11.50 12.00 9.00
2007 Oct 25
2
Find duplicates and save their max value
Hi,
maybe someone can help me with this:
I have a matrix of genes and values:
GeneName Value
Abc1 10
Abc2 11
Bbc1 -5
Bbc31 2
Ccd 5
Ccd -2
Ccd 7
Dda 5
Dda 10
..... .....
Zzz3 -1
I would like to
2008 Dec 16
1
renaming factor-labels / add factors etc.
Hi,
how can I change a defined factor-variable?
Like adding levels, renaming existing levels or merge several levels
of a factor to one level?
For example; following factor-variable is given:
x <- factor(c("xyz1", "abc1", "xyz2", "abc2"))
How can I add the level fgh?
And how can I merge "xyz1" and "xyz2" to one level?
And
2005 Nov 11
1
conditional coloring of image labels
Hi all,
I am interested in plotting a heatmap of a set of genes. I would like the
text labels of these genes to be colored red rather than black if they meet
certain statistical criteria (using an if statement). I'm not sure how to
change individual color labels without changing them all. Can anyone provide
some insight on how to do this?
Thanks in advance,
Jake
2006 Nov 21
1
NEWBIE: Help explaining use of lm()?
I'm attempting the heruclean task of teaching myself Introductory
Statistics and R at the same time. I'm working through Peter Dalgaard's
Introductory Statistics with R, but don't understand why the answer to
one of the exercises works. I'm hoping someone will have the patience to
explain the answer to me, both in the statistics and R areas.
Exercise 6.1 says:
The zelazo data
2002 Oct 18
4
code to turn T into TRUE
Does anyone have code that will methodically process R sourcecode, turning
T's into TRUE and F's into FALSE? I got bored doing this by hand, after the
first 30-odd functions-- there are hundreds left to do. I don't want to
simply deparse everything, because that would destroy my beautiful
formatting.
The reason it's not trivial, is that comment lines, quotes, and split lines
need
2007 Nov 01
1
loops & sampling
Hi,
I'm new to R (and statistics) and my boss has thrown me in the deep-end with the following task:
We want to evaluate the impact that sampling size has on our ability to create a robust model, or evaluate how robust the model is to sample size for the purpose of cross-validation i.e. in our current project we have collected a series of independent data at 250 locations, from which
2014 Jun 16
2
Print files which would be transfered by rsync (when syncing two directories)
Hi together,
after I read "very often" without even a tiny bit of a contradiction, I
start to have the feeling I have a basic misunderstanding of rsync.
Assume one want to get a list of files which would have been transfered
by rsync if rsync was requested to sync directories X and Y and one does
<code>
X=`mktemp`
echo "abc" > $X/1
echo "abc1" > $X/2
2015 Oct 04
2
Conditional importFrom (roxygen?)
Folks:
I am getting a build failure when I:
#' @importFrom utils shortPathName
which roxygenizes it to the NAMESPACE.
I suspect this is because this particular function is Windows-only, but I'm
a bit confused how I should "properly" importFrom a function like this so
it doesn't cause a build failure, but I don't get a note in my R CMD CHECK
if I DON'T have it:
2013 Mar 14
2
Grep with wildcards across multiple columns
I have a fairly large data set with six variables set up like the following dummy:
# Create fake data
df <- data.frame(code = c(rep(1001, 8), rep(1002, 8)),
year = rep(c(rep(2011, 4), rep(2012, 4)), 2),
fund = rep(c("10E", "10E", "10E", "27E"), 4),
func = rep(c("110000",
2009 Dec 15
2
monitor-type=MixMonitor
Hi!
Since we upgraded to 1.6.1.11, asterisk is only outputing monitored files
-in and -out.
It is not mixing them in the end.
queues.conf has monitor-type=MixMonitor...
Would somebody help me debug why it doesn't mix the sounds??
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2011 Jan 21
3
How to find data that includes certain values
I am trying to return an index for a data set by searching using filenames.
The name may be ANG_AUT.N.0734C70411A-1_1sA_0734C70411A.fasta, but i'd just
like to search it using the term "0734C70411" as the file may be
0734C70411A or 0734C70411C or 0734C70411D
Any way to do this other than doing something like this. where 0734C70411A
is part of matrix list[,8]
2007 Oct 15
2
Wildcards
Care to explain how i can use a wildcard expression to "source" all files
ending with .R in a subdirectory ? I've tried something like this
'source(glob2rx("*.R"))' without success.
Thank you
--
View this message in context: http://www.nabble.com/Wildcards-tf4627981.html#a13214214
Sent from the R help mailing list archive at Nabble.com.
2010 Apr 19
3
stupid regexp question
Hello,
I have a stupid regexp question. I have a large data frame of strings. I would
like to convert all occurences of :
"W.m^{-2}"
to
"W/m2"
I make the following test :
gsub(glob2rx("W.m^{-2}"), "W/m2", "W.m^{-2}")
but it does not seem to work. I don't know how to do it otherwise as I could
never learn how to deal with the special
2010 Nov 16
2
Pass character vector to function argument
A bit embarrassed to post this seemingly trivial question, but I can't find anything in the archive that's quite relevant:
a1=1
a2=2
obs=objects(pattern=glob2rx("a?"))
I want to utilize 'obs' as a function argument to produce something like:
sum(a1,a2)
Obviously, sum(obs) doesn't work, but I've tried variations of 'eval', 'parse',
2006 Feb 24
3
Sorting alphanumerically
I'm trying to sort a DATAFRAME by a column "ID" that contains
alphanumeric data. Specifically,"ID" contains integers all preceeded
by the character "g" as in:
g1, g6, g3, g19, g100, g2, g39
I am using the following code:
DATAFRAME=DATAFRAME[order(DATAFRAME1$ID),]
and was hoping it would sort the dataframe by ID in the following manner
g1, g2, g3, g6, g19,
2008 Dec 21
3
Globbing Files in R
Dear all,
For example I want to process set of files.
Typically Perl's idiom would be:
__BEGIN__
@files = glob("/mydir/*.txt");
foreach my $file (@files) {
# process the file
}
__END__
What's the R's way to do that?
- Gundala Viswanath
Jakarta - Indonesia
2011 Aug 22
2
Extracting columns with specific string in their names
Hi,
Let's say that I have a set of column names that begin with the string
"Xyz". How do I extract these specific columns? I tried to do the
following:
dataframe1[,grep("Xyz",colnames(dataframe1))]
But it does not work. What is wrong with my expression?
2012 Oct 14
4
listing the files in a directory using regular expressions
Hi Experts,
This might be silly question that I am asking, but no way as I am new to
R.
I want to list the files in a directory using regular expression like
A_B*_C*.csv etc.
How to make this possible in R ?
I tried like this list.files(dir=".", pattern="A_B*_C*.csv") but this gives
no output, whereas list.files(.... pattern="*.csv") giving all the .csv
files in
2006 Feb 24
2
Sorting a dataframe by one column?
Given the following dataframe:
A=1:10
B=(a-5)^2
DATAFRAME=data.frame(A,B)
How can I sort DATAFRAME increasing (or decreasing, for that matter)
by B without making reference to A, or any other column?
I've read ?order and ?sort but cannot seem to figure this out.
Thank you.
Mark