[R] Sampling

2015-03-30 Thread Partha Sinha
I have 1000 data points. i want to take 30 samples and find mean. I also want to repeat this process 100 times. How to go about it? Regards Parth __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

Re: [R-es] Resumen de R-help-es, Vol 73, Envío 40

2015-03-30 Thread miguel.angel.rodriguez.muinos
Por lo que comentas parece que tuvieras Java de 32 bits y que quisieras hacerlo funcionar con R de 64 bits. Lo mejor es que tengas las dos versiones de Java instaladas puesto que hay software que lo requiere en 32bits y otro en 64. Ejemplo: Aunque tu sistema operativo sea de 64 bits, si usas un

Re: [R] generating phi using function()

2015-03-30 Thread Daniel Nordlund
The argument 'K' is missing since you are only passing four arguments to the phi() function, but you defined it with five formal parameters. It looks like the argument 'j' is not necessary in the function. It is an unnecessary carry-over from the summation notation and it is never used in

[R] temporal autocorrelation in MCMCglmm

2015-03-30 Thread David Villegas Ríos
Hi, For a number of individuals, I have measured several behavioral traits in the wild. Those traits (e.g. home range) can be estimated on different temporal scales, for example daily, weekly or monthly. I want to estimate repeatability of those traits, assuming that the daily/weekly/monthly

Re: [R] Sampling

2015-03-30 Thread Daniel Nordlund
On 3/29/2015 11:10 PM, Partha Sinha wrote: I have 1000 data points. i want to take 30 samples and find mean. I also want to repeat this process 100 times. How to go about it? Regards Parth __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

[R-es] Nueva publicación en blog en r-es.org

2015-03-30 Thread web
Nueva publicación en blog: Cursos, CURSO NO PRESENCIAL CONTROL DE CALIDAD CON R, por vaamonde en 30/03/15 10:27h Ver el blog en: http://r-es.org/tiki-view_blog_post.php?blogId=4postId=98 Si no desea recibir estas notificaciones siga este enlace: http://r-es.org/tiki-user_watches.php?id=49

Re: [R] matrix manipulation question

2015-03-30 Thread Berend Hasselman
On 30-03-2015, at 09:59, Stéphane Adamowicz stephane.adamow...@avignon.inra.fr wrote: Le 27 mars 2015 à 18:01, David Winsemius dwinsem...@comcast.net a écrit : On Mar 27, 2015, at 3:41 AM, Stéphane Adamowicz wrote: Well, it seems to work with me. No one is doubting that it

Re: [R] matrix manipulation question

2015-03-30 Thread peter dalgaard
On 30 Mar 2015, at 09:59 , Stéphane Adamowicz stephane.adamow...@avignon.inra.fr wrote: However, in order to help me understand, would you be so kind as to give me a matrix or data.frame example where « complete.cases(X)== T » or « complete.cases(X)== TRUE » would give some unwanted

[R] POSIX and ecdf()

2015-03-30 Thread Doran, Harold
Below is some working code that, generally speaking, accomplishes why I want, but am looking for a necessary improvement in the final step. The code below scrapes data from a website (thousands of pages actually) and organizes athlete�s scores in a data frame. The final variable, called

Re: [R-es] Comparaciones múltiples

2015-03-30 Thread Pedro Concejero Cerezo
Hola, Quizas puedas considerar tus contrastes como comparaciones o contrastes planificados (planned contrasts o creo que tambi�n llamados por algunos a-priori contrasts). Una b�squeda r�pida da algunos buenos ejemplos: https://www.google.es/search?q=r+anova+planned+contrasts Por ejemplo

Re: [R] matrix manipulation question

2015-03-30 Thread Stéphane Adamowicz
Le 27 mars 2015 � 18:01, David Winsemius dwinsem...@comcast.net a �crit : On Mar 27, 2015, at 3:41 AM, St�phane Adamowicz wrote: Well, it seems to work with me. No one is doubting that it worked for you in this instance. What Peter D. was criticizing was the construction :

[R] Fwd: non-conformable arguments

2015-03-30 Thread Soheila Khodakarim
Dear Thierry Onkelinx, Thank you so much to answer me. But I do not know what information I should send for you I want to run neural network on my data.I run these codes and I saw this Error in the last line #load mydata dim(mydata) # 20 3111 library(neuralnet) fm - as.formula(paste(resp ~,

Re: [R] non-conformable arguments

2015-03-30 Thread Thierry Onkelinx
We need enough information to run your code on our computer and get the same error as you. In this case we are missing the data. See e.g. http://adv-r.had.co.nz/Reproducibility.html If you can't provide the original data, then try to make a (small) example which reproduces your problem. ir.

Re: [R] A problem someone should know about

2015-03-30 Thread Peter Claussen
Rich, You’ve probably reported the error to the wrong group. A quick search suggests this is not an R issue, but an RStudio issue. The error message is unique enough. Google returns this as the first link:

[R] changing column labels for data frames inside a list

2015-03-30 Thread Vikram Chhatre
summary(mygenfreqt) Length Class Mode dat1.str 59220 -none- numeric dat2.str 59220 -none- numeric dat3.str 59220 -none- numeric head(mylist[[1]]) 1 2 3 4 5 6 7 8 91011 12 L0001.1 0.60 0.500 0.325 0.675 0.600 0.500 0.500

[R] Joint distribution of wind data

2015-03-30 Thread Nasr Al-Dhurafi
* Hi, ** I'm dealing with wind data and I'd like to model their** distribution.** Wind** direction * * are typically following a vonmises distribution and wind speeds **follow a weibull distribution. I'd like to build a joint** distribution** of directions and speeds as a VonMises-Weibull

Re: [R] vif in package car: there are aliased coefficients in the model

2015-03-30 Thread Rodolfo Pelinson
Thanks a lot for the answer and I'm sorry for the silly question! Also thanks for the conceptual advice! It was also a doubt of me and my advisors. Best! 2015-03-28 15:17 GMT-03:00 John Fox j...@mcmaster.ca: Dear Rodolfo, Sending the data helps, though if you had done what I suggested, you

[R] Multiple Plots using ggplot

2015-03-30 Thread Frederic Ntirenganya
Dear All, I want to plot multiple using ggplot function from a data frame of many columns. I want to plot only str1, str2 and str3 and I failed to make it. What I want is to compare str1, str2 and str3 by plotting vertical line. I also need to add points to the plot to be able to separate them.

Re: [R] Ayuda con un árbol de regresión

2015-03-30 Thread Jose Iparraguirre
Miguel, Sin tus datos es imposible brindarte una respuesta precisa pero ten en cuenta que la descripción del argumento 'fórmula' en la función tree del paquete del mismo nombre dice que la variable dependiente -PRECIO en tu caso- debe ser un vector numérico si quieres estimar un árbol de

[R] data.frame: data-driven column selections that vary by row??

2015-03-30 Thread David Wolfskill
Sorry if that's confusing: I'm probably confused. :-( I am collecting and trying to analyze data regarding performance of computer systems. After extracting the data from its repository, I have created and used a Perl script to generate a (relatively) simple CSV, each record of which contains: *

Re: [R] generating phi using function()

2015-03-30 Thread JLucke
Your function phi has 5 arguments with no defaults. Your call only has 3 arguments. Hence the error message. phi - function(w1, w2, j, k, K){ + zaehler - (k/K)^(w1-1)*(1-k/K)^(w2-1) + nenner - sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1)) + return( zaehler/nenner ) + } phi(c(1, 1), 44L,

[R] Again: A problem someone should know about

2015-03-30 Thread Ian Lester
i have no idea what to do plot(body.fat, BMI,xlab=Body fat,ylab=BMI,main=“Figure 2.1: BMI vs Body fat (n=252)”) Error: unexpected input in plot(body.fat, BMI,xlab=Body fat,ylab=BMI,main=� plot(body.fat, BMI,xlab=Body fat,ylab=BMI) serious error. This application, or a library it uses, is

[R] non-conformable arguments

2015-03-30 Thread Soheila Khodakarim
Dear All, I want to run neural network on my data. i run these codes: #load mydata dim(mydata) # 20 3111 library(neuralnet) fm - as.formula(paste(resp ~, paste(colnames(mydata)[1:3110], collapse=+))) out - neuralnet(fm,data=mydata, hidden = 4, lifesign = minimal, linear.output = FALSE,

Re: [R-es] Comparaciones múltiples

2015-03-30 Thread Javier Villacampa González
Hola Miguel yo tengo una función para hacer comparaciones multiples ( muy util si hacer medidas repetidas, ya que en el otro caso tienes la función HSD) t.test.Comparison.Function.Ch - function( data, StringResponse, StringFactor){ # Factor

Re: [R] non-conformable arguments

2015-03-30 Thread Thierry Onkelinx
You should sent us a commented, minimal, self-contained, reproducible code as the posting guide tells you to do. Your code is not self-contained. So we can only speculate what when wrong. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

Re: [R] Multiple Plots using ggplot

2015-03-30 Thread stephen sefick
Hi Frederic, Can you provide a minimal reproducible example including either real data (dput), or simulated data that mimics your situation? This will allow more people to help. Stephen On Mon, Mar 30, 2015 at 8:39 AM, Frederic Ntirenganya ntfr...@gmail.com wrote: Dear All, I want to plot

Re: [R] Again: A problem someone should know about

2015-03-30 Thread Sarah Goslee
On Mon, Mar 30, 2015 at 1:59 AM, Ian Lester ianleste...@gmail.com wrote: i have no idea what to do One of the other responses already told you it was probably an Rstudio problem, so not using Rstudip seems like a good place to start. Sarah plot(body.fat, BMI,xlab=Body

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread MacQueen, Don
Assuming that the elements of mylist are data frames, try this: mylist - lapply(mylist, function(e) { names(e) - paste0('pop',1:12) ; e}) With certain exceptions, the result of a function is the result of the last expression in the function body. As you defined it, the last expression was

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Ivan Calandra
I am not sure it would do it since there is no reproducible example, but try names() instead of colnames(). HTH, Ivan -- Ivan Calandra, ATER University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA - 2 esplanade Roland Garros 51100 Reims, France +33(0)3 26 77 36 89

[R] error MANOVA in R

2015-03-30 Thread Gian Maria Niccolò Benucci
Dear R-usrs, I am trying to perform a MANOVA on a data frame with 31 columns about soil parameters and 1 column containing the explanatory variable (Fraction) that have three levels. my code is the following: datam - read.table(data_manova2.csv, header=T, sep=,) names(datam) manova_fraction2 -

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Bert Gunter
Sarah's statement is correct. So is yours. They are not contradictory, and I believe Sarah's point was that the OP needed to learn the appropriate syntax. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge

Re: [R] Again: A problem someone should know about

2015-03-30 Thread David L Carlson
In your first example you created logfat.lm and then tried to plot logfat so you got an error indicating that logfat did not exist. In your second example we have no idea what body.fat. You must make your examples reproducible so that we can reproduce your error. It looks like you could also

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sarah Goslee
colnames(e) - paste0('pop',1:12) isn't a function and doesn't return anything. mylist - list( + data.frame(a = runif(10), b = runif(10)), + data.frame(c = runif(10), d = runif(10)), + data.frame(e = runif(10), f = runif(10))) mylist2 - lapply(mylist, function(e){colnames(e) - paste0('pop',

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sven E. Templer
On 30 March 2015 at 16:47, Sarah Goslee sarah.gos...@gmail.com wrote: colnames(e) - paste0('pop',1:12) isn't a function and doesn't return anything. But function(e){colnames(e) - paste0('pop', 1:2)} is a function and it returns something (the last evaluated expression! - here the paste0

[R] Transformation of the circular variable into linear variable

2015-03-30 Thread Nasr Al-Dhurafi
I am working with a circular data ( wind direction ) and i have problem in transforming the circular variable into linear variable. I have found an equation that can be used to convert the circular variable into linear variable which is included in this paper * ARMA based approaches for

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Vikram Chhatre
First of all, thank you for all the quick replies. Here is a solution that worked for me. mylist2 - lapply(mylist, function(e){colnames(e) - paste0('pop',1:12); return(e)}) head(mylist2[[1]]) pop1 pop2 pop3 pop4 pop5 pop6 pop7 pop8 pop9 pop10 pop11 pop12 L0001.1 0.60 0.500

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sven E. Templer
On 30 March 2015 at 17:19, Vikram Chhatre crypticline...@gmail.com wrote: First of all, thank you for all the quick replies. Here is a solution that worked for me. mylist2 - lapply(mylist, function(e){colnames(e) - paste0('pop',1:12); return(e)}) head(mylist2[[1]]) pop1 pop2

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sven E. Templer
On 30 March 2015 at 17:31, Bert Gunter gunter.ber...@gene.com wrote: Sarah's statement is correct. So is yours. They are not contradictory, and I believe Sarah's point was that the OP needed to learn the appropriate syntax. That's why I pointed to ?return. Sarah's statement was not so clear

[R] Vennerable plot

2015-03-30 Thread gktahon
Hi all, I frequently use Vennerable to design diagrams of my data. However, when I want to make a weighed diagram for a set of 4 samples, type ChowRuskey, I get a nice view, but the font size of both numbers and sample names is too small. Furthermore, the place of the sample names isn't always

[R] Fwd: changing column labels for data frames inside a list

2015-03-30 Thread Bert Gunter
Sorry, I failed to cc the list. -- Bert -- Forwarded message -- From: Bert Gunter bgun...@gene.com Date: Mon, Mar 30, 2015 at 8:36 AM Subject: Re: [R] changing column labels for data frames inside a list To: Vikram Chhatre crypticline...@gmail.com You really really need to

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sarah Goslee
On Mon, Mar 30, 2015 at 11:43 AM, Sven E. Templer sven.temp...@gmail.com wrote: On 30 March 2015 at 17:31, Bert Gunter gunter.ber...@gene.com wrote: Sarah's statement is correct. So is yours. They are not contradictory, and I believe Sarah's point was that the OP needed to learn the

Re: [R] Debug package options

2015-03-30 Thread Duncan Murdoch
On 30/03/2015 1:50 PM, Keith S Weintraub wrote: Folks, I would like change some of the options for the Tk window that pops up when using the debug package. I know how to change the options: e.g. options(debug.font = Courier 12 italic”). Is there a way to “preset” these in my

Re: [R-es] comparaciones múltiples

2015-03-30 Thread Luciano Selzer
Recomiendo que veas el paquete lsmeans. Podes especificar comparaciones dentro factores. Saludos Luciano El 29 de marzo de 2015, 11:36, Miguel Lázaro lazar...@yahoo.es escribió: Hola a todos, yo he tenido el mismo problema y después de hablar con mucha gente que a su vez habló con mucha

[R] multinomial probabilities with mlogit

2015-03-30 Thread Ingrid Charvet
Hello, When fitting a logit multinomial model with mlogit I can retrieve the response probabilities using fit$fitted.values (for a given object fit) However, I am trying to calculate those response probabilities myself using the maximum likelihood estimates (i.e. fit$coefficients) given by

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread MacQueen, Don
Regarding the averages, someone else mentioned that it's preferred to start a new question in a new post to the list. That said, you are confusing inside the list with outside the list. Try this: (the following R expression is supposed to be all on one line, but my email software may cause a

[R] Debug package options

2015-03-30 Thread Keith S Weintraub
Folks, I would like change some of the options for the Tk window that pops up when using the debug package. I know how to change the options: e.g. options(debug.font = Courier 12 italic”). Is there a way to “preset” these in my environment so when debug starts up I have all the options set

Re: [R] A problem someone should know about

2015-03-30 Thread Richard M. Heiberger
My error is Mac because I don't use R-Studio. The phrasing of Ian's error is similar to the error I reported and still occasionally get. As I said, it is random and therefore not reproducible. This is consistent with the comments on the rstudio link you pointed us to. Rich On Mon, Mar 30,

Re: [R] multinomial probabilities with mlogit

2015-03-30 Thread Rolf Turner
Reproducible example??? cheers, Rolf Turner P.S. Where does mlogit come from? Note fortune(182). R. T. On 31/03/15 06:46, Ingrid Charvet wrote: Hello, When fitting a logit multinomial model with mlogit I can retrieve the response probabilities using fit$fitted.values (for a given

Re: [R] Help with POSIX

2015-03-30 Thread Jeff Newmiller
You seem to be trying to make POSIXt into something it isn't, as though this was Excel. First, POSIXt is not the same as numeric. You can convert between them, but they are not the same. If you want to do numeric operations, convert. Second, POSIXt is not time of day only. When you provide

Re: [R] Help with POSIX

2015-03-30 Thread David Wolfskill
On Tue, Mar 31, 2015 at 01:15:09AM +, Doran, Harold wrote: I?m struggling a bit with learning about POSIX objects to do some basic things with objects of this class. Suppose I have the following simple example times - c(03:20, 29:56, 03:30, 21:03, 56:26) aa - strptime(times, %M:%S?)

[R] Mann-Kendall test for many independent columns data set at a time

2015-03-30 Thread Desta Yoseph via R-help
I am analyzing trend test using Mann-kendall monotonic trendtest for 10,368 independent grid cell, each grid has 34 years dataset.  I supposed to find Kendall “tau” for each gridcell (each grid has 34 years data). The data is arranged in column wise (Iattached  part of the grid dataset  as a

[R] Plotting using tapply function output

2015-03-30 Thread Alexandra Catena
Hello, I am trying to plot the hourly standard deviation of wind speeds from 13 different measured locations over many years. I imported the data using readLines and into a dataframe called finalData. Using tapply, I determined the standard deviation of the windspeed (ws) for each hour (hour)

[R] Trying to understand a function passed to lapply

2015-03-30 Thread John Sorkin
Colleagues, I am trying to understand the syntax of a function passed to apply. The code below generates a matrix, and passes the matrix to a function that is called by apply. I don't understand the syntax of the function. In some way the function computes data[,delta]/data[,SE]. I can't

Re: [R] Trying to understand a function passed to lapply

2015-03-30 Thread William Dunlap
I can't understand how the body of the function, x[c1]/x[c2] refers to the columns data and SE of the matrix data. If you put the line 'str(x)' at the start of myfun(), as in myfun - function(x, c1, c2) { str(x) x[c1]/x[c2] } you would start to see why it works - extracting a

[R] Help with POSIX

2015-03-30 Thread Doran, Harold
I�m struggling a bit with learning about POSIX objects to do some basic things with objects of this class. Suppose I have the following simple example times - c(03:20, 29:56, 03:30, 21:03, 56:26) aa - strptime(times, %M:%S�) I can do means, and some other basic things, but I cannot correlate

Re: [R] Plotting using tapply function output

2015-03-30 Thread Jim Lemon
Hi Alexandra, This produces a rather messy plot, but it might get you started: finalData-data.frame(ws=sample(0:100,1300,TRUE), stn=rep(1:13,each=100),hour=rep(1:24,length.out=1300)) statHour = tapply(finalData$ws,list(finalData$stn,finalData$hour),sd) # open a wide device x11(width=13) # leave

Re: [R] Trying to understand a function passed to lapply

2015-03-30 Thread Jim Lemon
Hi John, What happens is that you have passed two named arguments to your function myfun along with the matrix data. Because these arguments have associated values (delta, SE), these values are substituted into the expression like this: x[delta]/x[SE] which is the return value of myfun. If you

Re: [R] Multiple Plots using ggplot

2015-03-30 Thread Frederic Ntirenganya
Hi Stephen, Sorry, the data came in bad way. Here is the head of the data. head(data)Date Number.of.Rain.Days Total.rain Start.of.Rain..i. Start.of.Rain..ii. Start.of.Rain..iii. Start.Rain..iv. 1 1952-01-01 86 1139.95292 239 112

[R] generating phi using function()

2015-03-30 Thread T.Riedle
Hi, I am struggling with following function phi - function(w1, w2, j, k, K){ + zaehler - (k/K)^(w1-1)*(1-k/K)^(w2-1) + nenner - sum( ((1:K)/K)^(w1-1)*(1-(1:K)/K)^(w2-1)) + return( zaehler/nenner ) + } phi(c(1, 1), 44L, 1) Error in phi(c(1, 1), 44L, 1) : argument k is missing, with no

Re: [R] Help with POSIX

2015-03-30 Thread Ben Tupper
Hi, On Mar 30, 2015, at 9:15 PM, Doran, Harold hdo...@air.org wrote: I�m struggling a bit with learning about POSIX objects to do some basic things with objects of this class. Suppose I have the following simple example times - c(03:20, 29:56, 03:30, 21:03, 56:26) aa - strptime(times,

[R] how to deal with changing weighting functions

2015-03-30 Thread T.Riedle
Hi everybody, Does anybody have an idea how I can generate tau according to the attached formula? The point is that phi changes with k and I thought I could make it by using a for-function in R but I am not sure how to do that. Could anyone help me? Thanks in advance.

Re: [R] temporal autocorrelation in MCMCglmm

2015-03-30 Thread Ben Bolker
David Villegas Ríos chirleu at gmail.com writes: Hi, For a number of individuals, I have measured several behavioral traits in the wild. Those traits (e.g. home range) can be estimated on different temporal scales, for example daily, weekly or monthly. I want to estimate repeatability of

Re: [R] changing column labels for data frames inside a list

2015-03-30 Thread Sven E. Templer
On 30 March 2015 at 17:50, Sarah Goslee sarah.gos...@gmail.com wrote: On Mon, Mar 30, 2015 at 11:43 AM, Sven E. Templer sven.temp...@gmail.com wrote: On 30 March 2015 at 17:31, Bert Gunter gunter.ber...@gene.com wrote: Sarah's statement is correct. So is yours. They are not