Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
yes, this works, thank yo. very smart solution! -R > Date: Sat, 19 Jul 2008 19:55:58 -0400 > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: Re: [R] replicate matrix blocks different numbers of times into new > matrix > CC: r-help@r-project.org

Re: [R] smooth.spline

2008-07-19 Thread hadley wickham
On Fri, Jul 18, 2008 at 10:15 PM, Roland Rau <[EMAIL PROTECTED]> wrote: > Spencer Graves wrote: >> >> I found the first chapter of Paul Dierckx (1993) Curve and Surface Fitting >> with Splines (Oxford U. Pr.). Beyond that, I've learned a lot from the >> 'fda' package and the two companion volumes

Re: [R] smooth.spline

2008-07-19 Thread rkevinburton
Fair enough. FOr a spline interpolation I can do the following: > n <- 9 > x <- 1:n > y <- rnorm(n) > plot(x, y, main = paste("spline[fun](.) through", n, "points")) > lines(spline(x, y)) Then look at the coefficients generated as: > f <- splinefun(x, y) > ls(envir = environment(f)) [1] "ties" "

Re: [R] Non-linearly constrained optimisation

2008-07-19 Thread Gabor Grothendieck
The Ryacas package is an interface between R and the computer algebra system, yacas. It includes an R to yacas parser/translator and an OpenMath/XML to R parser/translator. See: http://ryacas.googlecode.com On Sat, Jul 19, 2008 at 11:03 PM, Stuart Nettleton <[EMAIL PROTECTED]> wrote: > Tolga, > Y

Re: [R] Non-linearly constrained optimisation

2008-07-19 Thread Stuart Nettleton
Tolga, Your issue seems to be a common one at present. While I am relatively new to R (and would welcome being corrected), I haven't been able to find an existing module to parse algebraic equations and build acyclic networks (for the objective function and each constraint) to submit to solv

Re: [R] Discretize continous variables....

2008-07-19 Thread Frank E Harrell Jr
milicic.marko wrote: Frank/Danial, Thank you for very good discussion on this. The reason I'm doing this is because is it common industrial practice to group continous varible (say age) in couple of buckets while developming scorecards to be used by business people. I don't see the reason why I

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-19 Thread Senthil Purushothaman
Hi Jim, Thank you for the response. Your suggestion will help me avoid the whole text to number conversion process that I perform using LookUp in excel. I will definitely give it a shot. But it still doesn't address the vector conversion since a graph file is drawn only using the vectors. As

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread jim holtman
Will this do it: > # determine the row numbers of each of the factors > x.row <- split(seq(nrow(x)), x[,1]) > # process the data and replicate the rows > result <- lapply(seq_along(x.row), function(.fact){ + x[rep(x.row[[.fact]], n[.fact]),] + }) > do.call(rbind, result) [,1] [,2] [1,]

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
Actually not quite - my mistake, since I oversimplified the problem I have. Here is a more realistic x matrix (plus some additional information): # the data x<-matrix(c(1,1,2,1,3,4),3,2) # number of factors n_f<-2 # number of rows taken by each factor f_length <- c(2,1) # number of repetition

Re: [R] Discretize continous variables....

2008-07-19 Thread Frank E Harrell Jr
Johannes Huesing wrote: Frank E Harrell Jr <[EMAIL PROTECTED]> [Sat, Jul 19, 2008 at 08:03:01PM CEST]: But even then why condition on incomplete information when complete information is available? I.e., why compute Pr(Y=1 | X>x) in place of Pr(Y=1 | X=x)? Because regulatory bodies demand i

Re: [R] Discretize continous variables....

2008-07-19 Thread Johannes Huesing
Frank E Harrell Jr <[EMAIL PROTECTED]> [Sat, Jul 19, 2008 at 08:03:01PM CEST]: > But even then > why condition on incomplete information when complete information is > available? I.e., why compute Pr(Y=1 | X>x) in place of Pr(Y=1 | X=x)? Because regulatory bodies demand it? Being employed in

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-19 Thread jim holtman
Given that you have the data, exactly what are you expecting the charts to look like? You mention vectors, but are you trying to create a directed graph? It would be useful to show a small subset of the data and then how you would expect to process it and what type of graphs you would like to see

[R] Non-linearly constrained optimisation

2008-07-19 Thread tolga . i . uzuner
Dear R Users, I am looking for some guidance on setting up an optimisation in R with non-linear constraints. Here is my simple problem: - I have a function h(inputs) whose value I would like to maximise - the 'inputs' are subject to lower and upper bounds - however, I have some further constraints

Re: [R] Discretize continous variables....

2008-07-19 Thread milicic.marko
Frank/Danial, Thank you for very good discussion on this. The reason I'm doing this is because is it common industrial practice to group continous varible (say age) in couple of buckets while developming scorecards to be used by business people. I don't see the reason why I shouldn't discretize v

Re: [R] Likelihood ratio test between glm and glmer fits

2008-07-19 Thread Göran Broström
This particular case with a random intercept model can be handled by glmmML, by bootstrapping the p-value. Best, Göran On Thu, Jul 17, 2008 at 1:29 PM, Douglas Bates <[EMAIL PROTECTED]> wrote: > On Thu, Jul 17, 2008 at 2:50 AM, Rune Haubo <[EMAIL PROTECTED]> wrote: >> 2008/7/16 Dimitris Rizopoulo

[R] estimating volume from xyz points

2008-07-19 Thread milton ruser
Dear all, I have several sets of x-y-z points and I need to estimate the volume that encompass all my points. Recently I got some adivice to show the "convex hull" of my points using geometry package (see code below). But now I need to calculate the volume of my set of points. Any advice are wellc

Re: [R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread hpdutra
Hi Milton, I tried this and it worked. But the block structure isn't right because when I try to plot this I still get an error message traps<-groupedData(mice~tree|plotID,outer=~time*fruit*veget|block,data=trap) > plot(traps,outer=T) I guess my question is should I try to fit a more simple group

Re: [R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread milton ruser
Hi (sorry, I don´t got your name) May be this help you. trap$time<-factor(trap$time) trap$block<-factor(trap$block) All the best, miltinho astronauta brazil On 7/19/08, hpdutra <[EMAIL PROTECTED]> wrote: > > > Hi everyone. I am trying to add a formula to my data using the > groupedData >

[R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread hpdutra
Hi everyone. I am trying to add a formula to my data using the groupedData function. My experiment consists of randomized block design using fruits, vegetation and time as factors. The idea is to see if fruits, vegetation and time explain the abundance of mice. I am using tree density as a covar

Re: [R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Peter Dalgaard
Ralph S. wrote: Hi, I am trying to replicate blocks of a matrix (defined by factors) into another matrix, but an unequal, consecutive number of times for each factor. I need to find an elegant and fast way to do this, so loops will not work. An example of what I am trying to do is the follow

Re: [R] Sweave add code \201

2008-07-19 Thread Peter Dalgaard
Christophe Genolini wrote: Hi the list, I do not understand what change in my configuration, but Sweave add the code \201 before each special characters é è à ç ... Does someone know when it come from ? MULE (multilingal environment) in Emacs used to be prone to do this, but I haven't seen

[R] replicate matrix blocks different numbers of times into new matrix

2008-07-19 Thread Ralph S.
Hi, I am trying to replicate blocks of a matrix (defined by factors) into another matrix, but an unequal, consecutive number of times for each factor. I need to find an elegant and fast way to do this, so loops will not work. An example of what I am trying to do is the following: # the data

[R] Sweave add code \201

2008-07-19 Thread Christophe Genolini
Hi the list, I do not understand what change in my configuration, but Sweave add the code \201 before each special characters é è à ç ... Does someone know when it come from ? Thanks Christophe __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Discretize continous variables....

2008-07-19 Thread Frank E Harrell Jr
Daniel Malter wrote: True. Thanks for the clarification. Is your conclusion from that that the findings in such case should only be interpreted in the specific context (with the awareness that it does not apply to changing contexts) or that such an approach should not be taken at all? The latte

Re: [R] Title for graph with multiple plots

2008-07-19 Thread Tolga Uzuner
Dear Ted and Jim, Many thanks. Tolga (Ted Harding) wrote: On 19-Jul-08 10:29:43, Tolga Uzuner wrote: Dear R Users, I am attempting to place a title to a graph with multiple plots that should go across the top of all the graphs, and not just one of them. I am using mfrow in par to plot. Can

Re: [R] Title for graph with multiple plots

2008-07-19 Thread jim holtman
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/99281.html RSiteSearch("overall title") On Sat, Jul 19, 2008 at 6:29 AM, Tolga Uzuner <[EMAIL PROTECTED]> wrote: > Dear R Users, > I am attempting to place a title to a graph with multiple plots that should > go across the top of all the graphs, and

Re: [R] Discretize continous variables....

2008-07-19 Thread Daniel Malter
True. Thanks for the clarification. Is your conclusion from that that the findings in such case should only be interpreted in the specific context (with the awareness that it does not apply to changing contexts) or that such an approach should not be taken at all? Frank E Harrell Jr wrote: > >

Re: [R] Title for graph with multiple plots

2008-07-19 Thread Ted Harding
On 19-Jul-08 10:29:43, Tolga Uzuner wrote: > Dear R Users, > I am attempting to place a title to a graph with multiple plots that > should go across the top of all the graphs, and not just one of them. I > am using mfrow in par to plot. Can anyone suggest if and how this could > be done ? > Thanks

Re: [R] system time - windows specific problem

2008-07-19 Thread Christophe Dutang
Firstly thank you for answering so quickly. I hope I used the good mailing list! Secondly, I check that I make call to the 'randomize' function. anyway, I will look more closely to the R source and also try QueryPerformanceCounter. Thirdly, maybe I will remove time machine for quasi rando

[R] fixed effect significance with lmer() vs. t-test

2008-07-19 Thread dej500
I am looking at data of the following structure: n <- 100 dataset <- data.frame(gender=NULL,subject=NULL,outcome=NULL) for (i in 1:n){ gender <- c(rep("m",5),rep("f",5)) subject <- letters[1:10] outcome <- c(rbinom(5,1,0.6),rbinom(5,1,0.4)) dataset <- rbind(dataset,cbind(gender,sub

[R] Title for graph with multiple plots

2008-07-19 Thread Tolga Uzuner
Dear R Users, I am attempting to place a title to a graph with multiple plots that should go across the top of all the graphs, and not just one of them. I am using mfrow in par to plot. Can anyone suggest if and how this could be done ? Thanks in advance, Tolga ___

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread Gabor Grothendieck
On Sat, Jul 19, 2008 at 12:42 PM, stephen sefick <[EMAIL PROTECTED]> wrote: > I can fix the par settings. I am new to function writing. I would like to > use the na.method in the > d<- (x-y) > > how? > > I don't know what a driver is sorry for my ignorance 1. As stated in the prior post its code

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
h <- structure(c(1L, 2L, 3L, 4L, NA, 6L, 7L, 8L, NA, 10L, 1L, NA, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L), .Dim = c(10L, 2L), .Dimnames = list( c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), c("site1", "site2")), index = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), class = "zoo") diff.temp <- function

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
I can fix the par settings. I am new to function writing. I would like to use the na.method in the d<- (x-y) how? I don't know what a driver is sorry for my ignorance On Sat, Jul 19, 2008 at 12:36 PM, Gabor Grothendieck < [EMAIL PROTECTED]> wrote: > See ?paste and the collapse argument, in pa

Re: [R] initialize a factor vector

2008-07-19 Thread Patrick Burns
Somehow the mail system garbled my last sentence. It should read: You want to call 'factor' on the result of the call to 'c'. Pat Patrick Burns wrote: 'c' does not have a method for factors. If you were to try implementing one, you would probably quickly figure out why not. You want to call

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread Gabor Grothendieck
See ?paste and the collapse argument, in particular: plot(d, main = paste(paste(colnames(x), collapse = " "), paste(colnames(y), collapse = " "), sep = " - ")) Also your function sets na.method but never uses it and leaves the par settings changed afterwards. See ?par. It could also

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
#this is what I came up with diff.temp <- function(x, a, b,use="pairwise.complete.obs") { library(zoo) library(chron) na.method <- pmatch(use, c("all.obs", "complete.obs", "pairwise.complete.obs")) par(mfrow=c(2,1)) f <- colnames(x) d <- (x[,a]-x[,b]) plot(d, main= p

Re: [R] Change font-face in title

2008-07-19 Thread Albin Blaschka
jim holtman wrote: Is this what you want: plot(0,main=expression(paste("test ", italic("italic"), " and more"))) On Sat, Jul 19, 2008 at 11:31 AM, Albin Blaschka <[EMAIL PROTECTED]> wrote: Dear List, Is there a possibility to change the font-face for a part of the title of a plot? Hello

Re: [R] Discretize continous variables....

2008-07-19 Thread Frank E Harrell Jr
Daniel Malter wrote: This time I agree with Rolf Turner. This sounds like homework. Whether or not, type ?ifelse in the R-prompt. Frank is right, it leads to a loss in information. However, I think it remains interpretable. Further, it is common practice in certain fields, and I have to disa

[R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
#this is my little function that I would like to use the column names of the x and y arguments in the function. I would like it to read #site1-site2 how would I do this diff.temp <- function(x, y ,use="pairwise.complete.obs") { na.method <- pmatch(use, c("all.obs", "complete.obs",

Re: [R] Change font-face in title

2008-07-19 Thread Gabor Grothendieck
Or this which looks slightly better: plot(1, type="l", xlab="Wellenlänge [nm]", col="darkslategray", main = ~ Spektrum ~ italic("Deschampsia caespitosa")) On Sat, Jul 19, 2008 at 11:56 AM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try this: > > plot(1, type="l", xlab="Wellenlänge [nm

Re: [R] Change font-face in title

2008-07-19 Thread jim holtman
Is this what you want: plot(0,main=expression(paste("test ", italic("italic"), " and more"))) On Sat, Jul 19, 2008 at 11:31 AM, Albin Blaschka <[EMAIL PROTECTED]> wrote: > > > Dear List, > > Is there a possibility to change the font-face for a part of the title of a > plot? > > For example I ha

Re: [R] Change font-face in title

2008-07-19 Thread Gabor Grothendieck
Try this: plot(1, type="l", xlab="Wellenlänge [nm]", col="darkslategray", main = ~ Spektrum ~ italic(Deschampsia ~ caespitosa)) On Sat, Jul 19, 2008 at 11:31 AM, Albin Blaschka <[EMAIL PROTECTED]> wrote: > > > Dear List, > > Is there a possibility to change the font-face for a part of the ti

[R] principal factor analysis

2008-07-19 Thread Jinsong Zhao
Hi, Is there a function to do principal factor analysis in R? I am reading through ``A user's guide to principal components'' by J. E. Jackson. In Table 17.1, a comparison between principal components and common factors, and there is obvious difference between them. However, I don't know how to g

[R] Change font-face in title

2008-07-19 Thread Albin Blaschka
Dear List, Is there a possibility to change the font-face for a part of the title of a plot? For example I have the following... plot(nirs, type="l", xlab="Wellenlänge [nm]", col="darkslategray", main = "Spektrum Deschampsia caespitosa") ...and I would like to change the part of the tit

Re: [R] Resshufling algorithm (Thiago Souza)

2008-07-19 Thread Bernardo Rangel Tura
Em Sáb, 2008-07-19 às 11:07 -0300, Thiago Souza escreveu: > Hi folks! > > I'm a beginner and I'm learning how to use R. > > I need to calculate the value of Simpson Diversity Index (*D*=1-Σ*pi*^2; > where *p* is the relative abundance of the species* i*) of one sample (e.g., > diversity of bromel

Re: [R] initialize a factor vector

2008-07-19 Thread Patrick Burns
'c' does not have a method for factors. If you were to try implementing one, you would probably quickly figure out why not. You want to call 'call' factor on the result of the call to 'c'. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and "A Gu

Re: [R] Discretize continous variables....

2008-07-19 Thread Daniel Malter
This time I agree with Rolf Turner. This sounds like homework. Whether or not, type ?ifelse in the R-prompt. Frank is right, it leads to a loss in information. However, I think it remains interpretable. Further, it is common practice in certain fields, and it maybe a reasonable way to check whe

Re: [R] Graphics not working for R in ubuntu

2008-07-19 Thread Vincent Goulet
As others have mentioned, there is no "official" GUI for R under Linux. I suggest you have a look at the "Related Projects" area of the R Project web site, there is a link to a section devoted to GUIs. I would personally recommend the Emacs + ESS combo as a powerful (if not entirely intuiti

Re: [R] Discretize continous variables....

2008-07-19 Thread Frank E Harrell Jr
milicic.marko wrote: Hi R helpers, I'm preparing dataset to fir logistic regression model with lrm(). I have various cointinous and discrete variables and I would like to: 1. Optimaly discretize continous variables (Optimaly means, maximizing information value - IV for example) This will res

[R] Resshufling algorithm (Thiago Souza)

2008-07-19 Thread Thiago Souza
Hi folks! I'm a beginner and I'm learning how to use R. I need to calculate the value of Simpson Diversity Index (*D*=1-Σ*pi*^2; where *p* is the relative abundance of the species* i*) of one sample (e.g., diversity of bromeliad spiders) and test the significance of this value. For this I'll nee

Re: [R] initialize a factor vector

2008-07-19 Thread Johannes Huesing
I have found that factor vectors are shy beasts. Consider: > empty <- factor(levels=c("eins", "zwei")) > value <- factor("eins", levels=c("eins", "zwei")) > c(empty, value) [1] 1 > empty[1] <- value > empty [1] eins Levels: eins zwei > I could not exactly predict this behaviour, but ?c says:

[R] Discretize continous variables....

2008-07-19 Thread milicic.marko
Hi R helpers, I'm preparing dataset to fir logistic regression model with lrm(). I have various cointinous and discrete variables and I would like to: 1. Optimaly discretize continous variables (Optimaly means, maximizing information value - IV for example) 2. Regroup discrete variables to achie

Re: [R] Calculating Betweenness - Efficiency problem

2008-07-19 Thread jim holtman
It would seem that you can output the initial file from EXCEL, read it into R with 'read.csv' and then use 'factor' to convert the characters for City1 and City2 to the numbers that you want to use. Have you tried this approach? On Fri, Jul 18, 2008 at 3:51 PM, Senthil Purushothaman <[EMAIL PROTE

Re: [R] How to solve systems of nonlinear equations in R?

2008-07-19 Thread Berend Hasselman
François Aucoin wrote: > > Hey, > I was wondering if there existed a R function similar to 'fsolve' or > 'fzero' Matlab functions? > > For a single function of one variable you can use uniroot. Use ?uniroot in R to find out more. You can also try general purpose optimisation algorithms such

Re: [R] system time - windows specific problem

2008-07-19 Thread Duncan Murdoch
On 18/07/2008 5:26 PM, Christophe Dutang wrote: Hi all, I'm currently implementing quasi random generation (torus) on R (package randtoolbox available on CRAN). Even if it is not a great idea, I decided to use the machine time to initiate the seed. So when the seed is not specified by the

Re: [R] t-test for multiple variables

2008-07-19 Thread Simon Anders
Hi Henning, Henning Wildhagen wrote: i tried your code, but it results in an error: "error in var(x) : `x` is empty" Do you have an idea what the reason might be? If you ask questions on this list, please provide some code snippets, which the others can copy and paste to reproduce your error

Re: [R] Graphics not working for R in ubuntu

2008-07-19 Thread Michael Bibo
Nataraj biotech2.sastra.edu> writes: > > Dear list members, > > I have installed R in Ubuntu successfully but issuing > command like R in terminal will able to see only the R > working in command mode, the regular GUI which I use to > have in my windows installation of R missing in linux..I am

Re: [R] Graphics not working for R in ubuntu

2008-07-19 Thread Mose Andre
You can't run the Windows GUI in Ubuntu (unless you run it in a Windows virtual machine). Try installing rkward and using rkward for an alternative (you will probably be pleasantly surprised): sudo apt-get install rkward rkward http://rkward.sourceforge.net/ -Mose On Fri, Jul 18, 2008 at 11:09

Re: [R] "Spreading risk" in a matrix

2008-07-19 Thread ONKELINX, Thierry
Buffer works on a 2D dataset like a matrix. Have a look at the examples in ?buffer. But you probably will have to create a set of coordinaten of the points you want to buffer. HTH, Thierry ir. Thierry Onkelinx Instit

Re: [R] R version 2.7.1 (warnings)

2008-07-19 Thread Mark Difford
Hi Jaap, With all those packages loading it could take some time, unless it's a known problem (?). Why don't you do a vanilla start (add switch --vanilla to startup) and do some simple core-related stuff. Then add packages one-by-one... Or: search through the source code of the packages for the

[R] R version 2.7.1 (warnings)

2008-07-19 Thread Van Wyk, Jaap
Hi I have installed the new version 2.7.1, and get the following messages. Is there some way I can "fix it" ? I use SciViews as well, so the problem may be with one of the libraries that is loaded at start-up: Start-up: Loading required package: datasets Loading required package: utils Loading

[R] Graphics not working for R in ubuntu

2008-07-19 Thread Nataraj
Dear list members, I have installed R in Ubuntu successfully but issuing command like R in terminal will able to see only the R working in command mode, the regular GUI which I use to have in my windows installation of R missing in linux..I am new to linux and so clueless how I can go about that a