Re: [R] Regression Analysis or Anova?

2012-05-15 Thread Robert Latest
Hello Andrea, I don't know if I can help you (probably not, I'm a beginner myself), but you that you should make it a lot easier for those that can if you post a self-contained script in this forum that shows what you're trying to do. Use dput() to dump your dataset in text form. Good luck, rober

[R] code to iterate function apply to matrix

2012-05-15 Thread umai88
I got this code below and i want to repeat the loop for 100 times.. x<-rnorm(60) mat1<-matrix(x,nrow=15,ncol=4) trim<-numeric(ncol(mat1)) win<-numeric(ncol(mat1)) ssd<-numeric(ncol(mat1)) for(j in 1:ncol(mat1)) { n=length(mat1[,j]) alpha=0.1 k=floor(alpha*n)+1 r=k-(alpha*n) i=k+1 m=n-k y1<-sort(

Re: [R] Error on easy way for JoSAE Package

2012-05-15 Thread ana24maria
Thank you very much. After using dput and the easy way (> result <- eblup.mse.f.wrap(domain.data = amigo, lme.obj = fit.lme)), i have got the following error: Error in `[.data.frame`(sample.data, , variabs) : undefined columns selected What should I do? -- View this message in context:

Re: [R] Discrete choice model maximum likelihood estimation

2012-05-15 Thread Joshua Wiley
On Tue, May 15, 2012 at 9:57 PM, Bert Gunter wrote: > Hmmm... So you want to fit a nonlinear model with 24 parameters??!! > > I would bet that you'll need to sacrifice some chickens to the > nonlinear optimization gods to get something meaningful from that > exercise. Nominated for a fortune. >

Re: [R] Discrete choice model maximum likelihood estimation

2012-05-15 Thread Bert Gunter
Hmmm... So you want to fit a nonlinear model with 24 parameters??!! I would bet that you'll need to sacrifice some chickens to the nonlinear optimization gods to get something meaningful from that exercise. :( -- Bert On Tue, May 15, 2012 at 5:26 PM, infinitehorizon wrote: > Hello John, > > Tha

Re: [R] Scraping a web page.

2012-05-15 Thread Duncan Temple Lang
Hi Keith Of course, it doesn't necessarily matter how you get the job done if it actually works correctly. But for a general approach, it is useful to use general tools and can lead to more correct, more robust, and more maintainable code. Since htmlParse() in the XML package can both retrieve

Re: [R] Splus equivalent of reshape in R

2012-05-15 Thread David Winsemius
On May 15, 2012, at 11:18 PM, Santosh wrote: Hello R/Splus users.. I am posting in R discussion group in hope of wider response compared to what I received from Splus user groups Was wondering if there is any function available in Splus 8.2 that is equivalent to "reshape" of R? Below i

Re: [R] confidence intervals for nls or nls2 model

2012-05-15 Thread Gabor Grothendieck
On Tue, May 15, 2012 at 11:20 PM, Gabor Grothendieck wrote: > On Tue, May 15, 2012 at 8:08 PM, Francisco Mora Ardila > wrote: >> Hi all >> >> I have fitted a model usinf nls function to these data: >> >>> x >>  [1]   1   0   0   4   3   5  12  10  12 100 100 100 >> >>> y >>  [1]  1.281055090  1.5

Re: [R] confidence intervals for nls or nls2 model

2012-05-15 Thread Gabor Grothendieck
On Tue, May 15, 2012 at 8:08 PM, Francisco Mora Ardila wrote: > Hi all > > I have fitted a model usinf nls function to these data: > >> x >  [1]   1   0   0   4   3   5  12  10  12 100 100 100 > >> y >  [1]  1.281055090  1.563609934  0.001570796  2.291579783  0.841891853 >  [6]  6.553951324 14.243

Re: [R] write data using xlsReadWrite

2012-05-15 Thread David Winsemius
On May 15, 2012, at 10:08 PM, diyanah wrote: Hai, I use these codes to read my data from the above data that I create, but how can I get rid of the first V1, because it is row number, not one of my data value. Why do you want to get rid of it? What harm is it doing? (Dataframes need to

[R] Splus equivalent of reshape in R

2012-05-15 Thread Santosh
Hello R/Splus users.. I am posting in R discussion group in hope of wider response compared to what I received from Splus user groups Was wondering if there is any function available in Splus 8.2 that is equivalent to "reshape" of R? Below is a sample dataset. Size [both rows and columns) of

Re: [R] simple question about max(x,y)

2012-05-15 Thread David Winsemius
On May 15, 2012, at 8:42 PM, lapertem4 wrote: x <- 3 y <- 4 max(x,y) 4 how can i get the greater variable name y Option one: > test <- function(x,y) { c("x","y")[which.max(c(x,y))]} > test(3,4) [1] "y" > test(4,3) [1] "x" Option two: > test <- function(x,y) { xn <- depar

Re: [R] write data using xlsReadWrite

2012-05-15 Thread diyanah
Hai, I use these codes to read my data from the above data that I create, but how can I get rid of the first V1, because it is row number, not one of my data value. Second, how can I read row 1 and only column 1 (V2 value for example). setwd("D:\\FYP\\image\\Cropped Images\\user61") info <-read.x

[R] Getting reliable financial ratios

2012-05-15 Thread michaelyb
Hello all, I am having some trouble finding a good csv file or even any kind of table with the financial ratios (i.e. P/E ratio, ROI, ROA etc.) from the Internet. I was able to find a good source with poor information. That wouold be Finviz.com. Another option would be creating a XML function loop

[R] simple question about max(x,y)

2012-05-15 Thread lapertem4
x <- 3 y <- 4 max(x,y) 4 how can i get the greater variable name y thanks -- View this message in context: http://r.789695.n4.nabble.com/simple-question-about-max-x-y-tp4630201.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Discrete choice model maximum likelihood estimation

2012-05-15 Thread infinitehorizon
Hello John, Thanks for your response. Can you explain why it is better to use NM or nmk instead of optim? By the way, my original model consists 24 parameters. In this case is it still better to use NM or nmk? Best, Marc John C Nash wrote > > Your function will not evaluate as coded. i.e., l

[R] vars plot predicted values on original scale

2012-05-15 Thread maria31
Hi all! I´m using vars package to model several pairs of time series; in future I have to do multivar with sets of dimension 10 to 30 series; As I have to transform data (usually log and 1diff ) in order to apply VAR(p) I wonder if there´s any function to plot or print predicted values on original

[R] vector w/o arithmetic addition for boxplot

2012-05-15 Thread rl269
Hello, I am having trouble asking R to read individual numeric vectors for a box plot of the residuals of a linear regression. It is performing arithmetic addition on the 16 individual variables that I want individual box plots for. I have 16 race*treatment variables that were created from clea

Re: [R] write data using xlsReadWrite

2012-05-15 Thread diyanah
Thank you, I came up with these. Problem solve. varValue <- data.frame(varLH2x, varLH2y, varHH2x, varHH2y, varLL2x, varLL2y, varHL2x, varHL2y) res<-write.xlsx(varValue, "D:\\FYP\\image\\Cropped Images\\user61\\genuineUser61temp.xlsx", sheetName="Sheet1",col.names=TRUE, row.names=TRUE, append=FALS

Re: [R] Last element of a vector by group

2012-05-15 Thread R. Michael Weylandt
? duplicated !duplicated(a.ord, fromLast = TRUE) HTH, Michael On Tue, May 15, 2012 at 9:37 PM, Axel Urbiz wrote: > Dear List, > > How can I get a logical vector as shown by a.ord.last below (i.e., it is > FALSE whenever there are subsequent equal values of an ordered vector and > FALSE otherwi

[R] Last element of a vector by group

2012-05-15 Thread Axel Urbiz
Dear List, How can I get a logical vector as shown by a.ord.last below (i.e., it is FALSE whenever there are subsequent equal values of an ordered vector and FALSE otherwise)? a <- c(1,1,2,1,3,4,3,5,6) a.ord <- a[order(a)] a.ord a.ord.last <- c(F, F, T, T, F, T, T, T, T) Thanks for any help

Re: [R] confidence intervals for nls or nls2 model

2012-05-15 Thread Francisco Mora Ardila
On Tue, 15 May 2012 20:33:02 -0400, David Winsemius wrote > On May 15, 2012, at 8:08 PM, Francisco Mora Ardila wrote: > > > Hi all > > > > I have fitted a model usinf nls function to these data: > > > >> x > > [1] 1 0 0 4 3 5 12 10 12 100 100 100 > > > >> y > > [1] 1.281055090 1.5

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread Rich Shepard
On Tue, 15 May 2012, ilai wrote: Apologies in advance if I misinterpret " R console insists that I retype ..." but actually makes more sense (than sourcing a script) to use the group argument (see the last example in ?qqmath) as in 4 groups in each of 30 panels, or allow.multiple=T, outer=T if y

Re: [R] confidence intervals for nls or nls2 model

2012-05-15 Thread David Winsemius
On May 15, 2012, at 8:08 PM, Francisco Mora Ardila wrote: Hi all I have fitted a model usinf nls function to these data: x [1] 1 0 0 4 3 5 12 10 12 100 100 100 y [1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853 [6] 6.553951324 14.243274230 14.519899320

[R] How to use the value of "rect" to determine the location of legend

2012-05-15 Thread Gundala Viswanath
Given the attached plot, how can I locate the center text with "Mean and SD" so that it can be placed exactly under "---emp".? The current code I have is this: L = list(bquote(Em.Mean ==.(new_avg)),bquote(Em.SD==.(new_std)), bquote(Th.Mean ==.(theor_avg)), bquote(Th.SD==.(theor_sd))) leg

[R] confidence intervals for nls or nls2 model

2012-05-15 Thread Francisco Mora Ardila
Hi all I have fitted a model usinf nls function to these data: > x [1] 1 0 0 4 3 5 12 10 12 100 100 100 > y [1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853 [6] 6.553951324 14.243274230 14.519899320 15.066473610 21.728809880 [11] 18.553054450 23.722637370

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread ilai
On Tue, May 15, 2012 at 4:19 PM, Rich Shepard wrote: > On Tue, 15 May 2012, David L Carlson wrote: > > David, > >  I have 130 plots to produce (30 chemicals un-transformed and three > transformations). The R console insists that I retype each of the 6 lines > (adding a prepanel.qqmathline line) ea

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread Rich Shepard
On Tue, 15 May 2012, David L Carlson wrote: qqmath(~ rnorm(100), panel = function(x, ...) { panel.qqmathline(x, ...) panel.qqmath(x, ...) }) David, I have 130 plots to produce (30 chemicals un-transformed and three transformations). The R console insists that I retype each of the 6

Re: [R] Reading Excel Formulas as values

2012-05-15 Thread Peter Alspach
Tena koe Mike Another alternative to those already given is to use the RODBC package. HTH Peter Alspach. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mike Smith Sent: Wednesday, 16 May 2012 8:11 a.m. To: r-help@r-project.

[R] double buffering in windows() not working

2012-05-15 Thread Daniel Carr
I have doubled buffered animations that I show in class. They used to work but now flash. The default windows() option is buffered = TRUE. Just in case, I tried using windows( buffered = TRUE) but this made no difference. I am not sure when the change occurred. An older R2.11 version in one cla

Re: [R] Reading Excel Formulas as values

2012-05-15 Thread Gabor Grothendieck
On Tue, May 15, 2012 at 4:11 PM, Mike Smith wrote: > When I read excel files using the read.xlsx() command any cells that have > formulas in them come up as NA. > > Is there a way to read just the numeric value of the cell without using the > "paste value" command in Excel?  I need to read in hund

Re: [R] Reading Excel Formulas as values

2012-05-15 Thread R. Michael Weylandt
It sounds like this might actually make more sense to do in VBA and not R (gasp!) if your only goal is to have excel in --> excel out. [UNTESTED] As far as a workaround if you really want to do this in R, perhaps you can specify that you want character vectors everywhere and your connection client

[R] Reading Excel Formulas as values

2012-05-15 Thread Mike Smith
When I read excel files using the read.xlsx() command any cells that have formulas in them come up as NA. Is there a way to read just the numeric value of the cell without using the "paste value" command in Excel? I need to read in hundreds of Excel spreadsheets and compile them into one large su

Re: [R] Odd behaviour of identical()

2012-05-15 Thread math_daddy
Thanks. I was not aware of these subtleties of R, but then again I'm no expert. I had to use isTRUE(all.equal(vec,c(0,0))), but it seems to be working now. Thanks again. -- View this message in context: http://r.789695.n4.nabble.com/Odd-behaviour-of-identical-tp4630118p4630170.html Sent from t

[R] Regression Analysis or Anova?

2012-05-15 Thread Andrea Sica
Dear all, I hope to be the clearest I can. Let's say I have a dataset with 10 variables, where 4 of them represent for me a certain phenomenon that I call Y. The other 6 represent for me another phenomenon that I call X. Each one of those variables (10) contains 37 units. Those units are just the

Re: [R] Kerning of italic text in plotmath

2012-05-15 Thread David Winsemius
On May 15, 2012, at 3:23 PM, Fisher Dennis wrote: David You missed the point -- the issue was not the spacing between WORDS. Or perhaps the point was obscured by your extraneous code. It was the spacing between LETTERS (as noted in the original email) Other suggestions would be helpful.

[R] Problem to resolve a step for reading a large TXT and split in several file

2012-05-15 Thread gianni lavaredo
Dear Researchs, It's the first time I am trying to resolve this problem. I have a TXT file with 1408452 rows. I wish to split file-by-file where each file has 1,000,000 rows with the following procedure: # split in two file one with 1,000,000 of rows and one with 408,452 of rows file <- "09G001_

[R] How to include known errors in a regression?

2012-05-15 Thread Robert Latest
Hello all, I have a bunch of aggregated measurement data. The data describe two different physical properties that correlate, and I want to estimate the coefficients (slope and intercept) from the dataset. This is of course easy, I've done it, and I got the expected result. But here's the thing:

Re: [R] How to interpret an ANOVA result?

2012-05-15 Thread Robert Latest
On Tue, May 15, 2012 at 1:59 PM, Bryan Hanson wrote: > I see that no one has replied on this, so I'll take a stab. Hi, Ryan! > This is probably a matter of personal taste, but I would suggest a somewhat > different and simpler approach.  What you have done is not strictly an ANOVA, > it's a li

Re: [R] question about creating data frame

2012-05-15 Thread jim holtman
try this: > x <- read.table(text = '"Not A" "A" + "Mathematics" 80 15 + "Physics" 32 24 + "Biology" 18 29', skip = 1, as.is = TRUE) > > # create the result > result <- do.call(rbind, lapply(1:nrow(x), function(.row){ + data.frame(course = x$V1[.row] + , A = c(rep(1, x$V2[.row]), rep(0

Re: [R] help

2012-05-15 Thread Baoqiang
Package "mutoss" seems have Bonferroni correction. Sent from my iPhone On May 15, 2012, at 9:34 AM, 杨秀芬 wrote: > To whom this may concern, > > I have been learing R software. Recently when I did the analysis of the > associaiton of SNPs and disease, I have met one problem with Bonferroni > cor

Re: [R] Kerning of italic text in plotmath

2012-05-15 Thread Bert Gunter
I believe that this depends on the font in use and the graphics engine doing the rendering, which I believe may depend on the OS. You supplied none of this information -- it _is_ asked for in the posting guide -- but you might try changing your fonts,font size, and/or graphics device to see whethe

Re: [R] Master data frame or so

2012-05-15 Thread jim holtman
It sounds like just a simple list object will do what you want. What you will have to specify is exactly what you thing the structure might contain and then how you want to access it, and then possibly how you want to update it on an ongoing basis. On Tue, May 15, 2012 at 11:33 AM, I.R. Holtman

Re: [R] Kerning of italic text in plotmath

2012-05-15 Thread baptiste auguie
For better typography, try tikzDevice, it uses LaTeX to render the text. b. On 16 May 2012 07:23, Fisher Dennis wrote: > David > > You missed the point -- the issue was not the spacing between WORDS.  It was > the spacing between LETTERS (as noted in the original email) > Other suggestions woul

Re: [R] Kerning of italic text in plotmath

2012-05-15 Thread Fisher Dennis
David You missed the point -- the issue was not the spacing between WORDS. It was the spacing between LETTERS (as noted in the original email) Other suggestions would be helpful. Dennis Dennis Fisher MD P < (The "P Less Than" Company) Phone: 1-866-PLessThan (1-866-753-7784) Fax: 1-866-PLessTha

[R] question about creating data frame

2012-05-15 Thread T Bal
Hello, My data is "study.txt": "A" "Not A" "Mathematics" 80 15 "Physics" 32 24 "Biology" 18 29 I want to transform this data into with column names 'course' and 'A': course A 1 Mathematics 1 2 Mathem

[R] question about creating data frame

2012-05-15 Thread T Bal
Hello, My data is "study.txt": "Not A" "A" "Mathematics" 80 15 "Physics" 32 24 "Biology" 18 29 I want to transform this data into with column names 'course' and 'A': course A 1 Mathematics 1 2 Mathematics

[R] Need your help setting $R_check_force_suggests = "FALSE" on Windows system

2012-05-15 Thread Zhiqiu Hu
r-help@r-project.org Dear friends, I want to make the following change of R setting on a windows 7 desktop. $R_check_force_suggests = "FALSE" Since I have no experience using Unix, I don't how to make the suggestions in "writing R extension" works for windows. I will appreciate if you would hel

Re: [R] Kerning of italic text in plotmath

2012-05-15 Thread David Winsemius
On May 15, 2012, at 2:39 PM, Dennis Fisher wrote: R 2.14.0 OS X and Windows Colleagues I am trying to add some italicized text to a graphic using the code that appears below. For the italic text, kerning is not ideal -- spacing between letters is larger than I expected. Is there a simple

[R] Kerning of italic text in plotmath

2012-05-15 Thread Dennis Fisher
R 2.14.0 OS X and Windows Colleagues I am trying to add some italicized text to a graphic using the code that appears below. For the italic text, kerning is not ideal -- spacing between letters is larger than I expected. Is there a simple solution to this? Dennis plot(1, type="n", axes=F,

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread Rich Shepard
On Tue, 15 May 2012, David L Carlson wrote: Take a look at section 3.3.6 qqmath http://www.his.sunderland.ac.uk/~cs0her/Statistics/UsingLatticeGraphicsInR.h tm You need to create a panel function. See sections 2.5.2 and 2.5.3 in the second chapter of the Lattice book (http://dsarkar.fhcrc.org/l

Re: [R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread David L Carlson
Take a look at section 3.3.6 qqmath http://www.his.sunderland.ac.uk/~cs0her/Statistics/UsingLatticeGraphicsInR.h tm You need to create a panel function. See sections 2.5.2 and 2.5.3 in the second chapter of the Lattice book (http://dsarkar.fhcrc.org/lattice/book/chapter2.pdf) available on Deepayan

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread William Dunlap
You can also just pass the ... to the next function. E.g., the following two functions do the same thing: > myPaste1 <- function(...) paste(...) > myPaste2 <- function(...) do.call(paste, list(...)) > myPaste1(1,2:3,4) [1] "1 2 4" "1 3 4" > myPaste2(1,2:3,4) [1] "1 2 4" "1 3 4" Bill

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
Yes! Perfect! Thank you very much Michael! I need to get my head around that do.call(). I'll read up on it Thanks again! Ben On Tue, May 15, 2012 at 11:48 AM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > Are you perhaps looking for the do.call() construction? > > z = Intervals(

[R] (bug?) in survfit in R-2-15-0

2012-05-15 Thread Damjan Krstajic
Dear all,   I am using glmnet + survival and due to the latest release of glmnet 1.7.4 I was forced to use the latest version of R 2.15.0. My previous version of R was 2.10.1. I changed glmnet version and R version and when I started to get weird results I was not sure where the bug was.  

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Steve Lianoglou
Hi, On Tue, May 15, 2012 at 1:38 PM, Ben quant wrote: > Thank you for that. Sorry, I don't know how to use that to solve the issue. > I need to pass a handful (an unknown length) of objects into "...". I see > how you can get the count of what is in "...", but I'm not seeing how > knowing the len

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread R. Michael Weylandt
Are you perhaps looking for the do.call() construction? z = Intervals(c(1,10)) y = Intervals(c(5,10)) x = Intervals(c(4,6)) do.call("interval_intersection", list(x,y,z)) Michael On Tue, May 15, 2012 at 12:46 PM, Ben quant wrote: > Hello, > > Thanks in advance for any help! > > How do I pass an

Re: [R] Data read as labels

2012-05-15 Thread David Winsemius
On May 15, 2012, at 11:13 AM, barb wrote: Hey David, i tried all this - it doesn´t work :( Sadder and less informative words were never written! Learn to express in natural language or in code what you were expecting rather than use the phrase "doesn't work" which can mean one of an alm

[R] Lattice: Add abline to Single Value qqmath() Plot

2012-05-15 Thread Rich Shepard
The data are not normally distributed when untransformed and I'm trying various transformations to see if any would be appropriate to use. The lattice book (fig. 3.10) shows a 2-sample Q-Q plot with an abline but the code for the figure does not include the line. I'd appreciate a pointer to a

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
Thank you for that. Sorry, I don't know how to use that to solve the issue. I need to pass a handful (an unknown length) of objects into "...". I see how you can get the count of what is in "...", but I'm not seeing how knowing the length in "..." will help me. ben On Tue, May 15, 2012 at 10:53 A

Re: [R] save to Rdata file and to txt

2012-05-15 Thread David L Carlson
capture.output(moransI, file="moransI.txt") -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > projec

Re: [R] barplot: legend: two rows

2012-05-15 Thread Uwe Ligges
On 15.05.2012 17:38, Marion Wenty wrote: Hello, I solved my problem with the uneven numbers of legend elements, which should be put into more than one rows, in the following way: I added another legend element which is empty ("") and is filled with "white": legend(0,-1.4,xjust=0,ncol=3,legen

Re: [R] Data read as labels

2012-05-15 Thread Rui Barradas
Hello, Your data.frame has some noise in the last two rows. See if this works. #--- this is your code --- spec <- "EU2001" part1 <- "http://www.bundesbank.de/statistik/statistik_zeitreihen_download.php?func=directcsv&from=&until=&filename=bbk_"; part2 <- "&csvforma

[R] save to Rdata file and to txt

2012-05-15 Thread Alaios
Dear all, I am using the save(moransI,file=saveString) to save a variable called moransI to a file. This works well but unfortunately I have to open R every time I want to look to the contents. Would it be also possible to have a second line that saves the contents of the moransI variable in

Re: [R] Change One Column Name in Data Frame

2012-05-15 Thread Rich Shepard
On Tue, 15 May 2012, R. Michael Weylandt wrote: colnames(x)[2] <- "Cow" Michael, Thank you. Rich __ 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-

Re: [R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Steve Lianoglou
Hi, On Tue, May 15, 2012 at 12:46 PM, Ben quant wrote: > Hello, > > Thanks in advance for any help! > > How do I pass an unknown number of objects into the "..." (dot dot dot) > parameter? Put another way, is there some standard way to pass multiple > objects into "..." to "fool" the function int

Re: [R] How to sum and group data by DATE in data frame

2012-05-15 Thread R. Michael Weylandt
Can you provide a reproducible example? use dput() to send your data in a reproducible and user-friendly format. (It might not look user friendly, but trust me, it is) If x is really long, perhaps just dput(head(x, 25)) will suffice. Just a guess as to your problem: I'm not familiar with the timeS

[R] pass objects into "..." (dot dot dot)

2012-05-15 Thread Ben quant
Hello, Thanks in advance for any help! How do I pass an unknown number of objects into the "..." (dot dot dot) parameter? Put another way, is there some standard way to pass multiple objects into "..." to "fool" the function into thinking the objects are passed in separately/explicitly with commo

Re: [R] How to sum and group data by DATE in data frame

2012-05-15 Thread Cren
Thank you for your help, Michael. I used *aggregate(x, by = timeSequence(by = "day"), FUN = sum)* but the results is very different from *sum(x[1:13])*, where 13 is the number of daily observations I've sampled. Michael Weylandt wrote > > How are you using aggregate()? It seems to sum for me...

[R] standartized residuals in garchFit function

2012-05-15 Thread justina
Hello, I would be very grateful if someone answers my question. I am using garchFit function to model my data, and by summary of the model are given characteristics of standartized residuals. But to get I can only simple residuals (with model@residuals). How to get the standartized residuals or ho

Re: [R] Change One Column Name in Data Frame

2012-05-15 Thread R. Michael Weylandt
x <- data.frame(a = 1:5, b = rnorm(5)) colnames(x) colnames(x)[2] <- "Cow" x HTH, Michael On Tue, May 15, 2012 at 12:30 PM, Rich Shepard wrote: >  The data frame has 61 columns and one column name needs to be changed. The > colnames() function can be used to change all of them when passed a v

Re: [R] labels in hist and ranges of an axis

2012-05-15 Thread Peter Ehlers
I'm a bit late to this party, but why not just plot with labels=FALSE and add the labels with text(x,y,labels,cex)? The values of x are given by the h$mids in the h <- hist() object and the values of y are essentially h$counts (add a bit to move the labels up). Might need to set ylim to accommoda

[R] Change One Column Name in Data Frame

2012-05-15 Thread Rich Shepard
The data frame has 61 columns and one column name needs to be changed. The colnames() function can be used to change all of them when passed a vector of names, but can it also change a single name? If not, is there a way to change just the one column name? Rich

Re: [R] max value

2012-05-15 Thread Peter Ehlers
On 2012-05-15 08:36, Melissa Rosenkranz wrote: Here is an R problem I am struggling with: My dataset is organized like this... subject sessionvariable_x variable_y 01 11 01 12 01 1

[R] lmekin bug

2012-05-15 Thread Terry Therneau
Version 2.2-3 of the coxme package has been posted to CRAN. It should propogate to the mirrors over the next 1-2 days. Version 2.2-2 had a serious bug in the lmekin function. If the variance matrix of the random effects was not diagonal the answers were wrong: at one spot an upper triangular

Re: [R] Odd behaviour of identical()

2012-05-15 Thread R. Michael Weylandt
I believe it's coming down to the difference between integers and doubles (the computer data types, not the math-y meaning of those terms) -- e.g., identical( c(0L, 0L), c(0,0) ) Note that sequences made by `:` provide integers when possible: is.integer(1:5) You may want to use all.equal() inste

Re: [R] How to sum and group data by DATE in data frame

2012-05-15 Thread R. Michael Weylandt
How are you using aggregate()? It seems to sum for me... z <- zoo(1:50, seq.POSIXt(from = Sys.time(), by = "30 min", length.out = 50)) aggregate(z, as.Date(time(z)), sum) Best, Michael On Tue, May 15, 2012 at 11:52 AM, Cren wrote: > Hello, > > I have a time series with intraday datas, sampled

Re: [R] R

2012-05-15 Thread R. Michael Weylandt
If that's your aim, I might suggest you start with a text that is aimed at teaching R specifically and should help you work up to the level of questions you posted earlier: http://cran.r-project.org/ and then the "Contributed" link in the bottom left gives you a wide variety of options to start fro

Re: [R] R

2012-05-15 Thread Bert Gunter
There are many good R tutorials on the Web, including An Introduction to R, which comes with R. IMHO, that's where you should start, not in doing statistics texts exercises. CRAN also maintains a list of R texts, some on statistics, some not. -- Bert On Tue, May 15, 2012 at 7:17 AM, Eva-Lotta Bl

Re: [R] How to sum and group data by DATE in data frame

2012-05-15 Thread Cren
Hello, I have a time series with intraday datas, sampled every 30'; I would need to aggregate them in this way: summing up all datas within a day. I tried to use *aggregate(...)* function to get my goal, but it aggregates in wrong way (I did not understand how so far); what I need is like *sum(.

[R] Odd behaviour of identical()

2012-05-15 Thread math_daddy
Consider the following code: test <- function(n) { for(x in 1:n) { for(y in 1:n) { for(r in max(x-1,1):min(x+1,n)) { for(s in max(y-1,1):min(y+1,n)) { vec <- c(x-r,y-s) print(c("vec = ", vec)) print(identical(vec,c(0,0)))

[R] Master data frame or so

2012-05-15 Thread I.R. Holtman
Dear sir/madam, I have been using R for a while now for microarray analysis, and I would like to make a "master" data frame in which I can combine information from many different sources. The basic list a genelist with 25.000 probes, then I would like to have a subcompartment with the statistical

Re: [R] Data read as labels

2012-05-15 Thread barb
Hey David, i tried all this - it doesn´t work :( file<-read.csv2(tmp,sep=";",skip="5") # or file<-read.csv2(tmp,sep=";",skip="5",stringsAsFactors=FALSE)a<-(relevant<-file[,2]) clean <- as.numeric(levels(a))[as.integer(a)] clean<-as.numeric(as.character(a)) i often use noquote and strsplit and

Re: [R] counts on bars on barplot

2012-05-15 Thread arkanion
got it, did it, worked ! thanks a lot ! -- View this message in context: http://r.789695.n4.nabble.com/counts-on-bars-on-barplot-tp4630060p4630114.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

Re: [R] counts on bars on barplot

2012-05-15 Thread arkanion
I want to label each bar with the values of each bar (counts) on top of each of them. -- View this message in context: http://r.789695.n4.nabble.com/counts-on-bars-on-barplot-tp4630060p4630107.html Sent from the R help mailing list archive at Nabble.com. _

[R] help

2012-05-15 Thread 杨秀芬
To whom this may concern, I have been learing R software. Recently when I did the analysis of the associaiton of SNPs and disease, I have met one problem with Bonferroni correction. Is there a package I should download? What is the command I should use? I have been learning it for a long time how

Re: [R] Transfering data from R list to other document format

2012-05-15 Thread pannigh
Yup, “rapply“ does the magic. Thank you very much, this command is new to me! My “glaringly obvious error” is indeed very obvious and was a result of constructing an example here and copying my “lapply” command into the text. So don't worry, when the question arose both names were identical Once

[R] R

2012-05-15 Thread Eva-Lotta Blom
To all moderators i guess, my question was probably not clear this is not a homework, i am trying to understand R by doing some exercise in my book. I will however participate a course in R in august and thought it could be good to have some knowledge before. I hoped for help from you since i hav

[R] rpart - predict terminal nodes for new observations

2012-05-15 Thread tudor
Dear useRs: Is there a way I could predict the terminal node associated with a new data entry in an rpart environment? In the example below, if I had a new data entry with an AM of 5, I would like to link it to the terminal node 2. My searches led to http://tolstoy.newcastle.edu.au/R/e4/help/08/07

[R] Trouble with LAPACK / SHLIB

2012-05-15 Thread Garbett, Shawn P
I'm creating my own shared lib that depends on LAPACK. It works fine on my mac (R version 2.15.0). It is compiled as such: > R CMD SHLIB estfit.c It's loaded in R with > dyn.load("estfit.so") When doing this on Kubuntu (with r-base and r-base-dev, version 2.15.0 of R), it results in: > dyn.

Re: [R] Transfering data from R list to other document format

2012-05-15 Thread pannigh
Thanx for your effort answering by phone! dput (list, "list.txt") does write something to a text doc but in a confusing manner. All previous commands that created the list seem to appear. However, I will check out the pack you mentioned. Guess my aim would be to read the list into a simple .txt f

[R] vuong/clarke tests for relogit

2012-05-15 Thread Daniel McDowell
Does anyone know a package that will conduct Vuong and Clarke tests to compare non-nested rare-events logit ("relogit") models via Zelig? I know the pscl package can conduct a Vuong test, however, it doesn't seem to work with relogit. I haven't been able to find a package that can implement the Cla

Re: [R] counts on bars on barplot

2012-05-15 Thread pannigh
If you use simple barplot graphic try this, e.g.: a<-barplot(some.data) text(a, some.data, some.data) The "text" command needs x and y coordinates, by assigning your barplot to "a" (here), you have the x coordinats and by using the y-values of the barplot, the values will be written ontop of the

Re: [R] Discrete choice model maximum likelihood estimation

2012-05-15 Thread John C Nash
Your function will not evaluate as coded. i.e., llfn(start.par) doesn't "work", as there are unequal numbers of arguments. Also, while R allows you to use variables that are not explicitly defined for a function, I've almost always got into trouble if I don't pass them VERY carefully. Finally,

Re: [R] barplot: legend: two rows

2012-05-15 Thread Marion Wenty
Hello, I solved my problem with the uneven numbers of legend elements, which should be put into more than one rows, in the following way: I added another legend element which is empty ("") and is filled with "white": legend(0,-1.4,xjust=0,ncol=3,legend=c(colnames(dat)[-1],""),fill=c("navyblue","

[R] max value

2012-05-15 Thread Melissa Rosenkranz
Here is an R problem I am struggling with: My dataset is organized like this... subject sessionvariable_x variable_y 01 11 01 12 01 13 01 2

Re: [R] plot: many bars with wide bars

2012-05-15 Thread Marion Wenty
Hi Jim, thank you very much for your answer! I solved the problem in another way now, though, because I think with this function from the package plotrix I would have had to change my whole function (and all the other similar ones I had written). As far as I understand it up till now, there are a

Re: [R] Probabilistic aggregation

2012-05-15 Thread David L Carlson
To generate multivariate normal distributions, you will want mvrnorm in package MASS. > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Petr Savicky > Sent: Tuesday, May 15, 2012 7:14 AM > To: r-help@r-project.org > Subject: Re:

Re: [R] Transfering data from R list to other document format

2012-05-15 Thread David Winsemius
On May 15, 2012, at 6:56 AM, pannigh wrote: Dear users, I want to transfer a list of results from R to some practical format, from where I can continue manipulating, copying,... the values, e.g. : list1 <- list("My first list", matrix(1:6, ncol=3), c(1,2,3,4,5,6) ) # Imagining I forgot some

Re: [R] How to Un-group a grouped data set?

2012-05-15 Thread David L Carlson
newdats <- rbind(cbind(dats[rep(1:nrow(dats), dats$AEs), 1:2], AEs=1), cbind(dats[rep(1:nrow(dats), dats$N-dats$AEs),1:2], AEs=0)) But the data will not be in the order you specified unless you add newdats <- newdats[order(newdats$Study, -newdats$TX, -newdats$AEs),] and you may want to cle

  1   2   >