Re: [R] Placing the legend 'dynamically'

2010-03-11 Thread Jim Lemon
On 03/11/2010 01:36 AM, t.wun...@stud.uni-heidelberg.de wrote: Hello, does anybody know which command to consider when I'm trying to plot a stacked barplot with a legend at the most empty portion of the graphic? I've searched for it, and somebody stated to use the labcurve-command, but I don't

[R] Help function ? in R 2.10.1

2010-03-11 Thread Sergey Goriatchev
Hello everyone, I have versions 2.7.2 and 2.10.1 installed on a machine that has no access to internet. In 2.7.2 I can use ? to get help on functions, which in 2.10.1 that does not work, all I see is starting httpd help server...done and then nothing. Have I downloaded 2.10.1 incorrectly

Re: [R] how does R compute Std. Error's?

2010-03-11 Thread Eik Vettorazzi
Hi, I think, the correct formula for beta should be beta.hat=I(T(X)*X)*T(X)*y and as far as I remember beta.hat \sim N(beta,sigma^2*I(T(X)*X), not I(T(X)*X)/sigma^2 Rnewb schrieb: i am trying to duplicate R's computation of standard errors but having some trouble. i loaded some data into R

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Ivan Calandra
Hi, I think you do need an Internet connection to access the help files with R2.10. There might be some way to access them off-line, though I have no idea how. Maybe someone here knows. Ivan Le 3/11/2010 09:42, Sergey Goriatchev a écrit : Hello everyone, I have versions 2.7.2 and 2.10.1

Re: [R] colname of ... arguments

2010-03-11 Thread ManInMoon
David, That's useful to highlight my problem. If instead of e=e we use a vector like GreenEyes: GreenEyes=c(1,2,3,4) niceplot(GreenEyes) 1 2 3 4 What I want is niceplot to print GreenEyes bot 1 2 3 4 I want this so I can use it in a legend without having to type in GreenEyes... On 10

Re: [R] colname of ... arguments

2010-03-11 Thread ManInMoon
That is quite helpful David niceplot-function(...) { parms=list(...) for (x in parms) { xname - paste(deparse(substitute(x), 500), collapse = \n) cat(xname) } } GreenEyes=c(1,2,3,4) niceplot(GreenEyes) c(1, 2, 3, 4) BUT what I want is: GreenEyes=c(1,2,3,4) niceplot(GreenEyes)

[R] merging two datasets

2010-03-11 Thread n.via...@libero.it
I have some probems in merging the following datasets: table1 Paese Continente Italia EU franciaEU germania EU stati uniti AM canadaAM table2 Continente

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 11.03.2010 10:08:58: Hi, I think you do need an Internet connection to access the help files with R2.10. I presume the OP is working with Windows. I do not think Internet connection is necessary. It is necessary to have some browser installed.

Re: [R] merging two datasets

2010-03-11 Thread Ivan Calandra
Hi, What about merge(table1, table2)? See ?merge for more details Ivan Le 3/11/2010 10:15, n.via...@libero.it a écrit : I have some probems in merging the following datasets: table1 Paese Continente Italia EU franciaEU

[R] Group by

2010-03-11 Thread ManInMoon
I have a matrix with a POSIXct as a numeric in the first column. I would like to create a new matrix that is grouped by my chosed time bars. i.e. So I would like to group by hour or day or 5 days, and have all my columns be summed or averaged or counted.. mydata: V1,V2,V3 10:03:13,3.4,1002

Re: [R] Forecast

2010-03-11 Thread Patrick Connolly
On Wed, 10-Mar-2010 at 10:58PM -0800, chinna wrote: | | sample report data that i want to forecast | | quarter quarter_index Revenue | 2007 Q1 1 $3,856,799 | 2007 Q2 2 $4,243,328 | 2007 Q3 3

Re: [R] colname of ... arguments

2010-03-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 11.03.2010 09:34:06: David, That's useful to highlight my problem. If instead of e=e we use a vector like GreenEyes: GreenEyes=c(1,2,3,4) niceplot(GreenEyes) 1 2 3 4 What I want is niceplot to print GreenEyes bot 1 2 3 4 I want

Re: [R] help about solving two equations

2010-03-11 Thread Berend Hasselman
Shaoqiong Zhao wrote: I am not sure if this is correct and also this can only solve one row. How to get the whole 1000 rows of p and q? You can try something like this: library(nleqslv) library(BB) fn - function(x, s){ f - rep(NA, length(x)) f[1] - digamma(x[1]) -

Re: [R] see the example and help me

2010-03-11 Thread chinna
Hi Peter konings, Sorry man the forecasted values i have given wrong once again see my question and please give me the answer. sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1 1 $3,856,799 2007

Re: [R] Forecast

2010-03-11 Thread chinna
Hi Patrick, Sorry man the forecasted values i have given wrong once again see my question and please give me the answer. sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1 1 $3,856,799 2007 Q2

[R] modifying the dots argument - how?

2010-03-11 Thread Mark Heckmann
Is there a way to modify the dots-argument? Let's consider I have a function that passes on its ... arguments to another function. For some reason I know, that some elements in ... will cause problems. Can I modify the ... structure somehow, e.g. delete elements? foo - function(...){

Re: [R] colname of ... arguments

2010-03-11 Thread Claudia Beleites
what about: niceplot-function(...) { arg.names - as.list (match.call () [-1]) for (a in seq_along (arg.names)) cat (as.character (as.expression (arg.names [[a]])), \n\n) } niceplot (greeneye, log (greeneye), 1:3) note that this works also if there is no greeneye Disclaimer: I don't know

Re: [R] modifying the dots argument - how?

2010-03-11 Thread Claudia Beleites
Mark, dots - list (...) gives you a list with the dots arguments if innerFoo expects not a list but normal arguments, do.call is your friend: do.call (innerFoo, dots) HTH schönen Tag, Claudia Mark Heckmann wrote: Is there a way to modify the dots-argument? Let's consider I have a function

Re: [R] colname of ... arguments

2010-03-11 Thread Duncan Murdoch
ManInMoon wrote: That is quite helpful David niceplot-function(...) { parms=list(...) for (x in parms) { xname - paste(deparse(substitute(x), 500), collapse = \n) cat(xname) } } GreenEyes=c(1,2,3,4) niceplot(GreenEyes) c(1, 2, 3, 4) BUT what I want is:

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Duncan Murdoch
Ivan Calandra wrote: Hi, I think you do need an Internet connection to access the help files with R2.10. No, it's all local, but you do need a web browser if you want to view the HTML help. If you don't want the HTML help, you can set the help type to text using

Re: [R] Forecast

2010-03-11 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 11.03.2010 11:51:19: Hi Patrick, Sorry man the forecasted values i have given wrong once again see my question and please give me the answer. sample report data that i want to forecast quarter quarter_index Revenue 2007 Q1

Re: [R] Group by

2010-03-11 Thread Henrique Dallazuanna
Try this: DF - read.csv(textConnection(V1,V2,V3 10:03:13,3.4,1002 10:03:14,5.6,1001 10:05:27,7.2,999 10:05:33,8.2,998), header = TRUE) tDates - strptime(DF$V1, %H:%M:%S) tDates[[2]] - floor(strptime(DF$V1, %H:%M:%S)[[2]] / 5) * 5 aggregate(DF[,c('V2', 'V3')], list(format(tDates,

[R] Name of frame

2010-03-11 Thread Tom Backer Johnsen
Is it possible to get hold of the name of a frame? Tom __ 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,

[R] Define column names to a series of data.frames

2010-03-11 Thread Nikos Alexandris
Greets to the list! I am aware that this topic has been discussed several times. And I've read quite some related posts [1]. Yet, can't seem to give a solution to my problem. I have 6 data frames consisting of 6 rows x 7 columns put together from other data.frames. Something like: a b c d e

[R] Comparing matrices

2010-03-11 Thread Esmail
Hello all, I have two matrices, pop and pop2, each the same number of rows and columns that I want to compare for equality. I am concerned about efficiency in this operation. I've tried a few things without success so far. Doing something simple like: if (pop==pop2) { cat('equal') } else {

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Ivan Calandra
Well, when I try to access help files (not all of them actually) without internet connection, I don't get anything. What is it related to then? Le 3/11/2010 13:06, Duncan Murdoch a écrit : Ivan Calandra wrote: Hi, I think you do need an Internet connection to access the help files with

[R] divid the rows of the matrix by the cector

2010-03-11 Thread khazaei
Hi, I have a matrix with m rows and n column and a vector with n elements. I want to divid each rows of the matrix by vector direcly. could you please hint me? Thank you khazaei __ R-help@r-project.org mailing list

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Uwe Ligges
On 11.03.2010 13:38, Ivan Calandra wrote: Well, when I try to access help files (not all of them actually) without internet connection, I don't get anything. What is it related to then? MAybe your browser tries to be too clever and goes to some kind of offline mode. But it should not since

Re: [R] divid the rows of the matrix by the cector

2010-03-11 Thread Dimitris Rizopoulos
say 'mat' is your matrix and 'vec' is your vector, then try this: mat / rep(vec, each = m) I hope it helps. Best, Dimitris On 3/11/2010 1:44 PM, khaz...@ceremade.dauphine.fr wrote: Hi, I have a matrix with m rows and n column and a vector with n elements. I want to divid each rows of the

Re: [R] Name of frame

2010-03-11 Thread Barry Rowlingson
On Thu, Mar 11, 2010 at 12:30 PM, Tom Backer Johnsen bac...@psych.uib.no wrote: Is it possible to get hold of the name of a frame? I can't see a direct way, but you could capture the output of print: framename=function(frame){capture.output(print(frame))}

Re: [R] divid the rows of the matrix by the cector

2010-03-11 Thread Henrique Dallazuanna
See ?sweep On Thu, Mar 11, 2010 at 9:44 AM, khaz...@ceremade.dauphine.fr wrote: Hi, I have a matrix with  m rows and n column  and a vector with n elements. I want to divid each rows of the matrix by vector direcly. could you please hint  me? Thank you khazaei

Re: [R] Group by

2010-03-11 Thread Linlin Yan
DF V1 V2 V3 1 10:03:13 3.4 1002 2 10:03:14 5.6 1001 3 10:05:27 7.2 999 4 10:05:33 8.2 998 DF2 - t(sapply(split(DF[,-1], gsub('(.{5}).*', '\\1:00', DF$V1)), colSums)) data.frame(V1 = rownames(DF2), DF2) V1 V2 V3 10:03:00 10:03:00 9.0 2003 10:05:00 10:05:00 15.4

Re: [R] Name of frame

2010-03-11 Thread Tom Backer Johnsen
Hmm. I need to do some pondering on that one. I do not really understand it, at least not yet. Tom Barry Rowlingson wrote: On Thu, Mar 11, 2010 at 12:30 PM, Tom Backer Johnsen bac...@psych.uib.no wrote: Is it possible to get hold of the name of a frame? I can't see a direct way,

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Ivan Calandra
The question is what should I do then to be able to access all the help files, even off-line? That would really help me to know it. Thanks Ivan Le 3/11/2010 13:46, Uwe Ligges a écrit : On 11.03.2010 13:38, Ivan Calandra wrote: Well, when I try to access help files (not all of them actually)

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Duncan Murdoch
On 11/03/2010 7:38 AM, Ivan Calandra wrote: Well, when I try to access help files (not all of them actually) without internet connection, I don't get anything. What is it related to then? When I do that, things just work. Why is that? Duncan Murdoch Le 3/11/2010 13:06, Duncan Murdoch

[R] Odp: Define column names to a series of data.frames

2010-03-11 Thread Petr PIKAL
Hi This seems to be nice example why lists shall be used and not several data frames scattered in environment. put your data frames to list lapply(list.of.data, function(x) names(x) - column_names) Regards Petr r-help-boun...@r-project.org napsal dne 11.03.2010 13:33:33: Greets to the

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Ivan Calandra
It is interesting because I've tried again with some functions and it does work perfectly without Internet connection. Actually, the problem might have been more related to some specific functions (and hence help files) than to the fact I was working off-line. But great, I don't have to worry

Re: [R] Define column names to a series of data.frames

2010-03-11 Thread Henrique Dallazuanna
You can try this: lapply(lapply(ls(pattern = 'DF[0-9]'), get), 'names-', c(SDev,PC1, PC2, PC3, PC4, PC5, PC6)) On Thu, Mar 11, 2010 at 9:33 AM, Nikos Alexandris nikos.alexand...@felis.uni-freiburg.de wrote: Greets to the list! I am aware that this topic has been discussed several

Re: [R] Define column names to a series of data.frames

2010-03-11 Thread Linlin Yan
It seems that the names of original data frames have not changed in this way. I guess textConnection() could help, like this: for (name in objects(pattern = df[0-9])) eval(parse(textConnection(paste('names(', name, ') - column_names' On Thu, Mar 11, 2010 at 9:25 PM, Henrique Dallazuanna

Re: [R] Define column names to a series of data.frames

2010-03-11 Thread Henrique Dallazuanna
Yes, just in the list. If they want change the name in Environment GlobalEnv: for(i in ls(pattern = DF[0-9])) assign(i, `names-`(get(i), c(SDev,PC1, PC2, PC3, PC4, PC5, PC6)), globalenv()) On Thu, Mar 11, 2010 at 10:39 AM, Linlin Yan yanlinli...@gmail.com wrote: It seems that the names

Re: [R] cluster analysis labels for dendrogram

2010-03-11 Thread Sarah Goslee
Hi Samantha, Did you check out the help for plclust? There's a labels argument that is used to label the leaves of your dendrogram. By default, the rownames of your dataframe are used. Sarah On Wed, Mar 10, 2010 at 9:01 PM, Samantha samantha.fra...@gmail.com wrote: Hi, I am clustering data

Re: [R] ANNOUNCE--Rdsm package, a threads-like environment for R

2010-03-11 Thread Norm Matloff
Guo-Hao Huang wrote: Date: Thu, 11 Mar 2010 14:55:35 +0800 From: Guo-Hao Huang guohao.hu...@gmail.com To: Norm Matloff matl...@cs.ucdavis.edu Cc: r-help@r-project.org Subject: Re: [R] ANNOUNCE--Rdsm package, a threads-like environment for R I am interested in Rdsm package, but I

Re: [R] Define column names to a series of data.frames

2010-03-11 Thread Linlin Yan
Amazing! I haven't seen usage of calling `names-` like this before. Thanks so much! On Thu, Mar 11, 2010 at 9:50 PM, Henrique Dallazuanna www...@gmail.com wrote: Yes, just in the list. If they want change the name in Environment GlobalEnv:  for(i in ls(pattern = DF[0-9]))       assign(i,

Re: [R] Comparing matrices

2010-03-11 Thread Ravi Varadhan
Look at: identical(pop, pop2) # if you want to do exact comparison Or all.equal(pop, pop2, tolerance=1.e-10) # if you want to allow for some small noise Ravi. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of

Re: [R] colname of ... arguments

2010-03-11 Thread Greg Snow
In the following code: y - 1 niceplot( x=y ) Do you want x, y, or 1? 1 is just the value, which you had already. If you want y then the deparse(substitute()) approach gives that to you as others have said. But if you want x, then you want to look at the names of the dots list, e.g.: tmp

Re: [R] colname of ... arguments

2010-03-11 Thread ManInMoon
Duncan, Thanks you - your deparse(substitute(...)) work - fantastic. But, when I pass in multiple arguments: f(z[,1],z[,2]) I only show first argument, rest shows up as NULL -- View this message in context: http://n4.nabble.com/colname-of-arguments-tp1588146p1588872.html Sent from the R help

Re: [R] Group by

2010-03-11 Thread ManInMoon
Thank you In the aggregate how does it know which column to group? I know you give it tDates as the second argument, but it doesn't know that is from DF - we could have put anything there I think... -- View this message in context: http://n4.nabble.com/Group-by-tp1588694p1589005.html Sent

Re: [R] cluster analysis labels for dendrogram

2010-03-11 Thread xian
Hi Samantha, You can check out the graph and source code on this page: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=79 best, Xian -- View this message in context: http://n4.nabble.com/cluster-analysis-labels-for-dendrogram-tp1588347p1588790.html Sent from the R help

[R] tm[,-1]

2010-03-11 Thread ManInMoon
This does what I was hoping it would: aggregate(tm[,-1],by=list(tm[,10]),FUN=mean) but I don't know what tm[,-1] means (well - the -1 bit anyway. Does it somehow means the whole matrix? Please don't tell me to check the manual - I tried and failed dismally... -- View this message in

[R] [R-pkgs] RSQLite 0.8-4 now on CRAN

2010-03-11 Thread Seth Falcon
A new version of RSQLite (0.8-4) is now available on CRAN. Highlights of this release: Version 0.8-4 - Fix a memory leak in bound parameter management and resolve a missing PROTECT bug that caused spurious crashes when performing many prepared queries. - There is now a fairly

[R] Data.frame Question

2010-03-11 Thread GULATI, BRIJESH (Global Markets FFO NY)
Hi: I want to add a constant to an existing col of the data.frame. I have the following dataset: structure(list(x = c(1, 1, 1, 1, 1), y = c(1, 1, 1, 1, 1)), .Names = c(x, y), row.names = c(NA, 5L), class = data.frame) I want to add a

Re: [R] Group by

2010-03-11 Thread Henrique Dallazuanna
tDates assumes DF$V1, which is from DF object. On Thu, Mar 11, 2010 at 11:13 AM, ManInMoon xmoon2...@googlemail.com wrote: Thank you In the aggregate how does it know which column to group? I know you give it tDates as the second argument, but it doesn't know that is from DF - we could

Re: [R] tm[,-1]

2010-03-11 Thread jim holtman
Please do check the Intro to R manual. Hint: section 2.7.3 ** 1. *A vector of negative integral quantities*. Such an index vector specifies the values to be *excluded* rather than included. Thus y - x[-(1:5)] gives y all but the first five elements of x. On

Re: [R] tm[,-1]

2010-03-11 Thread Rubén Roa
-Mensaje original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] En nombre de ManInMoon Enviado el: jueves, 11 de marzo de 2010 12:22 Para: r-help@r-project.org Asunto: [R] tm[,-1] This does what I was hoping it would:

Re: [R] tm[,-1]

2010-03-11 Thread Uwe Ligges
On 11.03.2010 12:22, ManInMoon wrote: This does what I was hoping it would: aggregate(tm[,-1],by=list(tm[,10]),FUN=mean) but I don't know what tm[,-1] means (well - the -1 bit anyway. Does it somehow means the whole matrix? Please don't tell me to check the manual - I tried and failed

Re: [R] Data.frame Question

2010-03-11 Thread Henrique Dallazuanna
Try this: sweep(DF, 2, 1:2, '+') On Thu, Mar 11, 2010 at 9:20 AM, GULATI, BRIJESH (Global Markets FFO NY) brijesh.gul...@baml.com wrote:       Hi:               I want to add a constant to an existing col of the data.frame. I have the following dataset:       structure(list(x = c(1, 1,

Re: [R] tm[,-1]

2010-03-11 Thread Ivan Calandra
I think (but I didn't follow what you're trying to do and what is what) that it means the whole matrix (tm) except the first column (therefore the - sign) Ivan Le 3/11/2010 12:22, ManInMoon a écrit : This does what I was hoping it would: aggregate(tm[,-1],by=list(tm[,10]),FUN=mean) but I

[R] Robust estimation of variance components for a nested design

2010-03-11 Thread S Ellison
One of my colleagues has a data set from a two-level nested design from which we would like to estimate variance components. But we'd like some idea of what the inevitable outliers are doing, so we were looking for something in R that uses robust (eg Huber) treatment and returns robust estimates

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread S Ellison
R starts its own mini web server which parses the raw text pages and serves them as HTML. It does so using a particular randomly chosen port number on 127.0.0.1 (localhost). The port number is listed in the message 'if nothing happens, you should open ' followed by a url to paste into your

Re: [R] How to install dependent packages automatically

2010-03-11 Thread Uwe Ligges
On 10.03.2010 23:45, Raphael Aggio wrote: Hi, I developed a package that requires 5 other packages. I was wondering if anyone knows how can I automatically download and install the required packages during the installation of my new package. My idea is to make this process easier to the final

Re: [R] using sprintf to pass a variable to a RMySQL query

2010-03-11 Thread Uwe Ligges
On 10.03.2010 12:45, alison waller wrote: Thanks Gabor, As I said I would like to use gsubfn, but I am having problems installing it, which I assume are due to some conflict with the current tcltk package Below is the error I got after issuing install.packages(gsubfn) Any advice?

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Uwe Ligges
On 11.03.2010 15:58, S Ellison wrote: R starts its own mini web server which parses the raw text pages No, actually it uses the parsed form of the Rd files anmd renders them in either html or other formats... and serves them as HTML. It does so using a particular randomly chosen port

Re: [R] colname of ... arguments

2010-03-11 Thread Duncan Murdoch
On 11/03/2010 7:25 AM, ManInMoon wrote: Duncan, Thanks you - your deparse(substitute(...)) work - fantastic. But, when I pass in multiple arguments: f(z[,1],z[,2]) I only show first argument, rest shows up as NULL Yes, that's because substitute has specific meanings for its two

Re: [R] Variable arguments to function

2010-03-11 Thread Uwe Ligges
On 10.03.2010 20:30, ManInMoon wrote: I understand you can pass a variable number of arguments to a function that is written to accept ... I have searched for any documentation on how to write such a function - could someone tell me where to look please The manual An Introduction to R

Re: [R] Help function ? in R 2.10.1

2010-03-11 Thread Ivan Calandra
Hi, (answer below) Le 3/11/2010 16:03, Uwe Ligges a écrit : On 11.03.2010 15:58, S Ellison wrote: R starts its own mini web server which parses the raw text pages No, actually it uses the parsed form of the Rd files anmd renders them in either html or other formats... and serves them as

Re: [R] divid the rows of the matrix by the cector

2010-03-11 Thread Ted Harding
matrix(1:12,nrow=3) # [,1] [,2] [,3] [,4] # [1,]147 10 # [2,]258 11 # [3,]369 12 t(t(matrix(1:12,nrow=3))/c(2,3,4,5)) # [,1] [,2] [,3] [,4] # [1,] 0.5 1.33 1.75 2.0 # [2,] 1.0 1.67 2.00 2.2 # [3,] 1.5

Re: [R] tm[,-1]

2010-03-11 Thread Karl Ove Hufthammer
On Thu, 11 Mar 2010 03:22:27 -0800 (PST) ManInMoon xmoon2000 @googlemail.com wrote: but I don't know what tm[,-1] means (well - the -1 bit anyway. Does it somehow means the whole matrix? No, it means everything except the first column. Please don't tell me to check the manual - I tried

Re: [R] help R non-parametric IRT simulation

2010-03-11 Thread Doran, Harold
Helen: It is good practice to reply not only to the responder to your post, but also to the list in general. I don't know of any methods for non-parametric ability estimation. The irt.ability function provides you with three options for estimating ability: the maximum likelihood estimate

[R] Calculate mean slope of a function

2010-03-11 Thread Antje Steller
Hallo, hope you can help me with this question: I have calculated a function using f-smooth.spline(data) and approxfun(f). Now I want to calculate the mean slope of the resulting function. Haven't found the right R command yet, maybe you can give me a hint. Thanx, Antje

Re: [R] Comparing matrices

2010-03-11 Thread Miguel Porto
Also look at ?any and ?all Very handy functions. Miguel On Thu, Mar 11, 2010 at 12:37 PM, Esmail esmail...@gmail.com wrote: Hello all, I have two matrices, pop and pop2, each the same number of rows and columns that I want to compare for equality. I am concerned about efficiency in

Re: [R] trouble calculating rates--sometimes the denominator is missing

2010-03-11 Thread Christopher W. Ryan
Thanks! I think that will do the trick. I had not known of the match function before. Always learn something new on this list. --Chris Christopher W. Ryan, MD SUNY Upstate Medical University Clinical Campus at Binghamton 425 Robinson Street, Binghamton, NY 13904 cryanatbinghamtondotedu If you

[R] Dicrete Laplace distribution

2010-03-11 Thread Raquel Nicolette
Hello, http://tolstoy.newcastle.edu.au/R/help/04/07/0312.html#0313qlink1 Could anybody tell me how to generate discrete Laplacian distribution? I need to sample uma discretised Laplacian density like this: J( g - g´) ~ exp (-lambda | g´ - g |) g in {0,…, gmax} Thanks,

[R] Different results for different order of factor levels?

2010-03-11 Thread Jarrod Morrice
Dear R community, I am a newbie to R and I am using lme() to analyzed a two way repeated measures ANCOVA on some data I have gathered. In producing some graphs based on the fixed effects I noticed that I get vary different results depending on how I order my levels in my factor statement

[R] Problem with rcmd SHLIB

2010-03-11 Thread denise xifaras
Hi all, I am trying to call a C function from R (version 2.10.1) on a windows machine. The C code is in a .c file, I have pasted the code below although I'm very confident that it does not contain any errors (it is not my code), but also, the problem that I have occurs with every .c file that

[R] multiplicative contraint in LS

2010-03-11 Thread stephenb
I have a model that can be estimated in nls mod.base - deriv(~(Jan+a1*Feb+a2*Mar+a3*Apr+a4*May+a5*Jun+a6*Jul+a7*Aug+a8*Sep+a9*Oct+a10*Nov+a11*Dec)*(b2*relAge+b3*relAge^2), c(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,b2,b3),

[R] Can't convert list to matrix properly

2010-03-11 Thread anna
Hi guys, here is a list of names that I have: MyList: myList-list(A, B,C,D) myList [[1]] [1] A [[2]] [1] B [[3]] [1] C [[4]] [1] D I want to turn this list into a matrix of 1 row and 4 columns with those four components (A, B, C, D) so here is what I do: myDataFrame - data.frame(myList)

Re: [R] Problem with rcmd SHLIB

2010-03-11 Thread stephenb
I have never got it working with rcmd SHLIB. it is much easier to create a shared library separately with the C compiler and then load it with dyn.load the makefiles for SHLIB are quite big and going through them will give you a headache, so just use the flag for a dll when you compile. -- View

Re: [R] Problem with rcmd SHLIB

2010-03-11 Thread Duncan Murdoch
On 11/03/2010 10:57 AM, denise xifaras wrote: Hi all, I am trying to call a C function from R (version 2.10.1) on a windows machine. The C code is in a .c file, I have pasted the code below although I'm very confident that it does not contain any errors (it is not my code), but also, the

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread Miguel Porto
Hi, Is this what you want? matrix(unlist(myList),nr=1) Miguel On Thu, Mar 11, 2010 at 4:03 PM, anna lippelann...@hotmail.com wrote: Hi guys, here is a list of names that I have: MyList: myList-list(A, B,C,D) myList [[1]] [1] A [[2]] [1] B [[3]] [1] C [[4]] [1] D I want to

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread Ivan Calandra
Hi! Try: myMatrix - as.matrix(myDataFrame) Looking at ?data.matrix: Return the matrix obtained by converting all the variables in a data frame to numeric mode. You could also do directly: myMatrix - as.matrix(myList) Though you might need to transpose (see ?t) HTH, Ivan Le 3/11/2010

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread anna
Yes, definitely! so unlist() turns the list components into a vector? What if the component are vectors, matrices etc? Thank you Miguel! - Anna Lippel -- View this message in context: http://n4.nabble.com/Can-t-convert-list-to-matrix-properly-tp1589187p1589209.html Sent from the R help

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread anna
so I was getting ones because it converted the characters into numeric? - Anna Lippel -- View this message in context: http://n4.nabble.com/Can-t-convert-list-to-matrix-properly-tp1589187p1589211.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread Ivan Calandra
I would say so; it would make sense. Le 3/11/2010 17:16, anna a écrit : so I was getting ones because it converted the characters into numeric? - Anna Lippel -- Ivan CALANDRA PhD Student University of Hamburg Biozentrum Grindel und Zoologisches Museum Abt. Säugetiere

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread anna
ok guys, thanks a lot! - Anna Lippel -- View this message in context: http://n4.nabble.com/Can-t-convert-list-to-matrix-properly-tp1589187p1589246.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Can't convert list to matrix properly

2010-03-11 Thread Miguel Porto
see for yourself - AFAIK it'll just concatenate eveverything which is atomic into a vector, thus losing all the structure associated. Miguel On Thu, Mar 11, 2010 at 4:14 PM, anna lippelann...@hotmail.com wrote: Yes, definitely! so unlist() turns the list components into a vector? What if

[R] logistic model diagnostics residuals.lrm {design}, residuals()

2010-03-11 Thread Chaudhari, Bimal
I am interested in a model diagnostic for logistic regression which is normally distributed (much like the residuals in linear regression with are ~ N(0,variance unknown). My understanding is that most (all?) of the residuals returned by residuals.lrm {design} either don't have a well defined

[R] mixed-effects survival

2010-03-11 Thread HAKAN DEMIRTAS
Hi, What R libraries should I use to implement mixed effects models with continuous time and discrete-time survival data? What if I have two crossed random effects? I'd appreciate any help. Regards, Hakan Demirtas [[alternative HTML version deleted]]

Re: [R] Help with aggregate and cor

2010-03-11 Thread James Marca
On Wed, Mar 10, 2010 at 07:48:45PM +, hadley wickham wrote: Run that function hourly with plyr output.hourly - dlply(df.i1,tshour,cor.dat) Why not output.hourly - ddply(df.i1,tshour,cor.dat) Doh! Because I didn't read the docs properly and missed it. Thanks, much nicer than

[R] Obtaining name of data frame used in a function argument

2010-03-11 Thread Jason Baucom
I'm writing a function that can take a data.frame as an argument. I'd like to be able to obtain the name of the data.frame and print it out within the function. My current function looks like this: examineIt-function(x) { print(nrow(x)) print(x[ceiling(runif(10)*nrow(x)),])

Re: [R] Obtaining name of data frame used in a function argument

2010-03-11 Thread Henrique Dallazuanna
Try this: foo - function(data)print(deparse(substitute(data))) foo(DF) On Thu, Mar 11, 2010 at 2:31 PM, Jason Baucom jason.bau...@ateb.com wrote: I'm writing a function that can take a data.frame as an argument. I'd like to be able to obtain the name of the data.frame and print it out within

Re: [R] which coefficients for a gam(mgcv) model equation?

2010-03-11 Thread Darren Norris
I have spent a few days trying to figure this from the reply out but am still stuck! I need the equation to reply to a request from a referee that was to: show the specific estimating equation associated with the fitted line. the model I am running is (I hope the data frame is not necessary as I

[R] console window always on top

2010-03-11 Thread Robert M. Flight
In R on Windows (ver 7) I have somehow set the preferences for the R console window to be always on top. I'm sure at the time I did this it seemed like a good idea, but in practice it is not. Unfortunately, I cannot remember where the setting is changed, and thus it is stuck this way. Does anyone

Re: [R] using sprintf to pass a variable to a RMySQL query

2010-03-11 Thread alison waller
Hi all, I re-installed R and tcltk. I find some of the documentation misleading as it indicates that tcltk is included with R. And when you type library() it shows tcltk, even though it hasn't been installed. Anyways, I've decided to go with sprintf. I am having errors with my query criteria.

[R] Help Files Now Load in the Internet Browser?

2010-03-11 Thread David Bapst
Hello, I recently had to reinstall R on my windows machine, because MASS mysteriously vanished from my packages list. Before, when I used help(), the files would load in a Windows help window. Now, the help files load in my internet browser, which actually is problematic because I always made use

[R] Help Files Now Load in the Internet Browser?

2010-03-11 Thread David Bapst
Hello, I recently had to reinstall R on my windows machine, because MASS mysteriously vanished from my packages list. Before, when I used help(), the files would load in a Windows help window. Now, the help files load in my internet browser, which actually is problematic because I always made use

Re: [R] Problem with rcmd SHLIB

2010-03-11 Thread denise xifaras
Thank you Duncan, the paths were first so that wasn't the problem, but when I changed to the directory of the file and then typed rcmd SHLIB it did work, like you said. Great news. Best, Denise --- On Thu, 3/11/10, Duncan Murdoch murd...@stats.uwo.ca wrote: From: Duncan Murdoch

Re: [R] see the example and help me

2010-03-11 Thread Jonathan Christensen
Hi, On Thu, Mar 11, 2010 at 3:46 AM, chinna durgache...@gmail.com wrote: Hi Peter konings, Sorry man the forecasted values i have given wrong once again see my question and please give me the answer. snip This is the forecasted report that i get using the reporting tool

[R] Fwd: function to create multiple matrices

2010-03-11 Thread Lanna Jin
Jim Holtman's solution generates a data frame that can be easily indexed by year: setwd(/r-help/2010-03-10) x - read.csv(restored.csv, as.is=TRUE) require(reshape) x.m - melt(x, id=c('Year', 'LocationID', 'SpeciesCode'), measure='PlotFreq') x.binary - cast(x.m, Year + LocationID ~ SpeciesCode,

Re: [R] console window always on top

2010-03-11 Thread Duncan Murdoch
On 11/03/2010 11:59 AM, Robert M. Flight wrote: In R on Windows (ver 7) I have somehow set the preferences for the R console window to be always on top. I'm sure at the time I did this it seemed like a good idea, but in practice it is not. Unfortunately, I cannot remember where the setting is

Re: [R] Help Files Now Load in the Internet Browser?

2010-03-11 Thread Duncan Murdoch
On 11/03/2010 12:21 PM, David Bapst wrote: Hello, I recently had to reinstall R on my windows machine, because MASS mysteriously vanished from my packages list. Before, when I used help(), the files would load in a Windows help window. Now, the help files load in my internet browser, which

  1   2   >