Re: [R] textbox in lattice

2010-06-02 Thread baptiste auguie
On 2 June 2010 07:55, Deepayan Sarkar deepayan.sar...@gmail.com wrote: Something like this should also work, except that the grob produced by tableGrob() doesn't seem to know its height. Indeed, I have not been successful in writing good widthDetails/heightDetails methods for this grob since

[R] which function

2010-06-02 Thread arnaud Gaboury
Dear group, Here is a list of elements : l - c(100415, 100416, 100419, 100420, 100421, 100422, 100423, 100426, 100427, 100428, 100429, 100430, 100503, 100504, 100505, 100506, 100507, 100510, 100511, 100512, 100513, 100514, 100517, 100518, 100519, 100520, 100521, 100524, 100525, 100526,

Re: [R] which function

2010-06-02 Thread arnaud Gaboury
The correct line is : l[(which(100420==l)-1):which(100420==l)] [1] 100419 100420 -Original Message- From: arnaud Gaboury [mailto:arnaud.gabo...@gmail.com] Sent: Wednesday, June 02, 2010 9:41 AM To: r-help@r-project.org Cc: 'arnaud Gaboury' Subject: which function Dear group,

Re: [R] which function

2010-06-02 Thread mohamed . lajnef
Hi Arnaud Try this l[((which(100420==l))-1):which(100420==l)] Regards Mo arnaud Gaboury arnaud.gabo...@gmail.com a écrit : Dear group, Here is a list of elements : l - c(100415, 100416, 100419, 100420, 100421, 100422, 100423, 100426, 100427, 100428, 100429, 100430, 100503, 100504,

Re: [R] which function

2010-06-02 Thread Ivan Calandra
Hi, Try with more parentheses: l[((which(100420==l))-1):which(100420==l)] [1] 100419 100420 It was interpreted as 4-(1:4)=3 2 1 0 Ivan Le 6/2/2010 09:41, arnaud Gaboury a écrit : Dear group, Here is a list of elements : l- c(100415, 100416, 100419, 100420, 100421, 100422, 100423, 100426,

Re: [R] R on the iPhone/iPad? Not so much....a GPL violation

2010-06-02 Thread Gustaf Rydevik
As I noted in my closing comments in my second post, if one has a desire to make R's functionality available on smartphones (iPhone, Android, etc.) or iPad-class devices, then a client/server approach may be the most efficient means to do so. That approach also avails you of more powerful

Re: [R] lapply with functions with changing parameters

2010-06-02 Thread Bunny, lautloscrew.com
Henrique, thx, your suggestion worked perfectly fine for me. On 01.06.2010, at 23:01, Henrique Dallazuanna wrote: lapply(mydf[-6], ccf, y = mydf[6]) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Seeking help on Vectorize()

2010-06-02 Thread Megh Dal
Dear falks, here I have written following function :   fn - Vectorize(function(x = 1:3, y = 3:6) {     x - matrix(x, nrow=1)     y - matrix(y, ncol=1)     dat - apply(x, 2, function(xx) {   apply(y, 1, function(yy) {  

Re: [R] storing output data from a loop that has varying row numbers

2010-06-02 Thread RCulloch
Hi Ivan, Thanks, Jorvis did answer the question - but good to know about list() and that matrix is no good for a mixture of output. I'm slowly getting my head around it! Thanks again for your help, it really was much appreciated! Ross -- View this message in context:

Re: [R] storing output data from a loop that has varying row numbers

2010-06-02 Thread RCulloch
Hi Jorvis, Many thanks for sorting that! I haven't seen it done that way before, so I'll have to look in to the properties of lapply a bit more to get a full appreciation of other approaches to looping data in R. Thanks again for your help, it is much appreciated, Ross -- View this message

Re: [R] storing output data from a loop that has varying row numbers

2010-06-02 Thread Joris Meys
Hi Ross, the trick is especially split() and unsplit(). Split() splits up the dataframe based on the combined factors, unsplit() transforms it to a dataframe again. This way you can do the calculation for a set of mini-dataframes that contain only the information for 1 combination of the factors.

Re: [R] Seeking help on Vectorize()

2010-06-02 Thread Joris Meys
Your arguments are not coming through. fn - function(x = 1:3, y = 3:6) { x - matrix(x, nrow=1) y - matrix(y, ncol=1) dat - apply(x, 2, function(xx) { apply(y, 1, function(yy) { return(xx + yy) } ) })

Re: [R] Faster union of polygons?

2010-06-02 Thread Remko Duursma
Baptiste, thanks for the tip but this would give me an approximate union, and I really need a (nearly) exact one. I am also not sure how to set the alpha parameter in a non-arbitrary way. Remko - Remko Duursma Research Lecturer Centre for

[R] Problems using gamlss to model zero-inflated and overdispersed count data: the global deviance is increasing

2010-06-02 Thread Strubbe Diederik
Dear all, I am using gamlss (Package gamlss version 4.0-0, R version 2.10.1, Windows XP Service Pack 3 on a HP EliteBook) to relate bird counts to habit variables. However, most models fail because “the global deviance is increasing” and I am not sure what causes this behaviour. The dataset

Re: [R] how to label the som notes by the majority vote

2010-06-02 Thread Joris Meys
Hi Changbin, I looked at your code again, and it appears as if you're using the mapping plot for something that it isn't meant for. The mapping shows you how many points you have in every circle, and these points are represented by the labels. Your first plot gives the majority vote. This said,

Re: [R] Problems using gamlss to model zero-inflated and overdispersed count data: the global deviance is increasing

2010-06-02 Thread Joris Meys
Hi Diederik, I can't say immediately why your models fail without seeing the data and running a number of tests. You could play around with the other parameters, as the problem might be related to the optimization algorithm. A different approach would be using the methods in the vegan package.

[R] About Error Message in readSeries function from Rmetrics

2010-06-02 Thread JOSH C. CHIEN
Hi all R users, I download market data from Yahoo Finance to save file in csv. But, I can't load data set into R successfully. I don't why ? Below is error message. data - readSeries(D:/data.csv,header=T,sep=,) Error in midnightStandard2(charvec, format) : 'charvec' has non-NA entries of

[R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Petr PIKAL
Dear all I encountered strange problem with regexpr replacement I made this character object str - 02.06.10 12:40 str(str) chr 02.06.10 12:40 I read in an object which seems to be quite similar str(as.character(becva$V1)[1]) chr 02.06.10 12:40 However I can not remove

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Joris Meys
Could you provide us with dput(becva$V1[1])? Cheers Joris On Wed, Jun 2, 2010 at 2:07 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Dear all I encountered strange problem with regexpr replacement I made this character object str - 02.06.10 12:40 str(str) chr 02.06.10 12:40

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Matt Shotwell
On Wed, 2010-06-02 at 08:07 -0400, Petr PIKAL wrote: Dear all I encountered strange problem with regexpr replacement I made this character object str - 02.06.10 12:40 str(str) chr 02.06.10 12:40 I read in an object which seems to be quite similar

[R] compute the associate vector of distances between leaves in a binary non-rooted tree

2010-06-02 Thread Arnau Mir Torres
Hello. I'd like to compute the associate vector of distances between leaves in a binary non-rooted tree. The definition of a distance between two leaves in a binary non-rooted tree is the number of edges in the path joining the two leaves. I've tried the ape package but I'm unable to find this

[R] Problems installing data package on Windows

2010-06-02 Thread Erick Rocha Fonseca
Dear all, I'm having difficulties installing a package on Windows. It has only R data files, no code. I've built it on a Linux platform and installed it there without problems. When I tried installing the .tar.gz on Windows, via install.packages, I got the following errors: Error in gzfile(file,

Re: [R] compute the associate vector of distances between leaves in a binary non-rooted tree

2010-06-02 Thread Joris Meys
Hi, with a little hack you can use the function cophenetic.phylo from ape. You just set all branch lengths to 1 : require(ape) tree - rtree(5,rooted=F) n - length(tree$edge.length) tree$edge.length - rep(1,n) cophenetic.phylo(tree) t3 t1 t2 t4 t5 t3 0 3 3 3 3 t1 3 0 2 4 4 t2 3 2

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Petr PIKAL
Hi dput(bbb) c(02.06.10 12:40 , 02.06.10 12:00 , 02.06.10 11:00 , 02.06.10 10:00 , 02.06.10 09:00 , 02.06.10 08:00 , 02.06.10 07:00 , 02.06.10 06:00 , 02.06.10 05:00 , 02.06.10 04:00 , 02.06.10 03:00 , 02.06.10 02:00 , 02.06.10 01:00 , 02.06.10 00:00 , 01.06.10

[R] charactor matrix convert to numeric matrix

2010-06-02 Thread Yuan Jian
Hello R experts, can you tell me a simple way to convert a charactor matrix to numeric matrix? if I use as.numeric, the matrix is converted to a vector. a-cbind(c(23,54,65),c(1,2,3)) a [,1] [,2] [1,] 23 1 [2,] 54 2 [3,] 65 3  as.numeric(a) [1] 23 54 65  1  2  3 thanks Jian

[R] About Error Message in readSeries function from Rmetrics

2010-06-02 Thread JOSH C. CHIEN
Hi all R users, I download market data from Yahoo Finance to save file in csv. But, I can't load data set into R successfully. I don't why ? Below is error message. data - readSeries(D:/data.csv,header=T,sep=,) Error in midnightStandard2(charvec, format) : 'charvec' has non-NA entries of

Re: [R] data frame manipulation with zero rows

2010-06-02 Thread Hadley Wickham
Hi Arnaud, I've added this case to the set of test cases in plyr and it will be fixed in the next version. Hadley On Tue, Jun 1, 2010 at 2:33 PM, arnaud Gaboury arnaud.gabo...@gmail.com wrote: Maybe not the cleanest way, but I create a fake data frame with one row so ddply() is happy!! if

[R] interp-problem

2010-06-02 Thread Dries Bonte
Dear R-users, I build already many contour graphs using the contour-procedure in R (akima library), after interpollating my data z on x,y (see e.g. graphs in this paper: http://www.biomedcentral.com/content/pdf/1471-2148-9-16.pdf). Now, however, i experience unexpected and completely

[R] writing a matrix in a file

2010-06-02 Thread amir
Hi, I want to write a matrix (n*m) in a file (Text file) such that the file will be as Result file (below). I use the below command but it write all numbers in one column, write(paste(matrixname),file=test.txt,append=TRUE) how can I do this? Result file: 55 -1 -1 -1 -1 88

Re: [R] charactor matrix convert to numeric matrix

2010-06-02 Thread jim holtman
try this: a-cbind(c(23,54,65),c(1,2,3)) a [,1] [,2] [1,] 23 1 [2,] 54 2 [3,] 65 3 mode(a) - 'numeric' a [,1] [,2] [1,] 231 [2,] 542 [3,] 653 On Wed, Jun 2, 2010 at 8:15 AM, Yuan Jian jayuan2...@yahoo.com wrote: Hello R experts, can you tell me a simple way to

Re: [R] charactor matrix convert to numeric matrix

2010-06-02 Thread Jorge Ivan Velez
Hi Jian, Try matrix(as.numeric(a), ncol = 2) HTH, Jorge On Wed, Jun 2, 2010 at 8:15 AM, Yuan Jian wrote: Hello R experts, can you tell me a simple way to convert a charactor matrix to numeric matrix? if I use as.numeric, the matrix is converted to a vector.

[R] Odp: charactor matrix convert to numeric matrix

2010-06-02 Thread Petr PIKAL
Hi you have several options apply(a, 2, as.numeric) matrix(as.numeric(a),3,2) b-as.numeric(a) dim(b)-c(3,2) Regards Petr r-help-boun...@r-project.org napsal dne 02.06.2010 14:15:25: Hello R experts, can you tell me a simple way to convert a charactor matrix to numeric matrix? if I use

Re: [R] writing a matrix in a file

2010-06-02 Thread jim holtman
try this: x - matrix(1:25,5) x [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 write.table(x, file='') V1 V2 V3 V4 V5 1 1 6 11 16 21 2 2 7 12 17 22 3 3 8 13 18 23

Re: [R] writing a matrix in a file

2010-06-02 Thread Jorge Ivan Velez
Hi Amir, Here is a suggestion: write.table(yourmatrix, mymatrix.txt, col.names = FALSE, row.names = FALSE, sep = \t, quote = FALSE) After executing this, you will see a mymatrix.txt file in your working directory. Here, typing getwd() in the R console may also help. Do not forget to take a look

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread jim holtman
You had the wrong case on 'w' and the wrong expression with [:space:]'; see below bbb - c(02.06.10 12:40 , 02.06.10 12:00 , 02.06.10 11:00 , + 02.06.10 10:00 , 02.06.10 09:00 , 02.06.10 08:00 , + 02.06.10 07:00 , 02.06.10 06:00 , 02.06.10 05:00 , + 02.06.10 04:00 , 02.06.10

Re: [R] writing a matrix in a file

2010-06-02 Thread Sean Anderson
On 10-06-02 10:34 AM, amir wrote: I want to write a matrix (n*m) in a file (Text file) such that the file will be as Result file (below). I use the below command but it write all numbers in one column, write(paste(matrixname),file=test.txt,append=TRUE) how can I do this? ... Matrix:

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Joris Meys
sub(\\s+$, '', bbb,perl=T) does it for me. On Wed, Jun 2, 2010 at 3:22 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi dput(bbb) c(02.06.10 12:40 , 02.06.10 12:00 , 02.06.10 11:00 , 02.06.10 10:00 , 02.06.10 09:00 , 02.06.10 08:00 , 02.06.10 07:00 , 02.06.10 06:00 ,

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Petr PIKAL
Hi thanks. I am puzzled what was wrong. Now even sub(' +$', '', bbb[1]) works. I am checking water throughput in nearby river and copying data from internet. So I wonder if there was some change recently as during floods they update it in about 10 minutes interval. Regards Petr jim holtman

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Matt Shotwell
On Wed, 2010-06-02 at 09:22 -0400, Petr PIKAL wrote: Hi dput(bbb) c(02.06.10 12:40 , 02.06.10 12:00 , 02.06.10 11:00 , 02.06.10 10:00 , 02.06.10 09:00 , 02.06.10 08:00 , 02.06.10 07:00 , 02.06.10 06:00 , 02.06.10 05:00 , 02.06.10 04:00 , 02.06.10 03:00 , 02.06.10

Re: [R] using the design matrix to correctly configure contrasts

2010-06-02 Thread Karl Brand
[Reposting to list] Thank you Rich. I still don't get it. If i understand correctly- the MMC example on maize data outlines an issue with the multiple ties between group means. As a result of this, user specified contrasts needed specifying. Its this part, understanding the design matrix

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Joris Meys
Hi Petr, Matt may very well have been right. As I copied the dput from the mail, any white space is converted to spaces apparently. Still, it might be possible the white spaces in your original data are tabs or even newline characters. You can check that easily with grep(\t,

Re: [R] data frame manipulation with zero rows

2010-06-02 Thread arnaud Gaboury
I do really think it is a very good idea. TY -Original Message- From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On Behalf Of Hadley Wickham Sent: Wednesday, June 02, 2010 3:31 PM To: arnaud Gaboury Cc: Peter Ehlers; r-help@r-project.org; Prof Brian Ripley Subject: Re:

[R] bind select data frames

2010-06-02 Thread arnaud Gaboury
Dear group, Here is my environment: ls() [1] DailyPL100419 DailyPL100420 DailyPL100421 ddi l PLglobal Pos100416 Pos100419 Pos100420 Pos100421 position [13] resultsel Trad100416Trad100419 Trad100420Trad100421trade With

Re: [R] Problems installing data package on Windows

2010-06-02 Thread Erich Neuwirth
Did you try using the type=source parameter for install.packages? On Jun 2, 2010, at 3:02 PM, Erick Rocha Fonseca wrote: Dear all, I'm having difficulties installing a package on Windows. It has only R data files, no code. I've built it on a Linux platform and installed it there without

[R] lattice, xyplot, using panel.segments by just addressing one panel

2010-06-02 Thread Doris
Hi R experts, I'm using the xyplot function in lattice to draw a multipanel plot consiting of 5x6 scatterplots. Now I need to link single points in each of those scatterplots (=panel),but the points, that need linking are different for each panel. I tried to use the panel.segments function for

Re: [R] bind select data frames

2010-06-02 Thread Joshua Wiley
Hello, Does this do what you are looking for? output - NULL for(i in paste(DailyPL, sel, sep=)[-1]){ output - rbind(output, get(i)) } If you just want to rbind all the data frames, there are ways of doing it without a loop too, but since you specifically asked with

Re: [R] bind select data frames

2010-06-02 Thread arnaud Gaboury
Yes indeed I just want to rbind the data frames with numbers belonging to sel, and if possible, avoid a loop. To be more precise, if sel[-1]-c(100420, 100421), I look for a line which will give me this result : dd-rbind(DailyPL100420,DailyPL100421) -Original Message- From: Joshua

Re: [R] regexpr mystery can not remove trailing spaces

2010-06-02 Thread Petr PIKAL
Hi I have original data for which sub(' +$', '', ...) did not work in Excel so I could try them again. grep(\t, as.character(becva$V1[1])) integer(0) grep(\n, as.character(becva$V1[1])) integer(0) and Jim's solutions work as expected sub('[[:space:]]+$', '', becva$V1[1]) [1] 02.06.10 12:40

Re: [R] bind select data frames

2010-06-02 Thread arnaud Gaboury
I am working with something like this : for (i in sel[-1]) { dd-data.frame(do.call(rbind, mget(paste(DailyPL,i,sep=),envir=.GlobalEnv)),row.names=NULL) } But the result is not good. In the case where sel[-1]-c(100420, 100421), dd is only equal to DailyPL100421

Re: [R] bind select data frames

2010-06-02 Thread Joshua Wiley
This should do the trick: dd - do.call(rbind, mget(paste(DailyPL,sel[-1], sep=), envir=.GlobalEnv)) On Wed, Jun 2, 2010 at 8:06 AM, arnaud Gaboury arnaud.gabo...@gmail.com wrote: I am working with something like this :  for (i in sel[-1])  { dd-data.frame(do.call(rbind,

Re: [R] bind select data frames

2010-06-02 Thread Jorge Ivan Velez
Hi Arnaud, Try the following (untested): txt - paste('DailyPL',c(100419, 100420, 100421), sep = ) do.call(rbind, lapply(txt, get)) HTH, Jorge On Wed, Jun 2, 2010 at 10:24 AM, arnaud Gaboury wrote: Dear group, Here is my environment: ls() [1] DailyPL100419 DailyPL100420 DailyPL100421

Re: [R] bind select data frames

2010-06-02 Thread Joshua Wiley
On Wed, Jun 2, 2010 at 8:06 AM, arnaud Gaboury arnaud.gabo...@gmail.com wrote: I am working with something like this :  for (i in sel[-1])  { dd-data.frame(do.call(rbind, mget(paste(DailyPL,i,sep=),envir=.GlobalEnv)),row.names=NULL)               } But the result is not good. In the case

Re: [R] Seeking help on Vectorize()

2010-06-02 Thread Dennis Murphy
Hi: This is shorter: t(outer(x, y, '+')) [,1] [,2] [,3] [1,]456 [2,]567 [3,]678 [4,]789 [5,]89 10 HTH, Dennis On Wed, Jun 2, 2010 at 2:25 AM, Megh Dal megh700...@yahoo.com wrote: Dear falks, here I have written following function

Re: [R] bind select data frames

2010-06-02 Thread Jorge Ivan Velez
Hi Arnaud, Just replace c(...) by sel[-1] in the paste(...) call and you will be ready to go. Regards, Jorge On Wed, Jun 2, 2010 at 11:13 AM, arnaud Gaboury wrote: Jorge, Your line works and give the desired result. Now I need to be able to work with i instead of 100419..., as I need to

Re: [R] bind select data frames

2010-06-02 Thread arnaud Gaboury
Yes Joshua, it does the trick. Once more, I am surprised by the easiness and obviousness of R. Now, I would like to add argument row.names=NULL. dd - do.call(rbind, mget(paste(DailyPL,sel[-1], sep=), envir=.GlobalEnv),row.names=NULL) Error in do.call(rbind, mget(paste(DailyPL, sel[-1], sep =

Re: [R] Help barplots

2010-06-02 Thread khush ........
Hi all, I want to draw a arrow (small) of any length along with OsCYP right side i.e parrallel and antiparallel arrows both text(os[1], 10.2, pos = 4, OsCYP, font=1, cex = 1, col = red) and how can I connect two points with dotted line lets say bp[1 ]10.2

Re: [R] lattice, xyplot, using panel.segments by just addressing one panel

2010-06-02 Thread Peter Ehlers
Doris, You might get lucky and find some kind soul who's willing to dig through your *un*reproducible code, but your chances for help would probably increase dramatically if you were to provide *reproducible* and *minimal* code to illustrate your problem. I imagine that you might benefit from

Re: [R] bind select data frames

2010-06-02 Thread arnaud Gaboury
Here we go : dd-data.frame(do.call(rbind, mget(paste(DailyPL,sel[-1],sep=),envir=.GlobalEnv)),row.names=NULL) TY so much Joshua and Jorge. -Original Message- From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] Sent: Wednesday, June 02, 2010 5:11 PM To: arnaud Gaboury Cc:

[R] building time series/zoo/its from a data frame

2010-06-02 Thread Erin Hodgess
Dear R People: I have the following data frame: x.df datecond freq 1 04/01/09 Fever 12 2 04/02/09 Fever 11 3 04/03/09 Fever 10 4 04/04/09 Fever 13 5 04/05/09 Fever6 6 04/01/09Rash6 7 04/02/09Rash 10 8

Re: [R] R-help spam detection; please help the moderators

2010-06-02 Thread Joshua Wiley
Hello Martin and Ted, First off thank you to you guys and all the volunteers for providing this wonderful service. I have two questions. 1) Do you know if it is a problem to respond to a post from nabble using a gmail account? 2) Would it be easier for you if people just used non free

Re: [R] how to label the som notes by the majority vote

2010-06-02 Thread Changbin Du
Thanks, Joris! It works! I appreciated! On Wed, Jun 2, 2010 at 4:23 AM, Joris Meys jorism...@gmail.com wrote: Hi Changbin, I looked at your code again, and it appears as if you're using the mapping plot for something that it isn't meant for. The mapping shows you how many points you have

Re: [R] code for power and suffix for x,y labels in plot( ).

2010-06-02 Thread Joshua Wiley
On Tue, Jun 1, 2010 at 9:59 PM, Shant Ch sha1...@yahoo.com wrote: Hi I was trying to have a graph whose axes are X axis: m, Y axis: var[X ((a,b) in suffix, and (n,d) in the power)]. X ((a,b) in suffix, and (n,d) in the power)-        X^(n,d) _ (a,b). Actually I require many plots

Re: [R] compute the associate vector of distances between leaves in a binary non-rooted tree

2010-06-02 Thread Arnau Mir
El 02/06/10 15:14, Joris Meys escribió: Hi, with a little hack you can use the function cophenetic.phylo from ape. You just set all branch lengths to 1 : require(ape) tree - rtree(5,rooted=F) n - length(tree$edge.length) tree$edge.length - rep(1,n) cophenetic.phylo(tree) t3 t1 t2

Re: [R] Peak Over Threshold values

2010-06-02 Thread William Dunlap
-Original Message- From: Tonja Krueger [mailto:tonja.krue...@web.de] Sent: Monday, May 31, 2010 2:03 AM To: William Dunlap Cc: r-help@r-project.org Subject: RE: [R] Peak Over Threshold values Thanks a lot for your help. That's the time period I was looking for. I've got one

[R] Use apply only on non-missing values

2010-06-02 Thread Doran, Harold
I have a function that I am currently using very inefficiently. The following are needed to illustrate the problem: set.seed(12345) dat - matrix(sample(c(0,1), 110, replace = TRUE), nrow = 11, ncol=10) mis - sample(1:110, 5) dat[mis] - NA theta - rnorm(11) b_vector - runif(10, -4,4) empty -

Re: [R] building time series/zoo/its from a data frame

2010-06-02 Thread Dennis Murphy
Hi: Here's one approach, converting the sub-data frames to zoo objects: # Function to convert one of the data frames to a zoo object makezoo - function(df) { require(zoo) date - as.Date(df[, 1], format = '%m/%d/%y') with(df, zoo(freq, date)) } library(zoo) # Split the data

Re: [R] bind select data frames

2010-06-02 Thread arnaud Gaboury
Jorge, Your line works and give the desired result. Now I need to be able to work with i instead of 100419..., as I need to be able to change these numbers. TY for your help From: Jorge Ivan Velez [mailto:jorgeivanve...@gmail.com] Sent: Wednesday, June 02, 2010 5:09 PM To: arnaud Gaboury

[R] DEOptim Parameters

2010-06-02 Thread galen kaufman
I am trying to figure out how parameters are defined in a function that is used by DEOptim. That is, when I set upper and lower bounds for DEOptim how does it know which element of the function to apply those bounds to? For example, in DEOptim call below, when DEOptim goes into optimfxn how

Re: [R] using the design matrix to correctly configure contrasts

2010-06-02 Thread Walmes Zeviani
Take a look at contrast package. It has functions to handle with user contrasts. Below you have a reproducible and minimal example using contrast's functions. da - expand.grid(A=factor(paste(A, 1:3, sep=)), B=factor(paste(B, 1:4, sep=)), rep=1:4) eta - model.matrix(~A*B,

[R] glmnet strange error message

2010-06-02 Thread Dave_F
Hello fellow R users, I have been getting a strange error message when using the cv.glmnet function in the glmnet package. I am attempting to fit a multinomial regression using the lasso. covars is a matrix with 80 rows and roughly 4000 columns, all the covariates are binary. resp is an eight

Re: [R] running admb from R using system()

2010-06-02 Thread Uwe Ligges
On 31.05.2010 10:31, Benedikt Gehr wrote: Hi I'm trying to run an admb model from R by using the system () command. The admb model runs fine when running it from the admb command line or when using emacs. However when I try it with system() then R crashes every time. And I tried using the R

[R] Job Posting: Statistical Modeling and Advanced Analytics, Boston, All Levels

2010-06-02 Thread Iyue Sung
Position Profile: This position will work directly with the head of the Advanced Analytics group, as well as other members of the Marketing Evolution team, to design and perform analytical research necessary to address client's marketing issues. Responsibilities include

[R] help in expression( )

2010-06-02 Thread Shant Ch
Hi, I was trying to have a graph whose axes are of the following type: X axis: n and Y axis: var[U ((a,b) in suffix, and (n,d) in the power)]. U ((a,b) in suffix, and (n,d) in the power)-U^(n,d) _ (a,b). Actually I require many plots involving different values of a,b,n,d, so need to

Re: [R] using the design matrix to correctly configure contrasts

2010-06-02 Thread RICHARD M. HEIBERGER
Karl, The definition and interpretation of contrasts is part of any intermediate design of experiments text. Contrasts for interactions say that the effect of moving from level 1 of A to level 2 of A depends on the level of B. I will use notation YAB to indicate the levels of A and B. For

[R] Sweave glm.fit

2010-06-02 Thread Jimmy Söderly
Dear R users, After running Sweave, this is what I get : Warning messages: 1: glm.fit: algorithm did not converge 2: glm.fit: algorithm did not converge There is no glm.fit function in my code. Where does it come from ? From Sweave ? From system.time ? Thanks for your help, Jimmy

[R] ESS (emacs speaks statistics) saving history

2010-06-02 Thread Murat Tasan
hi folks, i use ESS mode in emacs often to interact with R, and while i know how to save a session transcript, i'm wondering how to save just the history of the commands (i.e. identically to how R gives the history save option from its native CLI). if you use ESS with an R process, commands

Re: [R] Sweave glm.fit

2010-06-02 Thread Erik Iverson
How could we possibly tell without your code? Do you call glm or fit *any* models in your code? Can you use traceback() to see the trace of function calls that generated the error? Jimmy Söderly wrote: Dear R users, After running Sweave, this is what I get : Warning messages: 1:

Re: [R] Sweave glm.fit

2010-06-02 Thread Erik Iverson
Erik Iverson wrote: How could we possibly tell without your code? Do you call glm or fit *any* models in your code? Can you use traceback() to see the trace of function calls that generated the error? Sorry you aren't getting an error, but a warning, my mistake.

Re: [R] ESS (emacs speaks statistics) saving history

2010-06-02 Thread RICHARD M. HEIBERGER
I think you are asking for M-x ess-transcript-clean-buffer Save your output file in a file named something.rt which will open in ess-transcript-mode. It opens read-only and you will need to C-x C-q to make it writable. Then run M-x ess-transcript-clean-buffer On Wed, Jun 2, 2010 at 2:35 PM,

Re: [R] help in expression( )

2010-06-02 Thread Uwe Ligges
On 02.06.2010 20:22, Shant Ch wrote: Hi, I was trying to have a graph whose axes are of the following type: X axis: n and Y axis: var[U ((a,b) in suffix, and (n,d) in the power)]. U ((a,b) in suffix, and (n,d) in the power)-U^(n,d) _ (a,b). Actually I require many plots involving

[R] pdf function, resize xyplot plot automatically

2010-06-02 Thread Afshartous, David
All, When saving plots to a pdf file via the pdf function, I would like to be able to automatically expand the graphics device to achieve the same result as when one does this manually (e.g., clicking the green expand button on the upper left of the graph on Mac OS). Consider simple example

Re: [R] Linear Discriminant Analysis in R

2010-06-02 Thread cobbler_squad
Joris, Thank you, I have corrected my mistakes. I very much appreciate your time and patience. All my best, Cobbler. -- View this message in context: http://r.789695.n4.nabble.com/Linear-Discriminant-Analysis-in-R-tp2231922p2240547.html Sent from the R help mailing list archive at Nabble.com.

[R] nnet: cannot coerce class c(terms, formula) into a data.frame

2010-06-02 Thread cobbler_squad
Dearest all, Objective: I am now learning neural networks. I want to see how well can train an artificial neural network model to discriminate between the two files I am attaching with this message. http://r.789695.n4.nabble.com/file/n2240582/3dMaskDump.txt 3dMaskDump.txt

Re: [R] predict.Arima: warnings from xreg magic

2010-06-02 Thread Huber2010
I found the same annoying warning, but I ignore it, as you said it's not use at all. The error (at least for me) is in the line class(xreg) - NULL This makes xreg a list, so you cannot apply cbindmaybe they will fix that some time in the future (you can always recompile the code) Huber

Re: [R] glmnet strange error message

2010-06-02 Thread Joris Meys
Could you give us the traceback? (In case you don't know, just type traceback() right after you got the error message.) I can't reproduce the error, so it gets a bit difficult to solve without having the real data. Cheers Joris On Wed, Jun 2, 2010 at 6:51 PM, Dave_F friedenbe...@battelle.org

Re: [R] building time series/zoo/its from a data frame

2010-06-02 Thread Gabor Grothendieck
r-help seems to have rejected the first attempt at sending this so I am trying again. read.zoo has a split= argument which lets you read in the data and split it all at the same time. You can also use it on a data frame. Due to a bug which is fixed in the development version, you will need the

[R] R linux install: FORTRAN compiling error

2010-06-02 Thread vaneet
Hello, I have basic familiarity with Unix but by most standards a novice. I am trying to install R on a linux machine and am following the instructions in the R install and admin guide in terms of what is required to compile the R source code. I downloaded R version 2.11.1 and extracted the

Re: [R] pdf function, resize xyplot plot automatically

2010-06-02 Thread Peter Ehlers
David, I would use either the 'width=' argument to pdf() or use a smaller font for the x-axis (or both). Something like: pdf(file = foo.pdf, width = 10) xyplot(Y ~ Time | as.factor(Subject), data = foo.frm, layout = c(2,2), scale = list(x = list( at = c(0, 15, 30,

[R] why the dim gave me different results

2010-06-02 Thread Changbin Du
dim(tmp) [1] 576 12 tmp 1 10 11 12 13 2 3 4 5 6 7 9 10 0 0 0 0 0 0 12 0 0 0 0 20 0 0 0 0 0 0 15 0 0 0 0 30 0 0 0 0 0 0 11 0 0 0 0 40 0 0 0 0 0 0 11 0 0 0 0 50 0 0 0 0 0 0 12 0 0 0 0 60 0 0 0

Re: [R] why the dim gave me different results

2010-06-02 Thread Joris Meys
Hi Changbin, it's not line numbers. It's row names, and you deleted some of them. If you checked, you'd have seen that eg 107-109 are missing. So you have 576 lines left from a matrix that had 600 when it was formed. Cheers Joris On Wed, Jun 2, 2010 at 11:47 PM, Changbin Du changb...@gmail.com

Re: [R] why the dim gave me different results

2010-06-02 Thread Phil Spector
Changbin - If you take the time to look at your data frame, you'll see the following 24 numbers are missing from the rownames. 78 84 107 108 109 158 164 194 197 203 240 241 243 255 256 264 275 277 282 284 300 305 311 312 (I found this using (1:600)[!(1:600) %in% rownames(tmp)] )

Re: [R] why the dim gave me different results

2010-06-02 Thread Murat Tasan
row names are not the same as line numbers or indices. you've likely done some row-based selection on an original matrix or data frame. observe from the example below. (and in the future please don't expect people to sort through your 500+ line matrices by hand to find your problems.) x -

Re: [R] why the dim gave me different results

2010-06-02 Thread RICHARD M. HEIBERGER
This is a guess since you didn't say where it comes from. It looks like a data.frame where some rows were deleted. Also, note that the column names in your example are sorted alphabetically instead of numerically. This example shows one way to get that behavior. Rich tmp -

Re: [R] R linux install: FORTRAN compiling error

2010-06-02 Thread Matt Shotwell
This is not an issue with R, but with gfortran. See the following: http://gcc.gnu.org/wiki/GFortran#news (under heading gfortran 4.5) http://gcc.gnu.org/ml/fortran/2010-04/msg00061.html Also, I suspect you are using a precompiled gcc/gfortran, and it assumes you have libmpc.so.2

Re: [R] why the dim gave me different results

2010-06-02 Thread Changbin Du
Thanks all of you, I appreciated! On Wed, Jun 2, 2010 at 2:58 PM, Phil Spector spec...@stat.berkeley.eduwrote: Changbin - If you take the time to look at your data frame, you'll see the following 24 numbers are missing from the rownames. 78 84 107 108 109 158 164 194 197 203 240 241

[R] Draw text with a box surround in plot.

2010-06-02 Thread guox
text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Thanks, -james __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] nnet: cannot coerce class c(terms, formula) into a data.frame

2010-06-02 Thread Joris Meys
Without checking R or the rest of the code, the error seems quite clear to me: R finds a formula where it expects a data frame. cvc_lda is not a dataframe. Do str(cvc_lda) to check for yourself. You really need to learn this btw. Whenever you get an error, first thing to do is to check whether

Re: [R] Draw text with a box surround in plot.

2010-06-02 Thread Peter Ehlers
On 2010-06-02 16:57, g...@ucalgary.ca wrote: text() can draw text on a plot. Do we have a way/function to draw text with a box surround it? Thanks, There may be a function in some package, but I would just use rect(). ?rect -Peter Ehlers __

Re: [R] Use apply only on non-missing values

2010-06-02 Thread Joris Meys
Not really a direct answer on your question, but: system.time(replicate(1,apply(as.matrix(theta), 1, rasch, b_vector))) user system elapsed 4.510.034.55 system.time(replicate(1,theta%*%t(b_vector))) user system elapsed 0.250.000.25 It does make a

[R] Nested ANOVA with covariate using Type III sums of squares

2010-06-02 Thread Anita Narwani
Hello, I have been trying to get an ANOVA table for a linear model containing a single nested factor, two fixed factors and a covariate: carbonmean-lm(C.Mean~ Mean.richness + Diversity + Zoop + Diversity/Phyto + Zoop*Diversity/Phyto) where, *Mean.richness* is a covariate*, Zoop* is a

  1   2   >