Displaying 20 results from an estimated 10000 matches similar to: "R: extract data.frames from a list"
2009 Mar 09
3
How to write a function that accepts unlimited number of input arguments?
Dear R-helpers:
I am an R newbie and have a question related to writing functions that
accept unlimited number of input arguments.
(I tried to peek into functions such as paste and cbind, but failed, I
cannot see their codes..)
Can someone kindly show me through a summation example?
Say, we have input scalar, 1 2 3 4 5
then the ideal function, say sum.test, can do
2009 Apr 16
3
segment between points on different plots
Hi,
I need to draw a line segment between two points on different plots in the
same multigraph.I've tried looking at the zoominplot function in plotrix but
havent understood much.any help is appreciated
~Aks
[[alternative HTML version deleted]]
2009 Jun 25
3
grid.polygon() + color gradient
Hi,
I wonder whether there is a way to generate a polygon (a triangle in
my case) with color gradient using grid.polygon() in package grid?
I tried something like
library(grid)
grid.polygon(x=c(0, 0.5, 1), y=c(0.5, 1, 0.5), gp=gpar(col=NA,
fill=colorRampPalette(c("green", "lightgray"),
space="Lab")(200)))
But am only
2009 Sep 02
2
combining grid.text, expression and variables
Dear R-users,
I am trying to use the grid.text and expression functions to display
several character strings and plotmath text on a viewport. Some strings
can include a variable portion (PI.limits in the following example),
which I thought could be implemented by combining the bquote and the
expression functions. Unfortunately, my expressions do not seem to be
evaluated. I would greatly
2009 Jul 03
3
Variable names in lattice XY-plot
Hi,
how can I get a more descriptive text
instead of the variable names in my XY-lattice plot,
according to the table below?
Variable text
acet = "Acetylaspartate Thalamus"
chol = "Choline Thalamus"
acetp = "Acetylaspartate parieoc"
ino = "Inositole Thalamus"
I could not find a solution.
Please have a look at my syntax.
Thanks a lot,
2009 May 27
3
Axis label spanning multiple plots
Hello
I need to plot 3 graphs in a single column; the top two plots have the
same title, and I would like it to be written only once, centered
horizontally and spanning the two plots. Something like
t +------------+
| |
i | |
| |
t +------------+
l +------------+
| |
e | |
| |
1 +------------+
t
2009 Jul 21
1
legend title in qplot
Hi,
I've used the following command in qplot
qplot(a$V1,geom="histogram",binwidth=0.15,fill =
factor(a$V2),ylab="Frequency",xlab="Rate");
but the title in the legend shows up as factor(a$V2)...how can i change
this?
--
Rajesh.J
[[alternative HTML version deleted]]
2009 Jul 04
2
Shading the area between lines
Hi,
I have a graph with seven parallel horizontal lines. Is it possible to
shade the area between two adjacent lines?
Thank you in advance,
Hannu
2009 Jul 15
1
Averaging dataframes that are stored in a list
Dear R-helpers,
I have a list containing 5000 elements, each element is a dataframe
containing one ID column (identical over the 5000 dataframes) and 9 numeric
variables, e.g.
ID VAR1 VAR2 VAR3 ... VAR9
I would like to create a new dataframe containing the ID column and the mean
values of the 9 numeric variables. So, the structure of this new dataframe
would be identical to the structure of the
2009 Sep 02
1
get function to return object "name"?
Dear list,
I've written a function that plots subjects. Something like:
myplot <- function(subject) { plot(subject) }
Subjects are vectors, e.g. ...
s1 <- c(200,200,190,180)
... and plotting them works fine, e.g. ...
myplot(s1)
Now I want to have "s1" etc appear in the plot title, but I don't know
how to refer to this generically (the object "name"? I tried
2009 Sep 03
1
putting reference lines or grids into the background of a plot
Dear R-community,
using R.2.9.1, how do you put reference lines or grids into the _background_ of a plot?
For example:
barplot(3:1)
abline(h = seq(0.5, 2.5 ,0.5), col = "red", lty = "dashed")
-> The lines are before the bars (and the line parts going through the bars might be considered as "chart junk", I suppose).
Now, in this toy example I could just do the
2009 Sep 07
1
getting name from function?
Hi
I have the following function which should return the name of FUN:
myFUN <- function(FUN) {
return( THE_NAME_OF_FUN(FUN))
}
Is it possible? What do I have tio use here instead of THE_NAME_OF_FUN?
Thanks,
Rainer
--
Rainer M. Krug, Centre of Excellence for Invasion Biology, Stellenbosch
University, South Africa
[[alternative HTML version deleted]]
2009 Sep 16
1
expression
/Dear all,///
/I am very thankful, if you could tell what is the right way to write:
mtext(paste(expression("R"^2),round(marco2[1,i],digits=3)," N? of proteins:",marco3[i]),side=4,cex=.6)
in this case the output is:
"R"^2
I tried also in this way:
mtext(paste(expression(paste("R"^2)),round(marco2[1,i],digits=3)," N? of
2009 Aug 28
1
problem plotting with ggplot2
Dear R-Help subsribers,
upon running into a wonderful ggplot2 package by accident, I abruptly
encountered another problem. Almost every command run with ggplot2 results
in some sort of error. The one below is far the most common one. Kind people
from ggplot2 mailing list couldn't manage to solve the problem, so I'm
re-posting it here to try my luck. I will recommend myself for any tips
2009 Sep 04
3
How to print a variable with in double quotes
I want to print a variable with in double quotes.
For example
x = 10 ;
x ; #prints 10
"x" ; #prints x
\"x\" ; # Error: unexpected input in "\"
I want to the out put as '10' or "10"
Thank you
Sailu Yellaboina
2009 Feb 26
3
Modifying Names from (x,y] into x
Hi,
I have the following data that looks like this:
> names(dat)
[1] "(-2329,-2319]" "(-1399,-1389]" "(-669.4,-659.4]"
How can I modify those names into just this?
[1] -2329 -1399 -669.4
- Gundala Viswanath
Jakarta - Indonesia
2009 Sep 14
3
How to refer to the last a few rows?
Hi,
x=matrix(1:60,nr=6)
I can refer the last 2 rows by
x[5:6,]
If I don't know the total number of rows is 6, is there a way to refer
the last 2 rows?
Regards,
Peng
2009 Sep 07
1
xyplot {lattice} are different types possible for each panel?
Hello R Folks...
Using the example below, I¹d like two of the panels to be plotted with type
= ³p² but the third to be done with type = ³h². I can¹t use type = c(³p²,
³p², ³h²) because this syntax applies all given types to every panel. I
don¹t think I can use groups and distribute.type because these are intended
for different styles of plotting within a single panel. As you can see, I
tried
2008 Nov 12
1
R code to generate Sweave input ? Sweave squared ?
Dirk,
I came upon your message below in searching for a different Sweave topic.
Have you pursued this? I'm new to R (9 months). Recently have been doing
data analysis in R and have started pondering the same question, but don't
have any ideas yet. I did do something related to this in SAS, the main
purpose of which was to build a standardized file of statistical results to
be
2009 Sep 14
2
Which "apply" function to use?
Dear All,
I have a problem which *should* be pretty straightforward to resolve - but I can't work out how!
I have a list of 3 coefficient estimates for 4 different datasets:
Coefs<-list(c(1,0.6,0.5),c(0.98,0.65,0.4),c(1.05,0.55,0.45),c(0.99,0.50,0.47))
All I want to do is take the sum (or mean) of each coefficient across the 4 datasets.
I can do this using a "for" loop, but