Re: [R] [Ann] R brush for SyntaxHighlighter

2009-12-04 Thread Romain Francois
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

Re: [R] adding bmp/jpg/gif to an existing plot

2009-12-04 Thread baptiste auguie
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Greg Snow
> -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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Greg Snow
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

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
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)), >>

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread David Winsemius
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"

Re: [R] categorical vs numerical

2009-12-04 Thread P Ehlers
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

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
@ 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

Re: [R] paste adjacent elements matching string

2009-12-04 Thread Gabor Grothendieck
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

Re: [R] paste adjacent elements matching string

2009-12-04 Thread David Winsemius
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

Re: [R] Error when running Conditional Logit Model

2009-12-04 Thread Charles C. Berry
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Peng Yu
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

[R] paste adjacent elements matching string

2009-12-04 Thread Jill Hollenbach
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Charles C. Berry
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

Re: [R] How to compute contrast where there are interaction terms in the linear model?

2009-12-04 Thread Charles C. Berry
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

Re: [R] Help: barchart() {lattice}

2009-12-04 Thread Francisco J. Zagmutt
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

Re: [R] Help R2WinBUGS

2009-12-04 Thread TTsai
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,

[R] expression and font type of bold

2009-12-04 Thread Alla Bulashevska
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. _

[R] [Ann] R brush for SyntaxHighlighter

2009-12-04 Thread thatsanicehatyouhave
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 __

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Kjetil Halvorsen
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

Re: [R] Use of apply rather than a loop

2009-12-04 Thread Gabor Grothendieck
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Gavin Simpson
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

Re: [R] no html help upon upgrading to 2.10

2009-12-04 Thread Duncan Murdoch
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

Re: [R] Use of apply rather than a loop

2009-12-04 Thread Gabor Grothendieck
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

Re: [R] Use of apply rather than a loop

2009-12-04 Thread William Dunlap
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

Re: [R] Use of apply rather than a loop

2009-12-04 Thread Sharpie
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

Re: [R] Error when running Conditional Logit Model

2009-12-04 Thread David Winsemius
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

Re: [R] Error when running Conditional Logit Model

2009-12-04 Thread Hien Nguyen
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

[R] Use of apply rather than a loop

2009-12-04 Thread Dennis Fisher
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

[R] Installing RandomForest on SuSe Linux - warnings

2009-12-04 Thread NCS
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

[R] Help: barchart() {lattice}

2009-12-04 Thread Xin Ge
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

Re: [R] (Grouped + Stacked) Barplot

2009-12-04 Thread Xin Ge
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

Re: [R] EM Mixture Models

2009-12-04 Thread Jim Silverton
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

[R] Tobit model fluid milk consumption

2009-12-04 Thread mrsilva
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")

[R] tobit model fluid milk consumption

2009-12-04 Thread mrsilva
__ 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.

Re: [R] how to calculate covariance matrix in R? why cov doesn't work

2009-12-04 Thread aegea
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,

Re: [R] how to seperate a matrix

2009-12-04 Thread aegea
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 <-

Re: [R] Incorporating the results of White's HCCM into a linear regression:

2009-12-04 Thread Jason Morgan
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

[R] RandomForest - getTree status code

2009-12-04 Thread NCS
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

Re: [R] How to compute contrast where there are interaction terms in the linear model?

2009-12-04 Thread Peng Yu
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

[R] simple reshape of a large data frame (reshape() runs out of memory)

2009-12-04 Thread Alexander Belikoff
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

[R] [R-pkgs] New Package: pgfSweave

2009-12-04 Thread Cameron Bracken
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

[R] pdf pagesize

2009-12-04 Thread Thomas Steiner
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Peng Yu
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 '

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread David Winsemius
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Peng Yu
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

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread Jorge Ivan Velez
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'

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread Ravi Varadhan
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

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread Phil Spector
b <- a[rmask,,drop=FALSE] - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread Erik Iverson
> 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:

Re: [R] logical masking of a matrix converts it to a vector

2009-12-04 Thread David Winsemius
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

[R] logical masking of a matrix converts it to a vector

2009-12-04 Thread Austin Huang
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

Re: [R] no html help upon upgrading to 2.10

2009-12-04 Thread Bert Gunter
?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

Re: [R] How to duplicate each row in a data.frame?

2009-12-04 Thread William Dunlap
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Greg Snow
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

Re: [R] How to duplicate each row in a data.frame?

2009-12-04 Thread David Freedman
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

Re: [R] How to duplicate each row in a data.frame?

2009-12-04 Thread Phil Spector
df[rep(1:nrow(df),each=3),] - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

[R] How to duplicate each row in a data.frame?

2009-12-04 Thread Peng Yu
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread jim holtman
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

[R] categorical vs numerical

2009-12-04 Thread DispersionMap
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

Re: [R] latex.table for table with character and numeric columns

2009-12-04 Thread Sharpie
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"),

[R] no html help upon upgrading to 2.10

2009-12-04 Thread Jim Bouldin
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

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Peng Yu
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. __

Re: [R] Multiple grouping on the X axis.

2009-12-04 Thread Greg Snow
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

Re: [R] Naming conventions for R?

2009-12-04 Thread Greg Snow
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

Re: [R] User's function

2009-12-04 Thread Lisa
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

Re: [R] Distribution fitting with binned data

2009-12-04 Thread David Winsemius
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

Re: [R] Arules - Association Rules

2009-12-04 Thread Alexandre Shimada
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

[R] Distribution fitting with binned data

2009-12-04 Thread Bradley W. Settlemyer
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

Re: [R] Apparent different in symbol scaling between xyplot and grid.points

2009-12-04 Thread Sebastien Bihorel
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

Re: [R] User's function

2009-12-04 Thread Phil Spector
Lisa - I think this is what you're looking for: myfunction = function(...)do.call(cbind,list(...)) - Phil Spector Statistical Computing Facility Department of Statistics

[R] options(width=100) ignored on start-up

2009-12-04 Thread Liviu Andronic
Dear all Is it normal that R ignores options("width"=100) at start-up? Although li...@debian-liv:~$ cat /usr/lib/R/etc/Rprofile.site | grep width options(width = 100) , R will start with [Previously saved workspace restored] > options()$width [1] 80 Am I doing something wrong? Liviu > sessionI

Re: [R] User's function

2009-12-04 Thread Lisa
Thank you for your reply. But this is not what I want. For example, I have several variables, like arg1 <- c(1, 2, 3, 5, 6, 6) arg2 <- c(3, 1, 5, 5, 7, 8) arg3 <- c(8, 10, 4, 0, 9, 1) arg4 <- c(11, 22, 30, 5, 61, 22) … I just want to bind some of these variables based on the arguments assigned

Re: [R] Standard deviation for each element in a set of matrices

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 1:27 PM, Gray Calhoun wrote: Hi Muhammad, Load the data from all of the files into an array (probably using a for loop), then call apply on the resulting array: ie I like that idea a lot and it does not need an explicit loop: apply( array(c(File1, File2, File3), dim=c(3,3

Re: [R] Standard deviation for each element in a set of matrices

2009-12-04 Thread Gray Calhoun
Hi Muhammad, Load the data from all of the files into an array (probably using a for loop), then call apply on the resulting array: ie ## replace the first line with code to load your data > rr <- array(c(rep(1:3,3), rep(4:6,3), rep(7:9,3)), c(3,3,3)) > apply(rr, c(1,2), sd) [,1] [,2] [,3]

Re: [R] curve fitting to data

2009-12-04 Thread Peter Ehlers
Pascale, If you do want an nls fit with the associated error structure assumptions, check ?SSlogis. fm <- nls(y ~ SSlogis(x, Asy, xmid, scal)) summary(fm) xx <- seq(123, 248, length = 101) yy <- predict(fm, list(x = xx)) plot(x, y) lines(xx, yy) -Peter Ehlers Gabor Grothendieck wrote:

[R] Network Graph Add Labels

2009-12-04 Thread Brock Tibert
Hi Everyone, I am new to R and just trying my hand at plotting a network from my dataset. I am trying to teach myself network analysis, so this is probably an easy question. Using the package network, I have successfully plotted my network. I simply want to add labels to my vertices, with th

Re: [R] Standard deviation for each element in a set of matrices

2009-12-04 Thread Phil Spector
Muhammad - Here's one way: files = c('File1','File2','File3') themats = lapply(files,read.table) ans = matrix(0,3,3) for(i in 1:3)for(j in 1:3)ans[i,j] = sd(sapply(themats,function(x)x[i,j])) Here's another files = c('File1','File2','File3') themats = lapply(files,read.table) ans = outer

Re: [R] How to compute contrast where there are interaction terms in the linear model?

2009-12-04 Thread Charles C. Berry
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 interactions terms? "Applied Linear Regression Models" (book) mentioned contrast, but I

Re: [R] shorten str() output for long list

2009-12-04 Thread Greg Snow
An alternative to str is the TkListView function in the TeachingDemos package. You still get the long listing, but it is in a separate window that you can control the scrolling on by hand. For more complicated lists/objects it provides a tree structure so that you can look at only the detailed

Re: [R] User's function

2009-12-04 Thread baptiste auguie
Hi, try ?do.call do.call(cbind, replicate(3, 1:10, simplify=FALSE)) HTH, baptiste 2009/12/4 Lisa : > > Hello, All, > > I want to write a function to do some works based on the arguments. For > example, bind some variables (arguments) as this: > > myfunction <- function(arg1, arg2, arg3, …) > {

Re: [R] Can we get rid of bar charts with error bars?

2009-12-04 Thread Greg Snow
This reminds me of a quote I saw once (I think it may have been in one of those Murphy's Laws calendars), my parahpase: If you make someone think that they are thinking, They will love you for it. If you make them actually think, They will hate you for it. This explains why peopl

[R] User's function

2009-12-04 Thread Lisa
Hello, All, I want to write a function to do some works based on the arguments. For example, bind some variables (arguments) as this: myfunction <- function(arg1, arg2, arg3, …) { x <- cbind(arg1, arg2, arg3, …) } myfunction(arg1, arg2, arg3, …) The function can automatically determine t

[R] Standard deviation for each element in a set of matrices

2009-12-04 Thread Muhammad Rahiz
Hello R-users, I would like to know how to find the standard deviation for each element in a set of matrices. Given the following files, File1File2File3 1 1 1 4 4 4 7 7 7 2 2 2 5 5 5 8 8 8 3 3 3 6 6 6 9 9 9 I want to calculate the standard deviation for every

Re: [R] grep() exclude certain patterns?

2009-12-04 Thread Duncan Murdoch
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 Duncan Murdoch __ R-help@r-project.org mailing list https://sta

[R] grep() exclude certain patterns?

2009-12-04 Thread Peng Yu
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? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h

Re: [R] Class attributes

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 11:55 AM, Allen L wrote: Dear R forum, I want to replace all the elements in a data frame (dd) which match the character "x" with "0". What's the most elegant way of doing this (there must be an easy way which I've missed)? I settled on the following loop: for(i in 5:

Re: [R] Class attributes

2009-12-04 Thread jim holtman
Here a way of doing it: for (i in 5:12){ # convert to character so you can substitute 'x' a <- as.character(dd[,i]) a[a == 'x'] <- '0' replace with zero dd[,i] <- as.numeric(a) } On Fri, Dec 4, 2009 at 11:55 AM, Allen L wrote: > > Dear R forum, > I want to replace all the eleme

Re: [R] How to compute contrast where there are interaction terms in the linear model?

2009-12-04 Thread Peng Yu
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 interactions terms? "Applied Linear Regression Models" >> (book) mentioned contrast, but I cannot extend it to the case

[R] Class attributes

2009-12-04 Thread Allen L
Dear R forum, I want to replace all the elements in a data frame (dd) which match the character "x" with "0". What's the most elegant way of doing this (there must be an easy way which I've missed)? I settled on the following loop: >for(i in 5:12){# These are the column of dd I am

Re: [R] Apparent different in symbol scaling between xyplot and grid.points

2009-12-04 Thread baptiste auguie
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(0.5, "npc"), y=unit(0.5, "npc"))) lplot.xy(data.frame(x=0.55,y=0.5

Re: [R] Question about R Functions

2009-12-04 Thread Uwe Ligges
Stephanie Cooke wrote: Is there a place to find the code for R functions like lsoda? Thanks Yes, all code is in the source version of the package that contains that function. Best, Uwe Ligges __ R-help@r-project.org mailing list https://stat

Re: [R] Three-dimensional (3D) movement using 'R'

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 7:07 AM, StRose, Suzanne wrote: Hi again, Apologies for the last email I forwarded. Apparently, my data was not legible. So, I have a question regarding the construction of 3D graphs in ‘R’, BUT these graphs also need to illustrate movement (with time) of the prostate

[R] Renaming columns of a data.frame

2009-12-04 Thread Kevin Wright
A question that has come up a few times on r-help is how to rename columns of a data.frame. There are several ways to do this by hand (see the list archives). There is also a 'rename' function in the reshape package. I often use the 'transform' function shortly after reading in a data file and w

[R] Machine Learning and Sample Size

2009-12-04 Thread Richard Liu
In developing a machine learner to classify sentences in plain text sources of scientific documents I have been using the caret package and following the procedures described in the vignettes. What I miss in the package -- but quite possibly I am overlooking it! -- is functions t

Re: [R] R and eclipse

2009-12-04 Thread karina lopez
Sorry, but i was out for two days! I just want to call R scripts from java code. So i think i need to review the jri and the REngine API. I will tell you whatever i find. Thank you so much, because i was really lost! 2009/12/4 Romain Francois > On 12/03/2009 08:43 PM, Gene Leynes wrote: > >> >>

Re: [R] Logistic geographical weighted regression

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 6:55 AM, Pazur, Robert wrote: Dear all, is it possible to perform logstic type of geographical weighted regression in R software? We even have a fortune for such questions: > library(fortunes) > fortune("Yoda") Evelyn Hall: I would like to know how (if) I can extract some

[R] Apparent different in symbol scaling between xyplot and grid.points

2009-12-04 Thread Sebastien Bihorel
Dear R-users, For the past few days, I have been trying to find the reason why some of my plots were showing symbols of different sizes, while I thought I was using the same .cex arguments everywhere. The problem is exemplified by the following example code where the xyplot and grid.points fun

Re: [R] Dividing a pixel image into factors - (cut.im(), cut.default())

2009-12-04 Thread Glen Sargeant
Lauren, I think (?) you mean to say that you wish to create a factor and control the range of values assigned to each level. The "breaks" argument can specify either the number of intervals you desire OR the values you wish to use to define levels of your factor. See '?cut' and the following ex

Re: [R] question about invers gamma trancted

2009-12-04 Thread David Winsemius
On Dec 4, 2009, at 9:02 AM, khaz...@ceremade.dauphine.fr wrote: Hi I want to generate from invers gamma distribution truncated but when I use the rinvegamma() function, the system can not find this function. Is ther someone to help me please? Check your spledding. thanks soleiman __

  1   2   >