Re: [R] Error : Error in if (antipodal(p1, p2))

2012-11-25 Thread David Winsemius
There is a reason for the Posting Guide requesting that a reproducible example be offered. There is also a reason for the PG requesting that you not crosspost to r-help. http://stackoverflow.com/questions/13549080/antipodal-error-in-great-circles-code -- David. On Nov 24, 2012, at 11:04 PM,

Re: [R] How to Label Cases in Scatterplots?

2012-11-25 Thread Mark Lamias
You could use something like this: #Generate 26 simulated data points y=rnorm(26) x=1:26 your.labels=letters #Plot data plot(x, y, xlim=c(min(x), max(x)+.25), ylim=c(min(y), max(y)+.25)) #Label points text(x+.15, y+.15, your.labels) You could also use the textxy function in the calibrate

Re: [R] printing difftime summary

2012-11-25 Thread David Winsemius
On Nov 24, 2012, at 7:48 PM, Sam Steingold wrote: * David Winsemius qjvafrz...@pbzpnfg.arg [2012-11-23 13:14:17 -0800]: See http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-should-I-write-summary-methods_003f --8---cut here---start-8---

[R] RExcel, ROOo and LibreOffice inquiry

2012-11-25 Thread Liviu Andronic
Dear all I'd like to give RExcel a decent spin, mainly to take advantage of Excel's data management facilities and automatic recalculations. However I cannot use this Windows-only solution on the platform of my choice, Linux. Alternatively I've been considering the cross-platform ROOo, the

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-25 Thread Michael Dewey
At 02:05 25/11/2012, Catriona Hendry wrote: Hi, @ Albyn, David.. No, its not homework. Its basic groundwork for testing allometric relationships for a graduate project I am working on. I read the guide before posting, I spent half the day trying to understand how I am going wrong based on the

[R] How to import data from a text file in R

2012-11-25 Thread dilo88
Hi, I'd like to import a 154x1 vector of a stock monthly returns from a text (or excel spreadsheet) into R. I need to work on this vector by calculating mean, variance and use it for more complex operations. What is the best function to do so? There are no headers, just 154 decimale numbers (so

[R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread osamaabusinni
Hi, I would like to know if there is a special package that could help me Import/Export excel files to/from R, without changing the file type (*.csv ...) ? I have tried several packages and non of them worked on my computer If someone have a clue how to do it I would be grateful...

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
Dear Bruno, I sitll get this message, even when iam using , Error: unexpected input in A-lm(GandW ~ Authocracy,Data) -- View this message in context: http://r.789695.n4.nabble.com/Why-do-i-get-Error-unexpected-input-in-A-lm-GandW-Authocracy-Data-tp4650559p4650720.html Sent from the R help

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread Jim Holtman
have you tried the 'XLConnect' package? what have you tried, what types of files were you using and what errors did you encounter? Sent from my iPad On Nov 25, 2012, at 6:16, osamaabusinni osamaabusi...@gmail.com wrote: Hi, I would like to know if there is a special package that could

Re: [R] How to import data from a text file in R

2012-11-25 Thread Jim Holtman
read the 'intro to R' again and then ?scan ?read.table Sent from my iPad On Nov 25, 2012, at 6:29, dilo88 claudio.dilor...@carloalberto.org wrote: Hi, I'd like to import a 154x1 vector of a stock monthly returns from a text (or excel spreadsheet) into R. I need to work on this vector by

Re: [R] How to import data from a text file in R

2012-11-25 Thread John Kane
Save the file as a csv file and try something like this: mydata - read.csv(.csv, header = FALSE) John Kane Kingston ON Canada -Original Message- From: claudio.dilor...@carloalberto.org Sent: Sun, 25 Nov 2012 03:29:42 -0800 (PST) To: r-help@r-project.org Subject: [R] How

Re: [R] RExcel, ROOo and LibreOffice inquiry

2012-11-25 Thread John Kane
Can you supply a link for ROOo ? I don't see it anywhere. Also what do you mean OpenOffice is deprecated? Do you mean in terms of using it with ROOo? Otherwide OOo, now under new management at Apache is under active development under the name Apache Open Office. John Kane Kingston ON

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread Barry Rowlingson
On Sun, Nov 25, 2012 at 12:15 PM, F86 farad...@gmail.com wrote: Dear Bruno, I sitll get this message, even when iam using , Error: unexpected input in A-lm(GandW ~ Authocracy,Data) You're on a Mac, you say? Try googling for R unexpected error - Macs do some crazy things:

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread Rui Barradas
Hello, Another possibility is to use argument 'data' explicitly: A-lm(GandW ~ Authocracy, data = Data) Hope this helps, Rui Barradas Em 25-11-2012 13:39, Barry Rowlingson escreveu: On Sun, Nov 25, 2012 at 12:15 PM, F86 farad...@gmail.com wrote: Dear Bruno, I sitll get this message, even

Re: [R] RExcel, ROOo and LibreOffice inquiry

2012-11-25 Thread Liviu Andronic
On Sun, Nov 25, 2012 at 2:38 PM, John Kane jrkrid...@inbox.com wrote: Can you supply a link for ROOo ? I don't see it anywhere. Oh, sorry. I thought it was obvious: http://rcom.univie.ac.at/download.html#ROOo Also what do you mean OpenOffice is deprecated? Do you mean in terms of using it

[R] overlapping matplot

2012-11-25 Thread eliza botto
Dear useRs,is there a way in R to overlap curve of each column of two matrices( 19columns and 365rows) and (17cols and 365rows) against single matrix (1 col and 365rows)?i used par(new-TRUE) and lines command but both are not working. thanks in advanceeliza

Re: [R] overlapping matplot

2012-11-25 Thread Rui Barradas
Hello, x - matrix(rnorm(12), ncol = 2) y - matrix(rnorm(24), ncol = 4) matplot(x, type = l) par(new = TRUE) matplot(y, type = l) I see 6 lines, for 2 + 4 columns. If repeating colors are a problem, use argument 'col'. Hope this helps, Rui Barradas Em 25-11-2012 14:37, eliza botto

Re: [R] overlapping matplot

2012-11-25 Thread Rui Barradas
Or using matplot argument 'add'. matplot(x, type = l, ylim = range(c(x, y))) matplot(y, type = l, add = TRUE, col = 3:6) Rui Barradas Em 25-11-2012 15:07, Rui Barradas escreveu: Hello, x - matrix(rnorm(12), ncol = 2) y - matrix(rnorm(24), ncol = 4) matplot(x, type = l) par(new = TRUE)

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread Barry Rowlingson
On Sun, Nov 25, 2012 at 2:01 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Another possibility is to use argument 'data' explicitly: A-lm(GandW ~ Authocracy, data = Data) Hope this helps, It's not going to. The line parses very nicely as written, with or without naming the

Re: [R] overlapping matplot

2012-11-25 Thread eliza botto
Dear Rui,thanks alot. The add command in matplot did work. could you please tell me why par(new=TRUE) is not working?regardseliza Date: Sun, 25 Nov 2012 15:11:33 + From: ruipbarra...@sapo.pt To: eliza_bo...@hotmail.com CC: r-help@r-project.org Subject: Re: [R] overlapping matplot Or

Re: [R] Comparing linear regression coefficients to a slope of 1

2012-11-25 Thread Catriona Hendry
Hi, Thank you all so much for the help provided here! @Dennis.. from your work-through I can see where I had gotten lost, I greatly appreciate your time. The question that remains is whether or not I actually need to be doing this it seems, so here is the rationale... The variables cannot be

[R] I'd like to know more efficient method to verify the pre-packaged codes

2012-11-25 Thread 박상규
Hello, I want to add some new functionalities in the package 'quantmod '. So I download source code and am managed to build it. I found that modifying code and check if it works by repeating the following steps: 1) r CMD check quantmod 2) r CMD build quantmod 3) r CMD INSTALL

Re: [R] overlapping matplot

2012-11-25 Thread Rui Barradas
Hello, Em 25-11-2012 15:17, eliza botto escreveu: Dear Rui,thanks alot. The add command in matplot did work. could you please tell me why par(new=TRUE) is not working? No, it's working for me, that's why I've sent it in my first answer. In your first post you had a typo, par(new-TRUE), maybe

Re: [R] I'd like to know more efficient method to verify the pre-packaged codes

2012-11-25 Thread R. Michael Weylandt
On Sun, Nov 25, 2012 at 3:25 PM, 박상규 birdfir...@naver.com wrote: Hello, I want to add some new functionalities in the package 'quantmod '. So I download source code and am managed to build it. I found that modifying code and check if it works by repeating the following steps: 1) r CMD

Re: [R] Multiple Range Means Test

2012-11-25 Thread arun
Hi, Tried with your example dataset: Are you able to get results with the example data? dat1-read.table(text= subspecies  WMF 1  rowleyi 2.50 2  rowleyi 2.30 3  rowleyi 2.35 49  beatae 2.20 50  beatae 2.35 51  beatae 2.45 91    levipes 2.45 92    levipes 2.35 93    levipes

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread osamaabusinni
Yes already installed the CLConnect. I'm trying to import a file of xlsx. but with no success. from some reason the package isn't working, please see attached file. On Sun, Nov 25, 2012 at 2:33 PM, jholtman [via R] ml-node+s789695n4650722...@n4.nabble.com wrote: have you tried the

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread osamaabusinni
XLConnect* On Sun, Nov 25, 2012 at 2:33 PM, jholtman [via R] ml-node+s789695n4650722...@n4.nabble.com wrote: have you tried the 'XLConnect' package? what have you tried, what types of files were you using and what errors did you encounter? Sent from my iPad On Nov 25, 2012, at 6:16,

[R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread sm2284
Dear R-ers, I am currently running some Wilcoxon tests in R-64. How do I find the degrees of freedom in the output I am receiving? wilcox.test(good$TRUE, good$x4a, paired=FALSE) Wilcoxon rank sum test with continuity correction data: good$TRUE and good$x4a W = 2455, p-value

[R] bbmle Warning: optimization did not converge

2012-11-25 Thread arun4
I am using the Ben bolker's R package bbmle to estimate the parameters of a binomial mixture distribution via Maximum Likelihood Method. For some data sets, I got the following warning messages: *Warning: optimization did not converge (code 1: ) There were 50 or more warnings (use warnings() to

Re: [R] Error in Random Effect Panel

2012-11-25 Thread Hard Core
i found this on the web, ran it on R but i always get the same error ... any advices? i don't know how to slve this https://r-forge.r-project.org/scm/viewvc.php/pkg/R/ercomp.R?view=markuproot=plm -- View this message in context:

[R] gradient

2012-11-25 Thread izymaths
Hi, I'm a french student and I need some help for my project. I have to calcul the gradient of the function : f - function(x,y) { (1 - x^2) + (y - x^2)^2 } Thanks ! :) -- View this message in context: http://r.789695.n4.nabble.com/gradient-tp4650734.html Sent from the R help mailing list

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread osamaabusinni
Yes already installed the CLConnect. I'm trying to import a file of xlsx. but with no success. from some reason the package isn't working, please see attached file. On Sun, Nov 25, 2012 at 2:33 PM, jholtman [via R] ml-node+s789695n4650722...@n4.nabble.com wrote: have you tried the

[R] creation of an high frequency series

2012-11-25 Thread billycorg
Hi R Users! I would like to create an high frequency series but I am experiencing some difficulties. My series should start at 09.30 a.m. each day and end at 16.00 for, let's say, 2 years. I don't care on how many observations are for each day. It's ok also one observation each minute. In this

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread Uwe Ligges
On 25.11.2012 13:55, sm2284 wrote: Dear R-ers, I am currently running some Wilcoxon tests in R-64. How do I find the degrees of freedom in the output I am receiving? You don't find any number related to degrees of freedom - which seems to be a bit out of context here? Uwe Ligges

Re: [R] Error in Random Effect Panel

2012-11-25 Thread Uwe Ligges
On 25.11.2012 14:53, Hard Core wrote: i found this on the web, ran it on R but i always get the same error ... any advices? i don't know how to slve this https://r-forge.r-project.org/scm/viewvc.php/pkg/R/ercomp.R?view=markuproot=plm 0. Have you read the positjng guide to this mailing list?

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread Uwe Ligges
On 25.11.2012 16:18, osamaabusinni wrote: Yes already installed the CLConnect. I'm trying to import a file of xlsx. but with no success. from some reason the package isn't working, please see attached file. No files passed the mailing list filters. Anyway, if XLConnect does not work for

Re: [R] gradient

2012-11-25 Thread Uwe Ligges
On 25.11.2012 15:21, izymaths wrote: Hi, I'm a french student and I need some help for my project. I have to calcul the gradient of the function : f - function(x,y) { (1 - x^2) + (y - x^2)^2 } This list does not answer homework problems. And even if we would, your problem is school level

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread Rui Barradas
Hello, It's a bad idea to post a png file with error messages, next time, copy from RStudio and paste it in a post. Anyway, your error message says that you don't have a Windows system variable JAVA_HOME. So, rJava can't find it. The solution is to create one in Windows. Hope this helps,

Re: [R] How to control plotting formula above lm diagnostic plots?

2012-11-25 Thread Uwe Ligges
On 22.11.2012 18:58, ksaw wrote: Dear All, I am trying to plot four diagnostic plots for my lm in one window. Here is some random data for an example: a = rnorm(20, mean=2, sd=0.2) b = rnorm(20, mean=1, sd=0.4) model=lm(a~b) When I set the page as: par(mfrow=c(1,1),

Re: [R] bbmle Warning: optimization did not converge

2012-11-25 Thread Michael Weylandt
On Nov 25, 2012, at 1:52 PM, arun4 arun.ganesh2...@gmail.com wrote: I am using the Ben bolker's R package bbmle to estimate the parameters of a binomial mixture distribution via Maximum Likelihood Method. For some data sets, I got the following warning messages: *Warning: optimization did

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread William Dunlap
I see the character (octal) 021 at the end of that error message (when I save it as *.txt file from wordpad). Error: unexpected input in A-lm(GandW ~ Authocracy,Data) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org

[R] rjags and parallel chains

2012-11-25 Thread Noah Silverman
Hello, I have a fairly complex hierarchical model that I using rjags to fit. Short test runs verify that it works and everything appears to be setup correctly. Now that I want to collect a larger sample from the posterior (5,000 or more). This looks like it will take several days to run on

[R] argument is missing, with no default OR replacement has length zero

2012-11-25 Thread lind35
Hello, I have a new data set and an old data set. Both have the same columns representing the same sort of measure. Within each data set (old and new) are 18 groups (simplified to three groups below). Within each group are individuals with unique ID numbers. These ID numbers may be the same as

[R] densregion

2012-11-25 Thread mammamae
Hi all i have a bootstrap forecast and I want to apply densregion.normal but I cannot set the function #GARCH Bootstrap Forecast bp *---* * GARCH Bootstrap Forecast * *---* Model : sGARCH n.ahead : 160 Bootstrap method:

Re: [R] bbmle Warning: optimization did not converge

2012-11-25 Thread arun4
Thank you Michael Weylandt. Let me to describe my problem fully, I have developed a new discrete probability distribution which has the following Probability mas function( as an alternative to binomial distribution) http://r.789695.n4.nabble.com/file/n4650759/newdist.jpg Where n= number of

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread sm2284
Thank you for that input. Is there any way of finding the degrees of freedom for this test? I'm new with R so thank you for your patience. - University of St Andrews, sm2...@st-andrews.ac.uk -- View this message in context:

Re: [R] bbmle Warning: optimization did not converge

2012-11-25 Thread arun4
Sorry, x values are created as *values- 0:7* -- View this message in context: http://r.789695.n4.nabble.com/bbmle-Warning-optimization-did-not-converge-tp4650730p4650761.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
True it did not. I have now tried to do everything but without any results. However, a friend of mine, with PC(Linux), does the same thing and it works just perfect. -- View this message in context:

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
Also when i type z¬1 i got the same error. My data seems to be OK without any problems. And its works perfect for a friend. -- View this message in context: http://r.789695.n4.nabble.com/Why-do-i-get-Error-unexpected-input-in-A-lm-GandW-Authocracy-Data-tp4650559p4650762.html Sent from the

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread sm2284
Dear Chuck and Uwe, Thank you very much for your replies. Chuck-Thank you for the clarification I mis-read the reply Uwe - Many apologies, I mis-understood your response. Thank you very much for your help! Stephen - University of St Andrews, sm2...@st-andrews.ac.uk -- View this

Re: [R] Import/Export excel files to/from R, without changing the file type

2012-11-25 Thread Martin Studer
XLConnect requires Java 1.6+ to be installed. You can get Java from http://www.java.com/getjava/ Best regards, Martin -- View this message in context: http://r.789695.n4.nabble.com/Import-Export-excel-files-to-from-R-without-changing-the-file-type-tp4650717p4650766.html Sent from the R help

Re: [R] bbmle Warning: optimization did not converge

2012-11-25 Thread Uwe Ligges
On 25.11.2012 19:44, arun4 wrote: Thank you Michael Weylandt. Let me to describe my problem fully, I have developed a new discrete probability distribution which has the following Probability mas function( as an alternative to binomial distribution)

Re: [R] rjags and parallel chains

2012-11-25 Thread ilai
Specifying n 1 chains is not enough. You need some parallel backend. You can use snow/snowfall or doMC (these are R libraries) for example. Maybe others, google is your friend. Word of caution about doMC (maybe also snowfall, never tested it), you might need to specify RNG (seed, sampler) for each

[R] Variance gamma process simulation and plot

2012-11-25 Thread Maximilian Lklweryc
Hi, I have simulated one possible path of a variance gamma process by the following code: vektor-c(1:23) S0=20 theta=0.01 v=5 sigma=0.1 vektor[1]-S0 for (i in 2:23){ randomgamma-rgamma(1, shape=1/v, scale = v) randomnormal-rnorm(1,mean=0,sd=1)

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread Jeff Newmiller
Time for you to catch Barry's hint... the character between the z and the 1 is not valid R syntax. If your editor is creating that when you type a followed by a - then you have a problem that most of us on this list have never seen and don't know how to solve. Go ask on the Macintosh R

Re: [R] Error in Random Effect Panel

2012-11-25 Thread Hard Core
the code is : prr - plm( durata ~ log(attivo) + rating + main, model=random, effect=individual, data = p) I read that code in R forge and i thought that it could be useful to anyone who red my post to help me moving around it. -- View this message in context:

Re: [R] argument is missing, with no default OR replacement has length zero

2012-11-25 Thread arun
Hi, You could use ?merge() or ?join() new-read.table(text=   group ID   1  800   1  23   1  542   2  23   2  2318   2  45  3  1345   3  800   3  232 ,sep=,header=TRUE)  old-read.table(text= group ID SomedataCol   1  300  12.2   1  155    10.8   1  23    9.2   2  45    15.6   2 

[R] Issue with using geocode

2012-11-25 Thread ioanna ioannou
Hello, A very simple question but I am stuck. I have an excel file each row is an address. However, I cannot make geocode read each line and come up with the latitude longitude. Could you please correct my code? library(ggmap) X-c (2 Afxentiou Ampelokipi Thessaloniki Greece, 2

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 4:55 AM, sm2284 wrote: Dear R-ers, I am currently running some Wilcoxon tests in R-64. How do I find the degrees of freedom in the output I am receiving? wilcox.test(good$TRUE, good$x4a, paired=FALSE) Wilcoxon rank sum test with continuity correction data:

Re: [R] IMPORTANT!!!! PLEASE HELP ME

2012-11-25 Thread Rolf Turner
PLEASE remember: This list has a no homework policy. Students should do their own homework. cheers, Rolf Turner On 25/11/12 13:18, Pete Brecknock wrote: Jasmin wrote I try to use hansen-hurwitz and horvitz-thompson estimator.So I should generate samples which come from normal

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 7:16 AM, Barry Rowlingson wrote: On Sun, Nov 25, 2012 at 2:01 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Another possibility is to use argument 'data' explicitly: A-lm(GandW ~ Authocracy, data = Data) Hope this helps, It's not going to. The line parses very

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
The file that I'm using is csv. How do i remove the non-printing ¬ character? Is there any other way to run lm() ? may be it would work with other commands Best, Faradj -- View this message in context:

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
Yes, i have already done it, i will post it here if i find the solution. -- View this message in context: http://r.789695.n4.nabble.com/Why-do-i-get-Error-unexpected-input-in-A-lm-GandW-Authocracy-Data-tp4650559p4650773.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] argument is missing, with no default OR replacement has length zero

2012-11-25 Thread arun
HI, With merge(), you could use:  merge(new,old,by=c(group,ID),all.x=TRUE) #  group   ID SomedataCol #1 1   23 9.2 #2 1  542  NA #3 1  800  NA #4 2   23 4.2 #5 2   45    15.6 #6 2 2318  NA #7 3  232    18.0 #8 3  800   

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread William Dunlap
The parser errors show the text up to the first character that caused a problem, and not beyond that. Hence a misinterpreted - would show something like Error: unexpected input in A- and not, what I saw in your mail: Error: unexpected input in A-lm(GandW ~ Authocracy)\021 (Some things in

Re: [R] HELP me please with import of csv to R

2012-11-25 Thread F86
I have solved the problem. And as i assumed from the beginning it was a simple one. The problem was that i had my csv file on the descop. It should have been in the working directory. So i just needed to read the file and then run lm() like i wrote before. Thanks to Ray DiGiacomo, Jr!

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread sm2284
Thank you David I think that makes sense. As a side note I have been doing some work with fish abundance in aquaria. The TRUE column is the actual amount of fish in the tank, so a questionable practice but a valid one?? Thanks again, Stephen On 25 Nov 2012, at 20:41, David Winsemius [via R]

Re: [R] Why do i get Error: unexpected input in A-lm(GandW ~ Authocracy, Data)

2012-11-25 Thread F86
I have solved the problem. And as i assumed from the beginning it was a simple one. The problem was that i had my csv file on the descop. It should have been in the working directory. So i just needed to read the file and then run lm() like i wrote before. Thanks to Ray DiGiacomo, Jr!

Re: [R] gradient

2012-11-25 Thread izymaths
Come on man ! I have to make the algorithm CG-Steihaug it's not easy. And I need the gradient of this function to make my algorithm works for functions f : R^2 - R (my algorithm already works for functions f : R - R) Please. -- View this message in context:

Re: [R] Finding the Degrees of Freedom in a Wilcoxon Test

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 2:06 PM, sm2284 wrote: Thank you David I think that makes sense. As a side note I have been doing some work with fish abundance in aquaria. The TRUE column is the actual amount of fish in the tank, so a questionable practice but a valid one?? It complicates the human

Re: [R] argument is missing, with no default OR replacement has length zero

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 10:22 AM, lind35 wrote: Hello, I have a new data set and an old data set. Both have the same columns representing the same sort of measure. Within each data set (old and new) are 18 groups (simplified to three groups below). Within each group are individuals with

[R] Passing lists between functions

2012-11-25 Thread Ally
I'd like to pass a list object created by one function as an argument of another function. once inside the second function, I'd like to break the list up to it's individual elements, each then identifiable by the 'names' of the list. The list looks something like lst-list(a=1, b=2, df=5, g=7)

[R] Plotting an adjusted kaplan-meier curve

2012-11-25 Thread Brent Caldwell
Dear R-users I am trying to make an adjusted Kaplan-Meier curve (using the Survival package) but I am having difficulty with plotting it so that the plot only shows the curves for the adjusted results. My data come from a randomised controlled trial, and I would like the adjusted Kaplan-Meier

Re: [R] Adding a new variable to each element of a list

2012-11-25 Thread Stephen Politzer-Ahles
Hi Arun, Thanks a lot for the help. I think I didn't make my request clear, though; sorry about that. What your example does is applies the values of y to each element in the list result. However, what I'm actually trying to do is apply the nth element of y to the nth element of result. In other

Re: [R] Passing lists between functions

2012-11-25 Thread jim holtman
Just reference the objects in the list: do_something-function(L){ lst$a+lst$b+lst$df+lst$g } do_something(lst) On Sun, Nov 25, 2012 at 8:24 PM, Ally a.rushwo...@stats.gla.ac.uk wrote: I'd like to pass a list object created by one function as an argument of another function. once inside the

Re: [R] Passing lists between functions

2012-11-25 Thread jim holtman
Wrong -- I forgot to use the parameter name do_something-function(L){ L$a+L$b+L$df+L$g } do_something(lst) On Sun, Nov 25, 2012 at 9:02 PM, jim holtman jholt...@gmail.com wrote: Just reference the objects in the list: do_something-function(L){ lst$a+lst$b+lst$df+lst$g }

Re: [R] Passing lists between functions

2012-11-25 Thread arun
Hi, If the end result you want is the sum of those elements, will this work for you?  sum(unlist(lst)) #[1] 15 #or sum(do.call(c,lst)) #in this case #[1] 15 A.K. - Original Message - From: Ally a.rushwo...@stats.gla.ac.uk To: r-help@r-project.org Cc: Sent: Sunday, November 25, 2012

Re: [R] Passing lists between functions

2012-11-25 Thread Ally
I should have been clearer, the function I supplied is just a toy example, I actually have lots more elements, each with different classes, and need to do more complex things than just summation. The main reason I'm interested in this is to avoid having to keep adding an assignment like x-lst$x

Re: [R] Passing lists between functions

2012-11-25 Thread Rolf Turner
On 26/11/12 14:24, Ally wrote: I'd like to pass a list object created by one function as an argument of another function. once inside the second function, I'd like to break the list up to it's individual elements, each then identifiable by the 'names' of the list. The list looks something like

Re: [R] Passing lists between functions

2012-11-25 Thread Ally
Thanks Rolf, that was a mistake. Brilliant, I think with() is what I'm looking for, thanks a lot! cheers, alastair Rolf Turner-3 wrote On 26/11/12 14:24, Ally wrote: I'd like to pass a list object created by one function as an argument of another function. once inside the second

Re: [R] Adding a new variable to each element of a list

2012-11-25 Thread arun
HI Steve, You could try this: ylist-lapply(y,function(x) x)  res-lapply(mapply(c,result,Thing=ylist,SIMPLIFY=FALSE),function(x) do.call(cbind,x))  res #$`Error: subject`  #     Df Sum Sq Mean Sq F value Pr(F) Thing #Residuals  4   12.4 3.1  NA NA   0.5 #$`Error:

Re: [R] Plotting an adjusted kaplan-meier curve

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 5:17 PM, Brent Caldwell wrote: Dear R-users I am trying to make an adjusted Kaplan-Meier curve (using the Survival package) but I am having difficulty with plotting it so that the plot only shows the curves for the adjusted results. My data come from a randomised

Re: [R] Performing operations only on selected data

2012-11-25 Thread Marcel Curlin
Thank you, this works very well. My only remaining question about this is about how ifelse is working; I understand the basic syntax (df$condition2 gets assigned the value *runif(nrow(df1[df1$condition1=1,]),0,1)* or the value *df$condition1* depending on whether or not df$condition1 meets the

Re: [R] function call from another r file

2012-11-25 Thread sheenmaria
Thanks for the reply .I am able to call a simple function in an R file from another by using source(). Now I am facing another issue .I am trying to call a r file named es.r which have lotes of R functions. These R functions are internally calling java functions by using .jnew() and .jcall(). I

Re: [R] Barplot with lines

2012-11-25 Thread Ripples
Hi Jim, I did the same and it worked. Thanks a lot! SK On Fri, Nov 23, 2012 at 6:11 PM, Jim Lemon j...@bitwrit.com.au wrote: On 11/24/2012 02:21 AM, skanap wrote: Hi Jim, Thank you for the reply. But, when I use Barpos I get this error. plot(mydata$score,barpos) Error in xy.coords(x,

Re: [R] function call from another r file

2012-11-25 Thread David Winsemius
On Nov 25, 2012, at 8:50 PM, sheenmaria wrote: Thanks for the reply .I am able to call a simple function in an R file from another by using source(). Now I am facing another issue .I am trying to call a r file named es.r which have lotes of R functions. These R functions are internally

Re: [R] Performing operations only on selected data

2012-11-25 Thread Jeff Newmiller
a) Please read the posting guide. This mailing list is not Nabble, and you are requested to post in plain text and include context from previous messages in the thread. b) arun's solution is wrong in two respects: it fails to add condition1 to the random numbers, and it feeds differently-sized

[R] Problem with cbind() and arguments

2012-11-25 Thread parlor9
Hello, I am using Rscript and arguments, and I have to create a object, here is a small example: -I have P: a b 1 2 1 2 1 2 -And I want this result: a b c 1 2 3 1 2 3 1 2 3 So I pass 'c' as an Rscript argument and use this command: P-cbind(P,args[1]=5) -But then it will

Re: [R] function call from another r file

2012-11-25 Thread sheenmaria
Yes.I have added #!/usr/bin/Rscript library(rJava) .jinit() in the beginning of es.r On Mon, Nov 26, 2012 at 11:14 AM, David Winsemius [via R] ml-node+s789695n4650807...@n4.nabble.com wrote: On Nov 25, 2012, at 8:50 PM, sheenmaria wrote: Thanks for the reply .I am able to call a simple

[R] compatibility of load() in R 2.15.2

2012-11-25 Thread Jack Tanner
I have some large-ish files that are the output of save() from R 2.15.1, which that version can load() just fine. After upgrading to 2.15.2, load() no longer works on these files. Is this a known issue? __ R-help@r-project.org mailing list

Re: [R] Problem with cbind() and arguments

2012-11-25 Thread Jeff Newmiller
This is not reproducible. Nor can I figure out why you expected assigning 5 to args[1] was going to end up with c(3,3,3). FWIW, I highly recommend that you re-read the Introduction to R, particularly the sections discussing indexing. Then you might try P[[ args[1] ]] - 3 On Sun, 25 Nov 2012,