Displaying 20 results from an estimated 900 matches similar to: "processing all files with certain extension in a directory"
2006 Jun 21
3
sort matrix by sum of columns
Hi all,
I would like to know how can I sort the cols of a matrix by the sum of
their elements.
a <- matrix(as.integer(rnorm(25,4,2)),10,5)
colnames(a) = c("alfa","bravo","charlie","delta","echo")
I guess I should use colSums, and then rearrange the matrix somehow
according to the result.
My idea is to display a "sorted" barplot:
2006 Jun 09
2
barplot dataframes w/ varying dimensions
Hi all,
I would like to do a barplot of a dataframe like this one:
alfa beta gamma delta
qwert 56.5 58.5 56.5 58.5
asdfg 73.0 73.0 43.0 73.0
zxcvb 63.0 63.0 43.0 63.0
yuiop 63.0 63.0 43.0 63.0
with the labels of the rows and columns.
I would like to have something that works for dataframes with varying
dimensions, and so far I haven't found any way to do it.
2002 Dec 17
3
Changing "..." inside a function: impossible? desirable?
This is was something like a request for your comments, thoughts
on the topic...
Many of you will know that the "..." (aka \dots) argument is
very useful for passing ``further graphical parameters'',
but can be a pain when itself is passed to too many plotting
functions inside your own function.
An artificial example being
myplot <- function(x,y, ...) {
plot(0:1, 0:1,
2009 Jan 03
1
Equivalent of match for data.frame
Dear R-users,
I am translating a S script into R and having some troubles with the
match function. This function appears to work with vector and data.frame
in S, but not in R, e.g.:
a <- rep((1:4), each = 10)
b <- rep((1:10), times = 4)
mydf <- data.frame(a,b)
myarg <- mydf[1,]
match(myarg, mydf)
# S returns 1 but R returns NA NA
I guess one could use match(interaction(myarg),
2006 Apr 28
2
entries that match a regexp
Hi all,
I am trying to filter the element of a df that start with "TF", like
this:
alfa =
c(123221,"TF13124",41243,"TF1234",32414,"TF13124","TF14333",2134123,"TF1234")
beta =
2013 Jul 07
1
[LLVMdev] trying to compile llvm+clang on CentOS 5
I am trying to have llvm and clang on a centOS 5 without root permissions.
I tried to do it downloading llvm and clang src packages and trying the
ususal configure, make and make install steps as such:
wget http://llvm.org/releases/3.3/llvm-3.3.src.tar.gz
wget http://llvm.org/releases/3.3/cfe-3.3.src.tar.gz
tar xzf llvm-3.3.src.tar.gz && cd llvm-3.3.src/tools/ && tar xzf
2008 Feb 19
4
How to join path with arguments
Hi, all
How to format and join strings ?
For example, like following short python examples.
*********
name1 = 'sample-plot'
filename = '%s.png' % name1
inputdir = '/path/to/dir'
os.path.join(inputdir, filename)
**********
Best,
Hyunchul Kim
[[alternative HTML version deleted]]
2011 May 26
1
Is it possible to define a function's arguments via a wildcard in 'substitute()'?
Dear List,
just out of pure curiosity: is it possible to define a function via
'substitute()' such that the function's formal arguments are specified
by a "wildcard" that is substituted when the expression is evaluated?
Simple example:
x.args <- formals("data.frame")
x.body <- expression(
out <- myArg + 100,
return(out)
)
expr <-
2006 Nov 24
1
Missing values for S4 slots
Using R 2.4, the following fails:
setClass("testc", representation(a="ANY"))
makeC <- function(myarg) new("testc", a=myarg)
makeC()
-> Error in initialize(value, ...) : argument "myarg" is missing,
with no default
On the other hand, this is OK:
f <- function(a) g(b=a)
g <- function(b) if(missing(b)) "missing" else "valid
2004 Dec 03
2
[LLVMdev] [Fwd: Updated LLVM Visual Studio project files]
Could someone please apply this patch to the Win32 support so that
Morten and Jeff can handle the recent changes? I can't do it because
I"m on the road with only email access.
Thanks,
Reid.
-----Forwarded Message-----
> From: Morten Ofstad <morten at hue.no>
> To: Reid Spencer <reid at x10sys.com>
> Subject: Updated LLVM Visual Studio project files
> Date: Thu,
2005 Dec 13
8
superimpose density line over hist
Hi all,
I'm trying to superimpose a rchisq density line over a histogram with
something like:
hist(alnlength)
lines(density(rchisq(length(alnlength), 4)),col="red")
But the rchisq line won't appear anywhere,
Anyone knows what I am missing here?
Thanks in advance,
Albert.
2010 Apr 24
2
left-to-right series of box and whisker plots from a csv file
Hi,
I've got a csv file with scores like this:
40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,32,38,40,20,40,26,40,30,40,5,5,13,12,40,40,3,33,29,23,2,24,9,15,4,21,16,5,26,8,8,18
40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,32,40,40,30,40,40,37,34,40,36,13,40,13,40,5,40,8,29,5,15,34,5,22,14,20
2003 Mar 06
1
Proper way to document print( ) functions
Frequently we have a print method, say print.myclass, that has a variety of arguments. If in the .Rd file I say
\usage{
\method{print}{myclass}(x, myarg)
}
I get a warning when running R CMD chk:
* checking generic/method consistency ... WARNING
print:
function(x, ...)
print.myclass:
function(x, myarg)
What is the proper way to handle this?
Thanks
--
Frank E Harrell Jr
2008 Feb 28
1
calculate sd for each row on some columns of a dataframe
Hi,
I've got a dataframe like this:
df = data.frame(a=rnorm(100,1),b=rnorm(100,10),c=rnorm(100,100),d=rnorm(100,-100))
and I want to calculate sd1 for (a,b,c) for each entry, and sd2 for
(b,c,d) for each entry.
I don't seem to find the answer using aggregate or apply,
How can I do this?
Thanks in advance,
Cheers,
Albert.
2010 Jul 06
1
hide ends of line in a density plot
Hi,
(I googled for this answer but didn't find anything)
I am using density plot and I want to trim the ends of the line. eg:
i = rnorm(100,100,2)
j = subset(i,i<102 & i>98)
summary(j)
plot(density(j))
I only want the line to go from 98 to 102. How can I limit the line
(and the axis)
to the values I specify?
Cheers,
Albert.
2014 Apr 14
1
duplication regression (?)
Below is an example of output that changed as a result of r64970. I
did not see any NEWS item suggesting this change is expected.
Note that the example is contrived and I don't have a use case for it.
I stumbled across it when playing with recent changes in R relating to
duplication. Does the example use undefined syntax?
-----
fn1 <- function(mylist) {
fn1a <- function()
2009 Apr 17
1
matching subvectors in vector sets
Hi,
I've got a list of ~20000 elements that look like this:
[1]
"A00096:A00096:A00096:A00096:A02178:A02178:A07776"
[2]
"A00046:A00076:A01101:A04146:A05671:A07169"
[3]
"A00038:A00932:A02185:A02370:A02818:A02818:A02818:A02818:A04732:A07142:A07142"
[4]
"A00096:A01352:A01352:A02023:A05001:A05001:A07776"
[5]
2018 Jul 26
4
Problem with definition of slist in CFEngine
Hey folks,
I have a problem with the definition of a variable of type slist in
CFEngine on
# uname -a ; cat /etc/redhat-release
Linux policyhub.example.com 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22
21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
CentOS Linux release 7.4.1708 (Core)
I'm not sure if its valid to ask CFEngine questions on this mailing
list, but as far as I'm running on
2002 Jun 25
1
commandArgs: feature request
Dear R-core Team,
As Thomas Lumley pointed out in one of his e-mails one can use commandArgs()
to get a copy of the command line arguments supplied when R session was
invoked and then use grep to extract parameters of interest.
His solution works very well if the custom options are passed by names, e.g.
--my-option=value, but what if one wants to pass parameters by their
positions. Then it's
2004 Dec 03
0
[LLVMdev] [Fwd: Updated LLVM Visual Studio project files]
On Fri, 3 Dec 2004, Reid Spencer wrote:
> Could someone please apply this patch to the Win32 support so that
> Morten and Jeff can handle the recent changes? I can't do it because
> I"m on the road with only email access.
I'd be happy to do it. Can someone send me the patch as an attachment
off-list?
-Chris
> > <Tool
> >