Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Liviu Andronic
On Thu, Apr 21, 2011 at 9:59 PM, Thomas Lumley wrote: > The Evil and Wrong use is to modify variables in the global environment. > I'm a bit at a loss. Why is it so wrong and evil? In other words, how should one modify variables in the global environment? Through the use of return()? Regards Livi

Re: [R] Matching a vector with a matrix row

2011-04-21 Thread Joshua Wiley
Hi Felipe, Since matrices are just a vector with dimensions, you could easily use something like this (which at least on my system, is slightly faster): results <- which(Matrix %in% LHS) I'm not sure this is the fastest technique thought. It will return a vector of the positions in "Matrix" tha

[R] Matching a vector with a matrix row

2011-04-21 Thread Luis Felipe Parra
Hello I am trying to compare a vector with a Matrix's rows.The vector has the same length as the number of columns of the matrix, and I would like to find the row numbers where the matrix's row us the same as the given vector. What I am doing at the moment is using apply as follows: apply(Matrix,1

Re: [R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Niels Richard Hansen
a1 * a3[a2] - Niels Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a v

Re: [R] set.seed ( ) function

2011-04-21 Thread Joshua Wiley
On Thu, Apr 21, 2011 at 8:34 PM, Penny Bilton wrote: > Hi Josh, > > Thanks for your reply. > > The problem is have is in trying to retain the proportions of 2 groups in my > data while sampling into training and test sets. I find that different >  arguments for set.seed give very different proport

[R] How to answer the question about transitive correlation?

2011-04-21 Thread zhu yao
Hi, everyone. I know it may be a basic statistical question. But I can't find a good answer. I have a question raised by one of the reviewers. Factor A expression was strongly correlated with B expression (chi-square) in this series. Prior reports by the same authors showed that B expression stron

[R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Min-Han Tan
Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a vector a2). The example b

Re: [R] set.seed ( ) function

2011-04-21 Thread Joshua Wiley
Hi, On Thu, Apr 21, 2011 at 8:18 PM, Penny Bilton wrote: > I am using /set.seed()/   before the /sample/   function. > > How does the length of the argument of /set.seed()/   and order of the > digits affect how the sampling is carried out? You can use set.seed() to specify a particular seed so

[R] set.seed ( ) function

2011-04-21 Thread Penny Bilton
I am using /set.seed()/ before the /sample/ function. How does the length of the argument of /set.seed()/ and order of the digits affect how the sampling is carried out? Specifically, I have used set.seed(123456789). Will this configuration give me a genuinely random sampling?? Thank yo

[R] Dual colour ramps based on pos/neg values

2011-04-21 Thread Tyler Hayes
Hi Everyone: I'm going a little nuts here and am hoping someone might have some ideas to help out. Here is my problem: I am using the calendarHeatMap function (http://blog.revolutionanalytics.com/2009/11/charting-time-series-as-calendar-heat-maps-in-r.html) to plot some values of percentages abov

Re: [R] Sorting values within a raster

2011-04-21 Thread David Winsemius
On Apr 21, 2011, at 9:33 PM, Sara Maxwell wrote: Hi David et al, Thanks for your help. I spent the afternoon and thought that would work but then I realized it was giving a different answer. I have counts ('hits') in each grid cell, and have then calculated the proportion of the total hi

Re: [R] Sorting values within a raster

2011-04-21 Thread Sara Maxwell
Hi David et al, Thanks for your help. I spent the afternoon and thought that would work but then I realized it was giving a different answer. I have counts ('hits') in each grid cell, and have then calculated the proportion of the total hits represented in each cell (such that the sum of

Re: [R] Can R replicate this data manipulation in SAS?

2011-04-21 Thread peter dalgaard
On Apr 21, 2011, at 16:00 , Bert Gunter wrote: > Folks: > > It is perhaps worth noting that this is probably a Type III error: right > answer to the wrong question. The right question would be: what data > structures and analysis strategy are appropriate in R? As usual, different > language arc

Re: [R] Accounting for overdispersion in a mixed-effect model with a proportion response variable and categorical explanatory variables.

2011-04-21 Thread Ben Bolker
Richard Friedman cancercenter.columbia.edu> writes: > > Dear R-help-list, > > I have a problem in which the explanatory variables are categorical, > the response variable is a proportion, and experiment contains > technical replicates (pseudoreplicates) as well as biological > repl

Re: [R] image function with large matrices

2011-04-21 Thread cutcopy11
I realized that my problem was not the image function but with the interp function. The default for the interp arguements xo and yo = 40, which is why I had a 40 X 40 square image. Here is the revised command. image( interp( ytar_rcayrtgy$V2, ytar_rcayrtgy$V4, ytar_rcayrtgy$V5, xo=seq

Re: [R] Geographic distance between lat-long points in R?

2011-04-21 Thread Crigou
Please allow me to present you the ultimate distance calculation algorithm by Charles Karney, accurate to one nanometre: http://geographiclib.sourceforge.net/cgi-bin/Geod -- View this message in context: http://r.789695.n4.nabble.com/Geographic-distance-between-lat-long-points-in-R-tp3442338p3466

[R] Rearranging columns with cbind

2011-04-21 Thread vin691
I'm getting an error that I don't understand when trying to rearrange my data columns with cbind. My data is in 27 columns, like so: > data <- read.table("CalledFeatsNimblegen.csv", header=T, sep=",") > names(data) [1] "MF_not_mC" "MF_promoter""MF_genebody" "FF_not_mC"

[R] image function with large matrices

2011-04-21 Thread cutcopy11
Hi, I am new to R. With the command below, I generated the image on the left in R. On the right, with the same data (x,y,z in columns), I generated a similar image in SigmaPlot. If you look at the R image, one can see that the resolution is low. Even though the data represents a 131 X 131 matri

Re: [R] Rearranging columns with cbind

2011-04-21 Thread Cliff Clive
It's just a typo. You're missing a comma at the beginning of your index, and you should list all of the rows in a vector, like this: data[, c(19:27, 1:12, 13:15, 16:18)] The way you entered it, R is looking for rows 19:27, columns 1:12, and doesn't know what to do with the other numbers. -- View

[R] Rearranging PCA results from R

2011-04-21 Thread psycrcyo
Hi!! I'm having trouble selecting 10 out of 41 attributes of the KDD data set. In order to identify the components with the higher variance I'm using princomp. the result i get for summary(pca1) is: Comp.1Comp.2 Comp.3 Comp.4

Re: [R] GLM output for deviance and loglikelihood

2011-04-21 Thread peter dalgaard
On Apr 21, 2011, at 11:30 , Jeffrey Pollock wrote: > So am I right in saying that Binary data isnt the only case where this is > true? It would make sense to me that for a multinomial model you could have a > unique factor for each data point and thus be able to create a likelihood of > 1. Ye

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Thomas Lumley
On Fri, Apr 22, 2011 at 9:39 AM, Rolf Turner wrote: > On 22/04/11 07:08, Cliff Clive wrote: >> >> I've been reading some code from an example in a blog post ( >> http://www.maxdama.com/ here ) and I came across an operator that I hadn't >> seen before.  The author used a<<- operator to update a va

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Rolf Turner
On 22/04/11 07:08, Cliff Clive wrote: I've been reading some code from an example in a blog post ( http://www.maxdama.com/ here ) and I came across an operator that I hadn't seen before. The author used a<<- operator to update a variable, like so: ecov_xy<<- ecov_xy+decay*(x[t]*y[t]-ecov_xy) A

[R] 'Structure' compatible between Matlab and R

2011-04-21 Thread Alaios
Dear all, I would like to store some data in a such way that I can import and export the data from matlab to R (And vice versa). I have a matrix of size 512*512 size. I would like to have 101 of such matrices. (that is easy so far) and then I would like to have 35times the 101 matrices. That mea

[R] Package check issue: Rprofile.site is not used

2011-04-21 Thread Sébastien Bihorel
Dear R-users, I am having some issues with a package I am working on (using R 2.12.1 in a Linux environment) and would like to have your opinions/advises. My package - let's call it mypackage for the purpose of this email - passes all checks of R CMD check, except for the following failure message

[R] Error in png: unable to start png() device

2011-04-21 Thread Patrick McKann
I don't know if anyone is reading this, but I have more information now. I can run the same script on my other computer over and over, change the height, width and res, and it works every time. But on the faulty computer, I can open R, open the script, and run it and it works. I can re-run it an

Re: [R] Sorting values within a raster

2011-04-21 Thread David Winsemius
On Apr 21, 2011, at 3:23 PM, Sara Maxwell wrote: I am working with a raster and want to take values assigned to each cell and sort them from largest to smallest, then cummulatively sum them together (in order from largest to smallest). I'll then be coding the individual cells such that th

Re: [R] all combinations with replacement

2011-04-21 Thread Petr Savicky
On Thu, Apr 21, 2011 at 12:52:34PM -0700, Kehl Dániel wrote: > Thank you. > I only need those where the rowsum = n. > I could choose those with code, but I dont think it is efficient that way. Efficiency of using expand.grid() may be improved, if expand.grid() is used only to k-1 columns, then the

Re: [R] all combinations with replacement

2011-04-21 Thread Jorge Ivan Velez
Hi Kehl, How large are n and k in your case? Using Dimitris' approach and I got the following timings for 1000 replicates: # function based on Dimitri's reply foo <- function(n, k){ r <- expand.grid(rep(list(0:n), k)) subset(r, rowSums(r) == n) } # a second try foo2 <- function(n

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Thomas Lumley
On Fri, Apr 22, 2011 at 7:08 AM, Cliff Clive wrote: > I've been reading some code from an example in a blog post ( > http://www.maxdama.com/ here ) and I came across an operator that I hadn't > seen before.  The author used a <<- operator to update a variable, like so: > > ecov_xy <<- ecov_xy+deca

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Marc Schwartz
On Apr 21, 2011, at 2:08 PM, Cliff Clive wrote: > I've been reading some code from an example in a blog post ( > http://www.maxdama.com/ here ) and I came across an operator that I hadn't > seen before. The author used a <<- operator to update a variable, like so: > > ecov_xy <<- ecov_xy+decay*(

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Roy Mendelssohn
?assignOps -Roy M. On Apr 21, 2011, at 12:08 PM, Cliff Clive wrote: > I've been reading some code from an example in a blog post ( > http://www.maxdama.com/ here ) and I came across an operator that I hadn't > seen before. The author used a <<- operator to update a variable, like so: > > ecov_x

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Kehl Dániel
maybe help ("<<-") helps daniel 2011-04-21 12:14 keltezéssel, Cliff Clive írta: I should probably point out that in the example, "ecov_xy " and "decay" are scalars, and x and y are vectors. -- View this message in context: http://r.789695.n4.nabble.com/What-does-the-operator-mean-tp3466657

Re: [R] all combinations with replacement

2011-04-21 Thread Kehl Dániel
Thank you. I only need those where the rowsum = n. I could choose those with code, but I dont think it is efficient that way. daniel 2011-04-21 12:33 keltezéssel, Dimitris Rizopoulos írta: expand.grid(rep(list(0:6), 3)) __ R-help@r-project.org mai

[R] Sorting values within a raster

2011-04-21 Thread Sara Maxwell
I am working with a raster and want to take values assigned to each cell and sort them from largest to smallest, then cummulatively sum them together (in order from largest to smallest). I'll then be coding the individual cells such that the top 10% of the largest cell values can be visual

Re: [R] What does the "<<-" operator mean?

2011-04-21 Thread Cliff Clive
I should probably point out that in the example, "ecov_xy " and "decay" are scalars, and x and y are vectors. -- View this message in context: http://r.789695.n4.nabble.com/What-does-the-operator-mean-tp3466657p3466672.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Include C++ DLL, error in ...: C symbol name not in load table

2011-04-21 Thread Massimiliano
Maybe you have to add #include #include to your C++ source code. Massimiliano Tripoli Il giorno mer, 20/04/2011 alle 22.06 +0200, Sascha Vieweg ha scritto: > #include > using namespace std; > void foo (double* x, double* y, double* out) > { > out[0] = x[0] + y[0]; > } > > _

[R] What does the "<<-" operator mean?

2011-04-21 Thread Cliff Clive
I've been reading some code from an example in a blog post ( http://www.maxdama.com/ here ) and I came across an operator that I hadn't seen before. The author used a <<- operator to update a variable, like so: ecov_xy <<- ecov_xy+decay*(x[t]*y[t]-ecov_xy) At first I thought it was a mistake and

Re: [R] all combinations with replacement

2011-04-21 Thread Dimitris Rizopoulos
probably expand.grid(), e.g., expand.grid(rep(list(0:6), 3)) I hope it helps. Best, Dimitris On 4/21/2011 9:28 PM, Kehl Dániel wrote: Dear all, is there an easy way to get all possible combinations (?) with replacement. If n=6, k=3, i want something like 0 0 6 0 5 1 0 4 2 0 3 3 0 2 4 . .

[R] all combinations with replacement

2011-04-21 Thread Kehl Dániel
Dear all, is there an easy way to get all possible combinations (?) with replacement. If n=6, k=3, i want something like 0 0 6 0 5 1 0 4 2 0 3 3 0 2 4 . . . 5 0 1 5 1 0 6 0 0 I tried to look at combn() but I could not get this done with it. Thank you in advance: Daniel ___

[R] Accounting for overdispersion in a mixed-effect model with a proportion response variable and categorical explanatory variables.

2011-04-21 Thread Richard Friedman
Dear R-help-list, I have a problem in which the explanatory variables are categorical, the response variable is a proportion, and experiment contains technical replicates (pseudoreplicates) as well as biological replicated. I am new to both generalized linear models and mixed- effects mo

[R] usage of dsstd function in fGarch package

2011-04-21 Thread James C. McGrath (j...@brookscapitalgroup.com)
Good afternoon, I have a question about the use of the dsstd() function; The documentation provides an example: dsstd(x, mean = 0, sd = 1, nu = 5, xi = 1.5) where: mean, sd, nu, xi are the location parameter mean, scale parameter sd, shape parameter nu, skewness parameter xi Skewness can be

Re: [R] one-way ANOVA model, with one factor, an unbalanced design and unequal variances

2011-04-21 Thread peter dalgaard
On Apr 21, 2011, at 20:28 , Steven wrote: > Hi, > > i'm looking for an R function to fit a one-way ANOVA with one factor > containing 10 levels. The factor levels have different numbers of > observations (varying between 20 to 40). For most of the dependent variables > i'm testing there are uneq

[R] one-way ANOVA model, with one factor, an unbalanced design and unequal variances

2011-04-21 Thread Steven
Hi, i'm looking for an R function to fit a one-way ANOVA with one factor containing 10 levels. The factor levels have different numbers of observations (varying between 20 to 40). For most of the dependent variables i'm testing there are unequal variances among the factor levels. I see the functi

Re: [R] multiple imputation

2011-04-21 Thread Ted Harding
On 20-Apr-11 20:46:53, DOCMAA wrote: > I have missing values from a few subjects due to instrumentation > not working. My data set is N=283 data points. For some subjects > i have 60 data points missing max. > > I tried to use Amelia 2 to impute the missing values but i am > getting a negative

Re: [R] Rcmdr vs SPSS in hungarian

2011-04-21 Thread csrabak
Em 21/4/2011 11:36, Jeremy Miles escreveu: Just because it comes from a book does not make it true or correct. Books are subject to considerably less peer review than journal articles. Publishers will publish a book written by (almost) anyone - I know this, because I've written some of them and

[R] Expanding the list of fonts used in PDFs & JPEGs

2011-04-21 Thread Brian Kriegler
My company uses Garamond and Verdana for most/all of their memos and reports. I would like to use these fonts when saving graphs as PDFs or JPEGs. My office uses Windows XP, though they are transitioning to Windows 7 shortly. Any suggestions on how to add these fonts is greatly appreciated.

Re: [R] survexp with weights

2011-04-21 Thread Terry Therneau
> lines(survexp( ~ trt, ratetable=pfit.wtd, data=pbc), col='purple') Error in eval(expr, envir, enclos) : object 'albumin' not found The code does work, however, using the latest version of survival. (Use of case weights in survexp languished on my to-do list for a long long time.) Terry Therne

[R] Error in png: unable to start png() device

2011-04-21 Thread Patrick McKann
Hello. I have made many pngs in the past, but started having trouble with them yesterday. I just downloaded R 2.13.0 this morning, and was able to make some pngs earlier this morning. Now I am trying to remake them, but get the same error message I got yesterday: > u='in' > w=10.5 > h=8 > png('

Re: [R] Converting 16-bit to 8-bit encoding?

2011-04-21 Thread Matt Shotwell
OK. I'm going to copy this back to R-help too. With R, we can convert a file of 8-bit integers to 16-bit integers like so: # Create a test file of 8-bit integers: con <- file("test.8", "wb") writeBin(sample(-1L:4L, 1024, TRUE), con, size=1) close(con) # Convert test.8 to test.16 icon <- file("t

Re: [R] Fibonacci

2011-04-21 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Nordlund, > Dan (DSHS/RDA) > Sent: Thursday, April 21, 2011 9:19 AM > To: r-help@r-project.org > Subject: Re: [R] Fibonacci > > > -Original Message- > > From: r-help-bou

[R] Discovery version of ASREML now free

2011-04-21 Thread Kevin Wright
Dear R users, I would like to draw your attention to the fact that the Discovery version of ASREML is now free (as in beer, not speech) for people in academia (excluding commercial use) and for people in developing nations. This applies to both the stand-alone ASREML and the R package ASREML-R.

Re: [R] numbers and superscripts in the same unit of measurement.

2011-04-21 Thread Dennis Murphy
Hi: Are you looking for something like plot(1, 1, main = expression('Individuals/100m'^3)) ? See ?plotmath for how to insert mathematical symbols into plots. HTH, Dennis On Thu, Apr 21, 2011 at 7:18 AM, Jose Bustos Melo wrote: > Hola everyone, > > > > I'm doing an analisys about abundance of

Re: [R] survexp with weights

2011-04-21 Thread Mike Harwood
The system details follow below. Also, I have attempted specifying the variables in a second "ratetable" statement, but the same "missing object" error occurs in creating a survexp object/list. > R.version _ platform i386-pc-mingw32 arch i386 os mingw32

Re: [R] BMA, logistic regression, odds ratio, model reduction etc

2011-04-21 Thread khosoda
Thank you for your comment. I forgot to mention that varclus and pvclust showed similar results for my data. BTW, I did not realize rms is a replacement for the Design package. I appreciate your suggestion. -- KH (11/04/21 8:00), Frank Harrell wrote: I think it's OK. You can also use the Hmi

Re: [R] line type lty

2011-04-21 Thread Jorge Ivan Velez
See ?par Best, Jorge On Thu, Apr 21, 2011 at 12:22 PM, Hui Du <> wrote: > Hi All, > > >Does somebody know how to know the detail of the line types? > For example, lty = 1, means what kind of line?, lty = 2, means what kind of > line? > > >Thanks. > > HXD > >

Re: [R] Residuals -- was: Rcmdr vs SPSS in hungarian

2011-04-21 Thread John Fox
Dear Bert, Jeremy, et al., I must admit to being mystified by this whole exchange, and not just because part of it is in Hungarian. First, as far as I can tell, the issue, if there is one, has nothing to do directly with the Rcmdr package, which simply uses the rstudent() function from the standa

Re: [R] override default arguments in nested function

2011-04-21 Thread Joshua Wiley
On Thu, Apr 21, 2011 at 5:38 AM, Peter Ehlers wrote: > On 2011-04-20 19:45, Joshua Wiley wrote: >> >> Hi All, >> >> I think I already know the answer, but I am hoping I am missing >> something.  I am using function omega from the psych_1.0-96 in R >> version 2.13.0.  I would like to override one o

[R] line type lty

2011-04-21 Thread Hui Du
Hi All, Does somebody know how to know the detail of the line types? For example, lty = 1, means what kind of line?, lty = 2, means what kind of line? Thanks. HXD [[alternative HTML version deleted]] __ R-h

Re: [R] Fibonacci

2011-04-21 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Winsemius > Sent: Thursday, April 21, 2011 8:44 AM > To: Michael Dewey > Cc: r-help@r-project.org > Subject: Re: [R] Fibonacci > > > On Apr 21, 2011, at 9:04 AM, Michael D

Re: [R] Converting 16-bit to 8-bit encoding?

2011-04-21 Thread Matt Shotwell
On 04/21/2011 10:36 AM, Brian Buma wrote: Hello all- I have a question related to encoding. I'm using a seperate program which takes either 16 bit or 8 bit (flat binary files) as inputs (they are raster satellite imagery and the associated quality files), but can't handle both at the same time.

Re: [R] Fibonacci

2011-04-21 Thread David Winsemius
On Apr 21, 2011, at 9:04 AM, Michael Dewey wrote: At 10:42 20/04/2011, Georgina Imberger wrote: Hi! I am trying to work out the code to get a Fibonacci sequence, using the while() loop and only one variable. And I can't figure it out. > phi <- 0.5 * (1 + sqrt(5)) > phi [1] 1.618034 > fi

Re: [R] combining matrices

2011-04-21 Thread Peter Ehlers
On 2011-04-21 07:03, Marten Winter wrote: Heja, I hope someone is still there to help me: How can I somehow merge/combine matrices to get such a result: Matrix A A B x1 1 0 x2 1 1 Matrix B C D x3 1 0 x4 0 1 Resulting Matrix? A B C D x1 1 0 0 0 x2 1 1 0 0 x3 0 0 1 0 x4 0 0 0 1 If you d

Re: [R] passing a vector of variable names to the ... pairlist function argument

2011-04-21 Thread Jessica Myers
Thanks - your last suggestion does seem to work with the ridge function, but the names of the objects get lost in the process. Is there a way to keep the object names with get? Thanks, Jessica Myers On Apr 21, 2011, at 11:00 AM, Uwe Ligges wrote: On 21.04.2011 16:03, Jessica Myers wrote

[R] Matching package argument exact

2011-04-21 Thread Kathrin Müller
Hi, I’d like to do some sample matching with propensity scores. I’ve estimated the propensity scores: glm1 <- glm(Exposed~Gender+ImagingCentreID+espad.3a+drinks.preg+espad.6+audit.total+ PDS.all, family=binomial, data=PBQ_110421) Now I would like to match on the propensity score and have an exac

[R] Converting 16-bit to 8-bit encoding?

2011-04-21 Thread Brian Buma
Hello all- I have a question related to encoding. I'm using a seperate program which takes either 16 bit or 8 bit (flat binary files) as inputs (they are raster satellite imagery and the associated quality files), but can't handle both at the same time. Problem is the quality and the image come

Re: [R] Converting from density to cumulative distribution

2011-04-21 Thread jim holtman
?cumsum > x = c(1,3,2,2,5) > cumsum(x) [1] 1 4 6 8 13 > On Thu, Apr 21, 2011 at 11:05 AM, Parodi, Pietro wrote: > > Hello > > I'm trying to do the following vector operation: > > given vector x = c(x1,x2,x3,x4...xn),  produce vector y = > c(x1,x1+x2,x1+x2+x3,...x1+...+xn). > > E.g.,  from x

Re: [R] passing a vector of variable names to the ... pairlist function argument

2011-04-21 Thread Uwe Ligges
On 21.04.2011 17:14, Jessica Myers wrote: Thanks - your last suggestion does seem to work with the ridge function, but the names of the objects get lost in the process. Is there a way to keep the object names with get? Oh, come on, you can do that yourself: L <- lapply(xs, get) names(L) <-

Re: [R] Residuals -- was: Rcmdr vs SPSS in hungarian

2011-04-21 Thread Bert Gunter
Inline below: 2011/4/21 Jeremy Miles > > Just because it comes from a book does not make it true or correct. Amen! > Books are subject to considerably less peer review than journal > articles. Yes, but ... Peer review among journals is uneven, especially for those from private for-profit publi

Re: [R] Expanding a VCV Matrix

2011-04-21 Thread Maithula Chandrashekhar
Oh.you are right.sorry. So many work nowadays, even cant see things properly. Anyways thanks for your input. 2011/4/21 Uwe Ligges : > > > On 21.04.2011 17:08, Maithula Chandrashekhar wrote: >> >> Thanks Uwe for your insight. However this could not solve my problem. >> Actually, I

Re: [R] Expanding a VCV Matrix

2011-04-21 Thread Uwe Ligges
On 21.04.2011 17:08, Maithula Chandrashekhar wrote: Thanks Uwe for your insight. However this could not solve my problem. Actually, I meant to define 'Str' in this way: mat<- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) colnames(mat)<- rownames(mat)<- paste("variable", 1:3, sep="") mat

Re: [R] Expanding a VCV Matrix

2011-04-21 Thread Maithula Chandrashekhar
Thanks Uwe for your insight. However this could not solve my problem. Actually, I meant to define 'Str' in this way: > mat <- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) > colnames(mat) <- rownames(mat) <- paste("variable", 1:3, sep="") > mat variable1 variable2 variable3 variable1 1

[R] Converting from density to cumulative distribution

2011-04-21 Thread Parodi, Pietro
Hello I'm trying to do the following vector operation: given vector x = c(x1,x2,x3,x4...xn), produce vector y = c(x1,x1+x2,x1+x2+x3,...x1+...+xn). E.g., from x = c(1,3,2,2,5), produce y = c(1,4,6,8,13). The underlying problem is finding the cumulative distribution function given the em

Re: [R] passing a vector of variable names to the ... pairlist function argument

2011-04-21 Thread Uwe Ligges
On 21.04.2011 16:03, Jessica Myers wrote: Hi, I have a character vector that contains the names of several objects that I would like to pass to a function (specifically, the ridge function in the survival package, but cbind is a similar example). I've been struggling with how to do this so tha

Re: [R] combining matrices

2011-04-21 Thread Richard M. Heiberger
A <- matrix(1:4, 2, 2, dimnames=list(c("x1","x2"), c("A","B"))) B <- matrix(5:8, 2, 2, dimnames=list(c("x3","x4"), c("C","D"))) result <- array(0, dim=dim(A)+dim(B), dimnames=list(c(dimnames(A)[[1]], dimnames(B)[[1]]), c(dimnames(A)[[2]], dimnames(B)[[2

Re: [R] Rcmdr vs SPSS in hungarian

2011-04-21 Thread Jeremy Miles
Just because it comes from a book does not make it true or correct. Books are subject to considerably less peer review than journal articles. Publishers will publish a book written by (almost) anyone - I know this, because I've written some of them and they were published. There really isn't much

[R] combining matrices

2011-04-21 Thread Marten Winter
Heja, I hope someone is still there to help me: How can I somehow merge/combine matrices to get such a result: Matrix A A B x1 1 0 x2 1 1 Matrix B C D x3 1 0 x4 0 1 Resulting Matrix? A B C D x1 1 0 0 0 x2 1 1 0 0 x3 0 0 1 0 x4 0 0 0 1 Does anyone see this probably obvious solution with

Re: [R] Can R replicate this data manipulation in SAS?

2011-04-21 Thread Bert Gunter
Folks: It is perhaps worth noting that this is probably a Type III error: right answer to the wrong question. The right question would be: what data structures and analysis strategy are appropriate in R? As usual, different language architectures mean that different paradigms should be used to be

[R] passing a vector of variable names to the ... pairlist function argument

2011-04-21 Thread Jessica Myers
Hi, I have a character vector that contains the names of several objects that I would like to pass to a function (specifically, the ridge function in the survival package, but cbind is a similar example). I've been struggling with how to do this so that the object values get interpreted

[R] Rcmdr vs SPSS in hungarian

2011-04-21 Thread Tamas Barjak
Remélem valaki ezt is elolvassa, megérti, és válaszol a problémámra. A gondom a következõ: Kiszámoltattam a maradékokat az R commanderrel, és az SPSS -el is. És itt kezdõdik igazán a gond. Az SPSS a Studentizált törölt maradékokra ugyanazt az eredményt dobta, mint az Rcmdr a Studentizált maradéko

[R] numbers and superscripts in the same unit of measurement.

2011-04-21 Thread Jose Bustos Melo
Hola everyone, I'm doing an analisys about abundance of a planctonic specie in Robinson Crusoe Islan and I am having a hard time just adding the superscripts and the 100 (one hundred) in the measure of abundance. Perhaps this is so basic to you, but I need to put the real unit of measure. In

[R] Problem loading rJava (win 7)

2011-04-21 Thread Tal Galili
Hello all, I'm using R 2.13.0 on windows 7. It seems rJava is failing to load for me, here is the error received: > library("rJava") Error in utils::readRegistry(key, "HLM", 2) : Registry key 'Software\JavaSoft\Java Runtime Environment' not found Error in utils::readRegistry(key, "HLM", 2) :

[R] C source code question (Robustbase edition)

2011-04-21 Thread kv
Hi all, I have been trying to add the line: h = n - p0 + 1; just after h = n / 2 + 1; (line 131) in the source code (the original paper mention this is possible for p0

Re: [R] Fibonacci

2011-04-21 Thread Michael Dewey
At 10:42 20/04/2011, Georgina Imberger wrote: Hi! I am trying to work out the code to get a Fibonacci sequence, using the while() loop and only one variable. And I can't figure it out. > phi <- 0.5 * (1 + sqrt(5)) > phi [1] 1.618034 > fib <- function(n) {(phi ^ n - (1 - phi) ^ n) / sqrt(5)} >

Re: [R] override default arguments in nested function

2011-04-21 Thread Peter Ehlers
On 2011-04-20 19:45, Joshua Wiley wrote: Hi All, I think I already know the answer, but I am hoping I am missing something. I am using function omega from the psych_1.0-96 in R version 2.13.0. I would like to override one of the default arguments of a function that is eventually called (to fix

Re: [R] Pattern match

2011-04-21 Thread David Winsemius
On Apr 21, 2011, at 5:27 AM, neetika nath wrote: Thank you Dennis, yes the problem is the input file. i have .rdf file and the format is in same way i have posted earlier. if i open that file in notepad++ the lines are divided or broken with CR+LF character. so any suggestion to retriev

Re: [R] Expanding a VCV Matrix

2011-04-21 Thread Uwe Ligges
On 20.04.2011 19:26, Maithula Chandrashekhar wrote: Dear all, I have special task to expand a given VCV matrix, however could not accomplice yet. Let say I have following VCV matrix mat<- matrix(c(1,2,0,2,5,0.5,0,0.5,3), 3, 3) colnames(mat)<- rownames(mat)<- paste("variable", 1:3) mat

[R] course: Introduction to Bayesian Data Analysis using WinBUGS and R; Summer School 2011 - Portugal

2011-04-21 Thread Dr. Pablo E. Verde
Dear Colleges, Apologies for cross-posting. Places are available in the following course: "Introduction to Bayesian Data Analysis using WinBUGS and R" Best Regards, Pablo ++ Course: Introduction to Bayesian Data Analysis using WinBUGS an

Re: [R] taking rows from data.frames in list to form new data.frame?

2011-04-21 Thread Hadley Wickham
On Wed, Apr 20, 2011 at 6:36 PM, Dennis Murphy wrote: > Hi: > > Perhaps you're looking for subset()? I'm not sure I understand the > problem completely, but is > > do.call(rbind, lapply(database, function(df) subset(df, Symbol == 'IBM'))) > > or > > library(plyr) > ldply(lapply(database, function(

Re: [R] Retrieve model from R without save

2011-04-21 Thread Duncan Murdoch
On 11-04-21 5:36 AM, Raji wrote: Hi All, We have an application which uses R algorithms. We are currently using save() command to store models.But for save() command, we have to give the filename.But, in our application, we cannot afford to save it in any specific location. In this case , for

Re: [R] Error running pvals.fnc in R version 2.13.0

2011-04-21 Thread Uwe Ligges
I can reproduce the error when just running the example in ?pvals.fnc. The authos has wrapped the example in a \dontrun, hence it is unchecked on CRAN. CC to the package maintainer: Can we have a fixed version with increased version number uploaded to CRAN in the usual way? Thanks, Uwe Ligge

Re: [R] succession time series graph

2011-04-21 Thread Jim Lemon
On 04/21/2011 08:23 AM, David Bird wrote: Dear gracious R community, I would like to produce charts of phytoplankton biomass changes through time. Each species has a line, and the biomass varies in mirror form along the line for each species along the X time axis. Here is an example of what I'd

[R] Luis Miguel Delgado Gomez/BBK está ausente de la oficina.

2011-04-21 Thread Luis Miguel Delgado Gomez
Estaré ausente de la oficina desde el 20/04/2011 y no volveré hasta el 02/05/2011. Responderé a su mensaje cuando regrese. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

[R] Retrieve model from R without save

2011-04-21 Thread Raji
Hi All, We have an application which uses R algorithms. We are currently using save() command to store models.But for save() command, we have to give the filename.But, in our application, we cannot afford to save it in any specific location. In this case , for accessing the models generated in R

Re: [R] Categorical bubble plot

2011-04-21 Thread Jurgens de Bruin
Thanks for all the help!!! On 16 April 2011 08:32, Tal Galili wrote: > Hi Jurgens, > > In the following post I show how to use balloonplot from qplots to do more > or less what you ask: > > http://www.r-statistics.com/2010/02/nutritional-supplements-efficacy-score-graphing-plots-of-current-studi

[R] [R-pkgs] Boost library in R package.

2011-04-21 Thread Cedric Ginestet
Hi R package developers, I would like to know whether anyone had experience using the C++ Boost library within an R package, and how portable was the resulting package. I am especially thinking of possible compiling problems on Windows and Apple systems. If anyone had any tips on how to render

Re: [R] question regarding qmvnorm

2011-04-21 Thread Torsten Hothorn
On Wed, 20 Apr 2011, Ravi Varadhan wrote: If you had told us what the error message was, my job would have been easier. But, at least you provied the code, so it was not hard for me to see where the problem was. There is a problem with the strategy used by `qmvnorm' to locate the initial i

Re: [R] GLM output for deviance and loglikelihood

2011-04-21 Thread Jeffrey Pollock
First of all thank you both for the replies, my understanding is a lot clearer after thinking about the example you showed. One further question though, looking at the code for 'polr' in MASS suggests that ordinal (and I would guess nominal too) data with levels >2 (ie not binary) also has a sa

Re: [R] Pattern match

2011-04-21 Thread neetika nath
Thank you Dennis, yes the problem is the input file. i have .rdf file and the format is in same way i have posted earlier. if i open that file in notepad++ the lines are divided or broken with CR+LF character. so any suggestion to retrieve SpeciesScientific information without changing the input

Re: [R] grid.table + splom: how to nicely align panel entries

2011-04-21 Thread Marius Hofert
Here is the final solution with my minimal example :-) library(lattice) library(grid) library(gridExtra) ## function for correct alignment according to the decimal point align.digits <- function(l){ sp <- strsplit(as.character(l), "\\.") chars <- sapply(sp, function(x) nchar(x)[1]) n

  1   2   >