Displaying 20 results from an estimated 9000 matches similar to: "sort matrix by sum of columns"
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.
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 =
2010 Jan 15
2
processing all files with certain extension in a directory
Hi all,
I'm trying to process all files with a certain extension "*.ext" in a
directory like this:
> R --slave --args /my/dir < dir_plot.r
where I then I want to do something like:
myarg <- commandArgs()
inputdir <- myarg[length(myarg)]
print(inputdir)
"for file with extension "*.ext in inputdir"
do
data = process.data(file)
outfile =
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
2005 Jul 04
1
Rotate legends or other approaches to nice legend placement?
I'm sure this general sort of question has been asked many times before
- I would _like_ automatic and sensible legend placement in barplots so
data is not overwritten... but since there doesn't seem to be one, one
of the following would be useful:
One approach for this would be to place the legend to the right of the
graph, and rotate it by 90 degrees.
Is there a sensible way to do
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
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.
2003 Oct 04
3
a bug of function plot (PR#4405)
Full_Name: Ximing Zhao
Version: R 1.7.1
OS: MacOs X
Submission from: (NULL) (64.136.27.51)
When I used function plot in R 1.7.1, I found two bugs.
My whole function is this:
*****************
drawexp<-function(X,x,c,b){
exp<-function28(X,x,c,b)
if(max(exp)>=max(dexp(x,rate=1))){
plot(x,exp, type="l",main= paste("Exponential ,n=",length(X),"
1999 Dec 11
2
hist() with horiz=TRUE does not give horiz. plots (PR#372)
Full_Name: Fran Rizzardi
Version: 0.90.0
OS: Solaris, NT 4.0
Submission from: (NULL) (128.32.135.223)
If you use the horiz= option with hist() you get the message:
Warning:
parameter "horiz" couldn't be set in high-level plot() function.
and the plot comes out vertical. The documentation says this option comes from
barplot() and it does work correctly in barplot().
This
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]
2006 Jan 05
4
ylim problem in barplot
R Version 2.2.0
Platform: Windows
When I use barplot but select a ylim value greater than zero, the graph
is distorted. The bars extend below the bottom of the graph.
For instance the command produces a problematic graph.
barplot(c(200,300,250,350),ylim=c(150,400))
Any help would be appreciated.
Paul
[[alternative HTML version deleted]]
2010 Jan 12
1
barplot: border color when stacked
Dear R-users,
I am using R version 2.10.1 under windows.
In a barplot, I want to mark one of the bars with a special border color.
For example:
barplot(c(3, 7, 11), border = c(NA, "red", NA))
But how to do this when the bars are stacked?
for example:
barplot(matrix(1:6, ncol=3)) # border of second bar (i.e. the one with total height = 7) should be red again, I try:
barplot(matrix(1:6,
2006 Dec 01
3
Make many barplot into one plot
Dear all,
## I have 4 tables like this:
satu <- array(c(5,15,20,68,29,54,84,119), dim=c(2,4),
dimnames=list(c("Negative", "Positive"), c("Black",
"Brown", "Red", "Blond")))
dua <- array(c(50,105,30,8,29,25,84,9), dim=c(2,4),
dimnames=list(c("Negative", "Positive"),
2008 Jun 02
3
subject: horizontal text in barplot
I have a problem with the ylabs in barplot. When I draw the bars
horizontal the text for the y axis is not drawn horizontal too.
The text remains vertical. How can I change that. Thank's for your advice.
There is an example below.
##Example
plot.new()
jib <- data.frame(c(1:15),c(11:25),c(15:1),c(25:11))
colnames(jib) <-
2010 Dec 21
4
labels and barchart
Hello,
I'm wondering how to set a value of mar ( par( mar=c(.......)) ) in
order to allow labels to be visible in barplot. Is there any relation
between the number of characters in a label and the second value of
mar? Look at my example.
x <- seq(20, 100, by=15)
ety <- rep( "Effect on treatment group", times=length(x))
barplot(x, names.arg=ety, las=1, horiz=TRUE)
Labels are
2012 Sep 11
4
Maintaining specific order when using aggregate or change order on axis
Hi All,
I'm using the following code to produce some stacked bar graphs.
*setwd("C:\\Users\\Tinus\\Documents\\NMMU\\R\\Seamounts")*
*SChla <- read.csv("SM_Chla_data.csv")*
*
*
*#Extract mean values from data file*
*
*
*Coral <- SChla[185:223,] #Reduce SChla to Coral only*
*coral <- with(Coral , aggregate(cbind(Pico, Nano, Micro),
list(Depth),FUN=mean))*
2002 May 13
3
Histograms rotated, side-by-side
Hi there,
I am wanting to create 8 side-by-side histograms which have been rotated 90
degrees clockwise from how they usually sit.. all with the same scales. Is
someone able to help me out?
Thanks so much,
Rachel Cunliffe
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send
2006 Sep 28
3
complex plots using layout()
Dear r-help,
I am trying to plot several scatter plots with marginal histograms on
one page. Ideally, a page is equally divided into 4 figure regions.
Within each figure region, a scatter plot with marginal histograms will
be plotted.
I followed Dr. Paul Murrell's code released online to successfully plot
the scatter plot with marginal histograms. The code applies "layout()"
to