Re: [R] uninstalled and reinstalled R, now cannot install packages

2014-10-01 Thread S Ellison
Inability to access a repository index is very often an indication of a failed internet connection from R. In Windows that is often a result of incorrect proxy settings or other internet connection settings. The R Windows FAQ, 2.19 ("The Internet download functions fail") may have the answer...

[R] aov and groups coding

2014-10-01 Thread Massimo Bressan
please consider the following example: #start code set.seed(123) level<-rnorm(18, 10,3) group1<-rep(letters[1:3], each=6) summary(aov(level~group1)) group2<-rep(1:3,each=6) str(group2) summary(aov(level~group2)) #same result as for group1 summary(aov(level~factor(group2))) #same result ad fo

[R] Print list to text file with list elements names

2014-10-01 Thread Ingrid Charvet
Hi everyone, I want to write a list of data frames to a text file and preserve the names given to the list elements (I am using R 3.1.0). I tried: setNames(myList, myNames) # myNames is a vector of char elements same length as myList sink(sprintf("%s",filename)) lapply(myList,print) sink() A

Re: [R] uninstalled and reinstalled R, now cannot install packages

2014-10-01 Thread 河内亮太
Hi, If your PC connects Internet via proxy server, you have to run Rgui.exe with option "--Internet2" (i.e. Rgui.exe --Internet2). If my suggestion doesn't make sense, please ignore. rgds. --- Ryota Kawauchi 2014/10/01 13:39、Sarah Hardy のメッセージ: > Hello, > > I have a student (running Wind

[R] Opening netCDF file with large number of variables but size is small in R

2014-10-01 Thread കുഞ്ഞായി kunjaai
Dear all, I am trying to open a netcdf file with size 1.2 MB contains more than 3000 variables using 'netcdf' package. I am facing problem that it taking more than 10 minute to open this small nc file. Is any way to make it fast ? I have attached one sample nc-file along with this mail.

Re: [R] Print list to text file with list elements names

2014-10-01 Thread jim holtman
The result of the 'lapply' is also printed, so try this: sink(sprintf("%s",filename)) invisible(lapply(myList,print)) sink() Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Oct 1, 2014 at 6:59 AM, In

Re: [R] Opening netCDF file with large number of variables but size is small in R

2014-10-01 Thread Michael Sumner
This is really a question for a package maintainer, but you don't say which package. Potentially ncdf4 may be slow with that many vars, try the open with suppress_dimvals=TRUE as an outrageously optimistic guess if that package is the one you use. We need more details from you, as per the posting

Re: [R] Opening netCDF file with large number of variables but size is small in R

2014-10-01 Thread Marc Girondot
Le 01/10/2014 13:11, കുഞ്ഞായി kunjaai a écrit : Dear all, I am trying to open a netcdf file with size 1.2 MB contains more than 3000 variables using 'netcdf' package. I am facing problem that it taking more than 10 minute to open this small nc file. Is any way to make it fast ? Have yo

Re: [R] Print list to text file with list elements names

2014-10-01 Thread William Dunlap
Omit the sink() statements to see what is happening - lapply(myList,print) prints each item in the list and then the output of lapply is printed via the autoprinting mechanism. If you put this into a function or saved the return value of lapply into a variable or wrapped the call to lapply in a cal

Re: [R] Print list to text file with list elements names

2014-10-01 Thread Ingrid Charvet
Hi Bill, thanks for your suggestions. Regarding the list elements names, your idea works well - thank you. However, my first issue is not resolved. I omitted the second sink statement, and R still created a text file with duplicate list elements. Then I omitted both sink statements (keeping only

Re: [R] Print list to text file with list elements names

2014-10-01 Thread William Dunlap
You want to put lapply(myList, print) inside a call to invisible invisible(lapply(myList, print)) (or put the whole sink(file)/lapply(...)/sink() sequence into a function or use tmp<-lapply(...) so autoprinting is suppressed) Bill Dunlap TIBCO Software wdunlap tibco.com On Wed, Oct 1, 201

Re: [R] Opening netCDF file with large number of variables but size is small in R

2014-10-01 Thread Thiago V. dos Santos
Dileepkumar, Which function are you using to open the netcdf file? Without a sample of your data it is not possible to reproduce your issue. However, opening a netcdf file should be straightforward with 'raster' (from raster package) or 'nc.open' (from ncdf4 package). Greetings, -- Thiago V.

[R] optimize

2014-10-01 Thread Nick gayeski
Page 53 of Robert and Casella's "Use R" book, Introduction to Monte Carlo Methods with R, has the following code: optimize(f=function(x){dbeta(x,2.7,6.3)}, + interval=c(0,1) ,max=T)$objective This should return [1] 2.669744 I run R from R Studio. When I enter this code I receive the

[R] power.t.test threading on 'power'

2014-10-01 Thread Stephen Kennedy
Simple question. A vector of ‘number of observations’ can be input to power.t.test, and a vector of ‘power’ s is output. But, inputting a vector of powers generates an error. Am I missing something? Vector of ’n’ s power.t.test(n=c(28,29,30), delta=2, sd=3, sig.level=0.05, type="two.sample",

Re: [R] Best Distribution

2014-10-01 Thread J. R. M. Hosking
On 2014-09-30 15:50, eliza botto wrote: Dear useRs, I have this following data dput(Prec) c(42.2, 45.2, 46, 48, 54, 54.1, 59.4, 61, 62.2, 63.5, 65.024, 71.9, 73.4, 76.6, 76.708, 77.5, 77.724, 78, 81.3, 84.7, 84.836, 85.09, 88.2, 91.4, 94, 95.8, 96, 97.3, 101, 101, 101.5, 102.3, 102.87, 108.7,

[R] ave documentation

2014-10-01 Thread John Christie
Hi, I was looking at the ave documentation and it seems awfully sparse. How about we change the description from: Subsets of x[] are averaged, where each subset consist of those observations with the same factor levels. to: Subsets of x[] are averaged, where each subset consist of those obser

Re: [R] optimize

2014-10-01 Thread William Dunlap
Change your 'max=T' to 'maximum=TRUE'. A long time ago the '...' in optimize's argument list was at the end, so you could abbreviate any of its argument names. Now the '...' is the third formal argument, so all the trailing arguments meant for optimize itself must be fully spelled out. Otherwise

[R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Kate Ignatius
Is there an easy way to check whether a variable is within +/- 10% range of another variable in R? Say, if I have a variable 'A', whether its in +/- 10% range of variable 'B' and if so, create another variable 'C' to say whether it is or not? Is there a function that is able to do that? eventua

Re: [R] power.t.test threading on 'power'

2014-10-01 Thread Uwe Ligges
On 01.10.2014 14:29, Stephen Kennedy wrote: Simple question. A vector of ‘number of observations’ can be input to power.t.test, and a vector of ‘power’ s is output. But, inputting a vector of powers generates an error. Am I missing something? Vector of ’n’ s power.t.test(n=c(28,29,30), del

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Peter Langfelder
On Wed, Oct 1, 2014 at 3:11 PM, Kate Ignatius wrote: > Is there an easy way to check whether a variable is within +/- 10% > range of another variable in R? Yes, checkRange = function(A, B, range = 0.1) { A>=B*(1-range) & A<=B*(1+range); } Test: A = c(67, 24, 40, 10, 70, 101, 9) B = c(76, 23

Re: [R] power.t.test threading on 'power'

2014-10-01 Thread Uwe Ligges
On 02.10.2014 00:27, Stephen Kennedy wrote: Thanks. I’ve been getting some nice workarounds. I was pleasantly surprised when the function ‘threaded’ on the number of samples, but I guess that was not really part of the design, just an accident. One could argue that the error message could

Re: [R] power.t.test threading on 'power'

2014-10-01 Thread Stephen Kennedy
Thanks. I’ve been getting some nice workarounds. I was pleasantly surprised when the function ‘threaded’ on the number of samples, but I guess that was not really part of the design, just an accident. Best, Steve On Oct 1, 2014, at 6:15 PM, Uwe Ligges wrote: On 01.10.2014 14:29, Stephen

Re: [R] power.t.test threading on 'power'

2014-10-01 Thread peter dalgaard
On 01 Oct 2014, at 14:29 , Stephen Kennedy wrote: > Simple question. A vector of ‘number of observations’ can be input to > power.t.test, and a vector of ‘power’ s is output. But, inputting a vector > of powers generates an error. Am I missing something? Power.t.test was written for scalar

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Peter Alspach
Tena koe Kate If kateDF is a data.frame with your data, then apply(kateDF, 1, function(x) isTRUE(all.equal(x[2], x[1], check.attributes = FALSE, tolerance=0.1))) comes close to (what I think) you want (but not to what you have illustrated in your 'eventual outcome'). Anyhow, it may be enough

Re: [R] optimize

2014-10-01 Thread peter dalgaard
Yup. And books don't rewrite themselves when the software changes, so if things don't seem to work, check the _current_ documentation. -pd On 01 Oct 2014, at 21:53 , William Dunlap wrote: > Change your 'max=T' to 'maximum=TRUE'. A long time ago the '...' in > optimize's argument > list was a

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Kate Ignatius
Apologise - yes, my 10% calculations seem to be slightly off. However, the function gives me all falses which seems to be a little weird. Even where both columns equal each other. Should that be right? In essence I want to check whether A and B equal other give or take 10%. On Wed, Oct 1, 20

Re: [R] How to check to see if a variable is within a range of another variable

2014-10-01 Thread Peter Alspach
Tena koe Kate This is what I get: kateDF # A B # 1 67 76 # 2 24 23 # 3 40 45 # 4 10 12 # 5 70 72 # 6 101 90 # 7 9 12 kateDF$C <- apply(kateDF, 1, function(x) isTRUE(all.equal(x[2], x[1], check.attributes = FALSE, tolerance=0.1))) kateDF # A B C # 1 67 76 FALSE # 2 24 23 T

[R] optimization question

2014-10-01 Thread Andras Farkas
Dear All, please provide help with the following: we have a <-c(0,1,1,0,1,0,0,0,0) b <-c(0,0,0,1,0,0,0,0,0) c <-c(1,0,1,0,1,1,0,0,0) d <-c(0,1,0,1,0,1,0,0,0) df <-rbind(a,b,c,d) df <-cbind(df,h=c(sum(a)*8,sum(b)*8,sum(c)*8,sum(d)*8)) df <-cbind(df,df[,8]*c(1,2,3,2)) I would like to minimize the

[R] Best Beginner Books?

2014-10-01 Thread Jason Eyerly
Hey Folks, I’m hoping to get a general consenus on a good book for someone with no prior experience in R that is new to data science and statistical analysis. So far, I’ve been recommended to read “Software For Data Analysis: Programming With R (Statistics And Computing)" by John Chambers. I

Re: [R] Best Beginner Books?

2014-10-01 Thread Christopher W Ryan
I would recommend these for the absolute beginner with R: "A Beginner's Guide to R" by Zuur and "Data Manipulation with R" by Spector I have not seen this, but if their pattern holds, this one coming out from Highland Statistics will also probably be useful for a newcomer: A Beginner's Guide to

Re: [R] Best Beginner Books?

2014-10-01 Thread memilanuk
On 10/01/2014 05:48 PM, Jason Eyerly wrote: Hey Folks, I’m hoping to get a general consenus on a good book for someone with no prior experience in R that is new to data science and statistical analysis. So far, I’ve been recommended to read “Software For Data Analysis: Programming With R (Statist

Re: [R] Best Beginner Books?

2014-10-01 Thread Jason Eyerly
A lot of excellent suggestions! Thank you everyone for the input. I�ve purchased via Amazon: "A Beginner's Guide to R" by Zuur "Data Manipulation with R" by Spector �Introductory Statistics with R.� by Peter Dalgaard Are there any suggestions as to which order I should read them in when they ar

[R] pmnorm to find cdf with linear decision bound

2014-10-01 Thread David Kikuchi
Hi all, I need help calculating the error rate of an optimal responder to a multidimensional discrimination task. I have been trying to use pmnorm to do this, but am not sure about its functionality. I'm working with a dataset of responses (binary, attack/not attack) of subjects who were aske

Re: [R] power.t.test threading on 'power'

2014-10-01 Thread Stephen Kennedy
Thanks. I only use R on occasion, but I knew I could work around it easily (and in fact some other users were nice enough to send some code). When it only worked when inputting n, I thought it might be just an accident, but thought I would ask. Thanks for the explanation. Best, Steve On

Re: [R] Best Beginner Books?

2014-10-01 Thread arnaud gaboury
On Thu, Oct 2, 2014 at 4:54 AM, Jason Eyerly wrote: > A lot of excellent suggestions! Thank you everyone for the input. I’ve > purchased via Amazon: > > "A Beginner's Guide to R" by Zuur > "Data Manipulation with R" by Spector > “Introductory Statistics with R.” by Peter Dalgaard > > Are there an