Lisa -
I think this is what you're looking for:
myfunction = function(...)do.call(cbind,list(...))
- Phil Spector
Statistical Computing Facility
Department of Statistics
Thanks Baptiste,
I think you nailed it.
baptiste auguie wrote:
Hi,
I think the size mismatch occurs because of a different default for
the fontsize (and grid.points has a size of 1 character by default).
Compare the following two examples,
# default
grid.newpage()
pushViewport(viewport(x=unit
Hello
I need to fit a distribution to a histogram data set. I have read
Ricci's guide to distribution fitting, and am ready to begin
experimenting with the techniques it mentions, but I am uncertain how to
get my data in the format he uses.
My problem is that my data is binned. So for
Michael, thanks a lot, it works!
Now I have to study the dataset to mining some interesting rules.
Just one more question, I saw ways to find rules that contains some itens.
But, Is there a method to find rules that doesn't have a item?
Thanks again! You were very helpfull!!!
2009/12/4 Michael
On Dec 4, 2009, at 2:04 PM, Bradley W. Settlemyer wrote:
Hello
I need to fit a distribution to a histogram data set. I have read
Ricci's guide to distribution fitting, and am ready to begin
experimenting with the techniques it mentions, but I am uncertain
how to get my data in the form
Exactly, that's waht I want. Thank you very much!
Lisa
Phil Spector wrote:
>
> Lisa -
> I think this is what you're looking for:
>
> myfunction = function(...)do.call(cbind,list(...))
>
>
> - Phil Spector
>St
This is historical and compatibility. The story as I heard it is that on the
computer where the original S language was developed had a key that produced a
left pointing arrow and that was used as the assignment operator (later <- was
added as an alternative for other computer systems). When k
The boxplot function has an 'at' argument that you can use to specify where to
plot the boxes, could you just use this to group the boxplots?
Or the lattice package can put each group into its own panel to show the
grouping.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Ce
On Fri, Dec 4, 2009 at 11:54 AM, Duncan Murdoch wrote:
> On 04/12/2009 12:52 PM, Peng Yu wrote:
>>
>> The external grep program has an option -v to select non-matching
>> lines. I'm wondering if how to exclude certain patterns in grep() in
>> R?
>>
>
> ?grep
I don't see which argument to use.
__
I just upgraded from 2.8.1 to 2.10 on Windows Vista. BIG MISTAKE
apparently because now when I type:
> help(functionname)
or
?functionname
I get only a small text window giving some very basic info on the topic, e.g.:
base-package package:baseR Documentation
The
Gerrit Draisma wrote:
>
> Hallo,
> I have a dataset with one or two columns with character data
> and the rest with numeric data.
> Using latex.table from the quantreg package produced a table,
> but I cannot set the decimals.
> For instance:
> ---
> > x<-data.frame(Name=c("Jan","Piet","Jan"),
What ways are there to plot categorical vs numerical data in R.
I have two columns: one with categorical data in 5 categories a,b,c,d,e, and
a numerical column with integers between 1 and 100.
I have used a boxplot with a,b,c,d,e on the x-axis and an increasing
numerical scale on the y-axis. T
use !grepl
On Fri, Dec 4, 2009 at 2:43 PM, Peng Yu wrote:
> On Fri, Dec 4, 2009 at 11:54 AM, Duncan Murdoch
> wrote:
> > On 04/12/2009 12:52 PM, Peng Yu wrote:
> >>
> >> The external grep program has an option -v to select non-matching
> >> lines. I'm wondering if how to exclude certain pattern
I want to duplicate each line in 'df' 3 times. But I'm confused why
'z' is a 6 by 4 matrix. Could somebody let me know what the correct
way is to duplicate each row of a data.frame?
df=expand.grid(x1=c('a','b'),x2=c('u','v'))
n=3
z=apply(df,1
,function(x){
result=do.call(rbind,rep(list(x
df[rep(1:nrow(df),each=3),]
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
I *think* this is from from 'StatsRUs' - how about
as.data.frame(lapply(df,function(x)rep(x,n)))
hth, david freedman
pengyu.ut wrote:
>
> I want to duplicate each line in 'df' 3 times. But I'm confused why
> 'z' is a 6 by 4 matrix. Could somebody let me know what the correct
> way is to dupli
The invert argument seems a likely candidate, you could also do perl=TRUE and
use negations within the pattern (but that is probably overkill for your
original question).
Could you explain to us the process that you use to search for answers to your
questions before posting? You have been ask
Phil Spector's solution is the best way to get your
triplicating job done.
As for why the result of your apply call is a 6 by
4 matrix, read the help file for apply where it talks
about how it 'simplifies' the result. For FUN's that
do not return a scalar the simplification algorithm
may be surpr
?help (see argument help_type)
?options
This has been asked before. My understanding is that there was a licensing
issue with Microsoft's compiled html help; so what you need to do is specify
options(help_type = "html")
in your startup process. There are a variety of ways to do so, explained
One problem I've been having is the special case in which only one
row/column remains and the variable gets converted into a vector when
entries are removed by logical masking. This is a problem because subsequent
code may rely on matrix operations (apply, colsums, dim, etc) For example:
> a <- ma
On Dec 4, 2009, at 3:52 PM, Austin Huang wrote:
One problem I've been having is the special case in which only one
row/column remains and the variable gets converted into a vector when
entries are removed by logical masking. This is a problem because
subsequent
code may rely on matrix operati
> One problem I've been having is the special case in which only one
> row/column remains and the variable gets converted into a vector when
> entries are removed by logical masking. This is a problem because
> subsequent
> code may rely on matrix operations (apply, colsums, dim, etc) For example:
b <- a[rmask,,drop=FALSE]
- Phil Spector
Statistical Computing Facility
Department of Statistics
UC Berkeley
Check out `drop'
?drop
a <- matrix(c(1, 2, 3, 4), nrow = 2)
rmask <- c(TRUE, FALSE)
b <- a[rmask, , drop=FALSE]
colSums(b)
This will maintain the matrix structure.
Ravi.
---
Ravi Varadhan, Ph.D.
Assistant Pro
Hi Austin,
What version of R are you using? It works for me for R 2.10.0 Patched on Win
XP Pro:
R> a <- matrix(c(1, 2, 3, 4), nrow = 2)
R> a
# [1] 1 3
# [2] 2 4
R> rmask <- c(TRUE, FALSE)
R> a[rmask,]
# [1] 1 3
HTH,
Jorge
On Fri, Dec 4, 2009 at 3:52 PM, Austin Huang <> wrote:
> One problem I'
On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
> The invert argument seems a likely candidate, you could also do perl=TRUE and
> use negations within the pattern (but that is probably overkill for your
> original question).
I don't see 'invert' in the R version (2.7.1) that I use. Here is the
On Dec 4, 2009, at 4:03 PM, Jorge Ivan Velez wrote:
Hi Austin,
What version of R are you using? It works for me for R 2.10.0
Patched on Win
XP Pro:
R> a <- matrix(c(1, 2, 3, 4), nrow = 2)
R> a
# [1] 1 3
# [2] 2 4
R> rmask <- c(TRUE, FALSE)
R> a[rmask,]
# [1] 1 3
Doesn't work on a Mac (ad
On Fri, Dec 4, 2009 at 3:06 PM, Peng Yu wrote:
> On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
>> The invert argument seems a likely candidate, you could also do perl=TRUE
>> and use negations within the pattern (but that is probably overkill for your
>> original question).
>
> I don't see '
Hi,
when I create huge pdf files (width is 6meters) with R I cannot open
them in Adobe Acrobat reader (I tried version 9 and some lower). I use
pdf() of grDevices version 2.8.1 and CairoPDF from Cairo version
1.4-4. When I add the (perhaps since pdf version 1.7 pagesizes of more
than 200in are poss
At long last pgfSweave has finally made its way to CRAN.
The pgfSweave package is about speed and style of graphics. For speed,
the package provides capabilities for “caching” graphics generated
with Sweave on top of the caching funcitonality of cacheSweave. For
style the pgfSweave package facilit
Hello everyone,
I'm having a problem performing reshape() on a large data frame. The
operation is fairly trivial but it makes R run out of memory.
The data frame has the following structure:
ID DATE1 DATE2VALTYPE
VALUE
'abcd1233' 2009-11-12
On Fri, Dec 4, 2009 at 12:18 PM, Charles C. Berry wrote:
> On Fri, 4 Dec 2009, Peng Yu wrote:
>
>> On Tue, Dec 1, 2009 at 4:04 PM, Charles C. Berry
>> wrote:
>>>
>>> On Tue, 1 Dec 2009, Peng Yu wrote:
>>>
Could somebody recommend some textbook how to compute contrast when
there are inte
What does a status value of -3 mean when I do a regression with RF and use the
getTree function?
left daughter right daughter split var split point status prediction
12 311 4.721000e+03 -3 15.8489576
24 5 5 6.500
On 2009.12.03 23:52:15, Yoseph Zuback wrote:
> Hi Frank,
>
> I'm trying to repair heteroscedastic variables using the hccm. A
> statistician in my department gave an incomplete solution that included:
>
>
> OLS1$coefficients/(sqrt(hccm(OLS1)))
>
> Trying to solve my problem I get different resu
Jorge,
It really helps. I appreciate your help a lot!
Chen
On Fri, Dec 4, 2009 at 12:04 AM, Jorge Ivan Velez [via R] <
ml-node+948281-1243760...@n4.nabble.com
> wrote:
> Try this:
>
> a <- c(9,3,5)
> b<-c(3,4,1)
> cbind(a, b)
> # a b
> # [1,] 9 3
> # [2,] 3 4
> # [3,] 5 1
>
> cov(cbind(a,
Thanks a lot, Jorge. It works well!
On Fri, Dec 4, 2009 at 12:00 AM, Jorge Ivan Velez [via R] <
ml-node+948277-873392...@n4.nabble.com
> wrote:
> Hi aegea,
>
> Here is one:
>
> m <- structure(c(6, 5, 20, 7, 8, 25, 14, 8, 9, 10, 11, 12, 13, 14,
> 1, 2, 3, 4, 5, 6, 7), .Dim = c(7L, 3L))
>
> m1 <-
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Hi all,
I fit a Tobit model to Fluid milk consumption (dependent variable) data
using survreg. 1) The square root of the dependent variable was used to
correct for
heteroscedasticity since it provides the best fit. 2) The output before
transformation of numeric variables in scores (by "Make.Z")
Hello,
I am not too sure if anyone tried this out. but I ma fitting a mixture model
via the EM algorithmn.
But then I tried using CAMAN package and I seem to get different results.
Has anyone else had this problem? For example, I am fitting the Inness data
from the text Medical Applications of Fini
Thanks Greg for your suggestion!
On Thu, Dec 3, 2009 at 11:50 AM, Greg Snow wrote:
> A bar graph including both stacked and grouped bars will put lots of pretty
> colors on the page and probably be eyecatching, but is unlikely to be the
> most effective way to convey the actual meaning of the da
Hi All,
I'm trying par(mfrow(c(1,2))) with barchart(), but its not working. Can I
display two or more barcharts on a same page using some other function? I'm
using following code --- where barchart() part is taken from help manual.
library(lattice)
par(mfrow=c(1,2))
barchart(yield ~ variety | sit
I installed RF on Linux OpenSuSe 11.1 and while it did install and did run a
model I had created on Windows correctly, it gave me a lot of "uninitialized"
warnings. I don't know if these are significant and so am a little concerned
even though my model ran. Any thoughts?
Thanks
R version 2
Colleagues,
R 2.9.0 on all platforms
I have a dataset that contains three columns of interest: ID's, serial
elapsed times, and a marker. Representative data:
Subject TimeMarker
1 100.5 0
1 101 0
1
Dear Dr. Winsemius,
Thank you very much for your reply.
I have tried many possible combinations (even with the model of only 2
predictors) but it produces the same message. With more than 4000
observations, I think 14 predictors might not be too many.
Although my dependent variable (Pin) is
On Dec 4, 2009, at 5:49 PM, Hien Nguyen wrote:
Dear Dr. Winsemius,
Thank you very much for your reply.
I have tried many possible combinations (even with the model of only
2 predictors) but it produces the same message. With more than 4000
observations, I think 14 predictors might not be
Dennis Fisher wrote:
>
> Colleagues,
>
> R 2.9.0 on all platforms
>
> I have a dataset that contains three columns of interest: ID's, serial
> elapsed times, and a marker. Representative data:
> Subject TimeMarker
> 1 100.5 0
> 1
You could try using merge:
>
d<-data.frame(Subject=rep(11:13,each=3),Time=101:109,Marker=c(0,1,0,
0,0,0, 0,0,1))
> d
Subject Time Marker
1 11 101 0
2 11 102 1
3 11 103 0
4 12 104 0
5 12 105 0
6 12 106 0
Try this:
transform(DF, Time = ave(1:nrow(DF), Subject, FUN = function(ix)
if (any(Marker[ix] == 1)) Time - Time[Marker == 1] else Time))
On Fri, Dec 4, 2009 at 5:47 PM, Dennis Fisher wrote:
> Colleagues,
>
> R 2.9.0 on all platforms
>
> I have a dataset that contains three columns of int
On 04/12/2009 3:46 PM, Bert Gunter wrote:
?help (see argument help_type)
?options
This has been asked before. My understanding is that there was a licensing
issue with Microsoft's compiled html help; so what you need to do is specify
There was nothing new there: CHM is discouraged (or at
On Fri, 2009-12-04 at 15:18 -0600, Peng Yu wrote:
> On Fri, Dec 4, 2009 at 3:06 PM, Peng Yu wrote:
> > On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
> >> The invert argument seems a likely candidate, you could also do perl=TRUE
> >> and use negations within the pattern (but that is probably o
That should be:
transform(DF, Time = ave(1:nrow(DF), Subject, FUN = function(ix)
with(DF[ix,], if (any(Marker == 1)) Time - Time[Marker == 1] else Time)))
On Fri, Dec 4, 2009 at 6:36 PM, Gabor Grothendieck
wrote:
> Try this:
>
> transform(DF, Time = ave(1:nrow(DF), Subject, FUN = function(ix
Maybe, atleast for the most used functions, there should be a section
in the .Rd file
with name "for newbies"?
Kjetil
On Fri, Dec 4, 2009 at 6:18 PM, Peng Yu wrote:
> On Fri, Dec 4, 2009 at 3:06 PM, Peng Yu wrote:
>> On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
>>> The invert argument seem
Hello,
I've written a brush for R for the SyntaxHighlighter JavaScript
library. It allows you to display R code on a web page with the proper
syntax highlighting. It's available here:
http://demitri.com/code
Comments and suggestions for improvement are welcome!
Cheers,
Demitri
__
Dear R users,
i would like to have expression on my plot written in bold
italic font and use following:
text(0.01,70,expression(bolditalic(r^2==0.67)),pos= 4)
However, only the letter r appears bold and italic, but not
the whole expression. How should i change it?
Thank you for your help,
Alla.
_
I try it again and it works.
Thank you.
TTsai wrote:
>
> Hello,
>
> I have problem running WinBUGS from R.
> The following example works in WinBUGS but it does not work in R through
> package R2WinBUGS.
> Does anyone know what the problem is?
>
> x <- c(0.2, 1.1, 1, 2.2, 2.5, 2.9, 2.9, 3.6,
Hello Xin,
Take a look at the examples under ?print.trellis
Using your original example, you could use:
require(lattice)
p1=barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(abb
On Fri, 4 Dec 2009, Peng Yu wrote:
On Fri, Dec 4, 2009 at 12:18 PM, Charles C. Berry wrote:
On Fri, 4 Dec 2009, Peng Yu wrote:
On Tue, Dec 1, 2009 at 4:04 PM, Charles C. Berry
wrote:
On Tue, 1 Dec 2009, Peng Yu wrote:
Could somebody recommend some textbook how to compute contrast when
t
On Fri, 4 Dec 2009, Peng Yu wrote:
On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
The invert argument seems a likely candidate, you could also do perl=TRUE and
use negations within the pattern (but that is probably overkill for your
original question).
I don't see 'invert' in the R versi
Hi all,
I would like to combine elements of a vector:
vec <- c("astring", "b", "cstring", "d", "e")
> vec
[1] "astring" "b" "cstring" "d" "e"
such that for every element that contains "string" at the end, it is
combined with the next element, so that I get this:
> res
[1] "ast
On Fri, Dec 4, 2009 at 7:51 PM, Charles C. Berry wrote:
> On Fri, 4 Dec 2009, Peng Yu wrote:
>
>> On Fri, Dec 4, 2009 at 2:35 PM, Greg Snow wrote:
>>>
>>> The invert argument seems a likely candidate, you could also do perl=TRUE
>>> and use negations within the pattern (but that is probably overk
On Fri, 4 Dec 2009, David Winsemius wrote:
On Dec 4, 2009, at 5:49 PM, Hien Nguyen wrote:
Dear Dr. Winsemius,
Thank you very much for your reply.
I have tried many possible combinations (even with the model of only 2
predictors) but it produces the same message. With more than 4000
observ
On Dec 4, 2009, at 8:42 PM, Jill Hollenbach wrote:
Hi all,
I would like to combine elements of a vector:
vec <- c("astring", "b", "cstring", "d", "e")
vec
[1] "astring" "b" "cstring" "d" "e"
such that for every element that contains "string" at the end, it is
combined with th
Try this which assumes that comma does not appear in any of the strings.
You can substitute a different non-appearing character if a comma does
appear in any of the strings:
strsplit(gsub("string,", "string", paste(vec, collapse = ",")), ",")[[1]]
It first runs all the strings together into a sin
@ Francisco: Thanks, it worked.
@ All: I'm able to change the colors of legend using following code:
par.settings=simpleTheme(col=c(451,26,652)),
key=list(space="right", cex=.96,
text=list(c("A","B","C")),
rectangles=list(size=1.7, border="white", col = c(451,26,652)))
*Q. Using the foll
If your group sizes are not too large, I would use jittered stripcharts.
They're more informative than boxplots and much less subject to
misinterpretation. One warning, I'm not fond of the default pch=0.
-Peter Ehlers
DispersionMap wrote:
What ways are there to plot categorical vs numerical dat
On Dec 4, 2009, at 10:17 PM, Xin Ge wrote:
@ Francisco: Thanks, it worked.
@ All: I'm able to change the colors of legend using following code:
par.settings=simpleTheme(col=c(451,26,652)),
key=list(space="right", cex=.96,
text=list(c("A","B","C")),
rectangles=list(size=1.7, border="white"
Thanks David, it worked!
On Fri, Dec 4, 2009 at 10:36 PM, David Winsemius wrote:
>
> On Dec 4, 2009, at 10:17 PM, Xin Ge wrote:
>
> @ Francisco: Thanks, it worked.
>>
>>
>> @ All: I'm able to change the colors of legend using following code:
>>
>> par.settings=simpleTheme(col=c(451,26,652)),
>>
I am sure that you mentioned before that your are using 2.7.1, and possibly
even why, but with the number of posts to this list each day and the number of
different posters, I cannot keep track of what version everyone is using (well,
I probably could, but I am unwilling to put in the time/effor
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Peng Yu
> Sent: Friday, December 04, 2009 2:19 PM
> To: r-h...@stat.math.ethz.ch
> Subject: Re: [R] grep() exclude certain patterns?
>
[snip]
> Here is another bad example. Se
Hi,
If you can first convert the image to ppm format, the pixmap package
has an addlogo function that can do just what you want,
x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1])
plot(1:10,1:10)
addlogo(x, px=c(2, 4), py=c(6, 8), asp=1)
One could probably get inspiration from
Hi,
There is also the R package "highlight" [1,2] serving the same purpose
but based on information from the R parser, not a static list.
highlight can render in html, tex, and directly for the console (with
the help of the xterm256 package [3]).
Romain
[1] http://cran.r-project.org/web/pa
101 - 171 of 171 matches
Mail list logo