Re: [R] [FORGED] Grouping Question

2020-03-21 Thread Rolf Turner
On 22/03/20 4:01 pm, Thomas Subia via R-help wrote: Colleagues, Here is my dataset. Serial Measurement Meas_test Serial_test 1 17 failfail 1 16 passfail 2 12 passpass 2 8

Re: [R] Grouping Question

2020-03-21 Thread Chris Evans
Here's a very "step by step" example with dplyr as I'm trying to teach myself the Tidyverse way of being library(dplyr) # SerialMeasurementMeas_testSerial_test # 117failfail # 116passfail # 2

Re: [R] Grouping Question

2020-03-21 Thread Ivan Krylov
On Sat, 21 Mar 2020 20:01:30 -0700 Thomas Subia via R-help wrote: > Serial_test is a pass, when all of the Meas_test are pass for a given > serial. Else Serial_test is a fail. Use by/tapply in base R or dplyr::group_by if you prefer tidyverse packages. -- Best regards, Ivan __

[R] Grouping Question

2020-03-21 Thread Thomas Subia via R-help
Colleagues, Here is my dataset. Serial Measurement Meas_test Serial_test 1 17 failfail 1 16 passfail 2 12 passpass 2 8 passpass 2 10 pass

Re: [R] No predict method for hbrfit

2020-03-21 Thread David Winsemius
On 3/21/20 4:09 PM, varin sacha via R-help wrote: Dear R-helpers, Using the HBR (high breakdown rank-based) robust estimator and the hbrfit function, I get an error saying Error in UseMethod("predict") for hbrfit. How can I solve the problem ? Many thanks for your help. What makes you thi

Re: [R] No predict method for hbrfit

2020-03-21 Thread Jeff Newmiller
Don't use packages that haven't been maintained. Or correspond with the author. Or, fix them yourself. On March 21, 2020 4:09:13 PM PDT, varin sacha via R-help wrote: >Dear R-helpers, > >Using the HBR (high breakdown rank-based) robust estimator and the >hbrfit function, I get an error saying E

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Jeff Newmiller
You really need to pick small problems and build solutions for them as functions rather than copy-pasting code. Then you can build more complicated solutions using those small solutions that can actually be understood. I suspect that in a few days you would not understand your own code because

[R] Error in FastTau(formula, data = d) : unused argument(s) (data = d)

2020-03-21 Thread varin sacha via R-help
Dear R-helpers, Another problem with FastTau function from the RobPer packages. Any solution to solve my problem would be highly appreciated. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "boot",dependencies=TRUE ) install.packages( "RobPer",dependencies=TRUE  ) library(boo

[R] No predict method for hbrfit

2020-03-21 Thread varin sacha via R-help
Dear R-helpers, Using the HBR (high breakdown rank-based) robust estimator and the hbrfit function, I get an error saying Error in UseMethod("predict") for hbrfit. How can I solve the problem ? Many thanks for your help. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustb

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
David, Great... exactly what I was looking for... Many thanks. Le samedi 21 mars 2020 à 21:12:31 UTC+1, David Winsemius a écrit : On 3/21/20 12:56 PM, varin sacha wrote: > Hi David, > > Perfect I got it now. One last precision, if I want to get the MSE value how > can I get it ? If

Re: [R] Strange error message, many thanks

2020-03-21 Thread David Winsemius
On 3/21/20 12:56 PM, varin sacha wrote: Hi David, Perfect I got it now. One last precision, if I want to get the MSE value how can I get it ? If I understand your question, it is answered in the help page: help(boot,pack=boot) # See the "Value" section  str(results) # List of 11 # $ t0

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
Hi David, Perfect I got it now. One last precision, if I want to get the MSE value how can I get it ? Le samedi 21 mars 2020 à 20:26:37 UTC+1, David Winsemius a écrit : On 3/21/20 12:18 PM, varin sacha wrote: >   mean((d[["y_obs "]] - ypred)^2) __

Re: [R] Strange error message, many thanks

2020-03-21 Thread David Winsemius
On 3/21/20 12:18 PM, varin sacha wrote: > mean((d[["y_obs "]] - ypred)^2) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
Hi Duncan, Hi David, Many thanks, ok for the first error but David when you say "The second error is the misspelling . Remove the space". Where do I have to remove the space ? Best, Sacha Le samedi 21 mars 2020 à 18:14:30 UTC+1, David Winsemius a écrit : On 3/21/20 9:35 AM, varin sach

Re: [R] Strange error message, many thanks

2020-03-21 Thread David Winsemius
On 3/21/20 9:35 AM, varin sacha via R-help wrote: Dear R-experts, Here below my R code giving an error message that I don't understand. If somebody can help me to fix it, it would be highly appreciated. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustbase",dependenci

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
Hello again, Here is the reproducible example: rm(list = ls()) library(plyr) library(dplyr) library( data.table) library(stringr) d1 <- data.frame( Name = rep(c('Hancilar et. al (2014) - CR/LDUAL school - Case V (Sd)', 'Rojas(2010) - CR/LFM/DNO 2storey',

Re: [R] Strange error message, many thanks

2020-03-21 Thread Duncan Murdoch
On 21/03/2020 12:35 p.m., varin sacha via R-help wrote: # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustbase",dependencies=TRUE ) install.packages( "boot",dependencies=TRUE ) library(boot) library(robustbase) n<-500 b<-runif(n, 0, 5) z <- rnorm(n, 2, 3) a <- runif(n, 0,

[R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
Dear R-experts, Here below my R code giving an error message that I don't understand. If somebody can help me to fix it, it would be highly appreciated. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustbase",dependencies=TRUE ) install.packages( "boot",dependencies=TRUE )

Re: [R] How to save output of multiple loops in a matrix

2020-03-21 Thread Jeff Newmiller
You have again posted using HTML and the result is unreadable. Please post a reproducible example using dput instead of assuming we can read your formatted code or table. On March 21, 2020 8:59:58 AM PDT, Ioanna Ioannou wrote: >Hello everyone, > >I am having this data.frame. For each row you h

Re: [R] cannot coerce class '"expression"' to a data.frame

2020-03-21 Thread William Dunlap via R-help
Try using the I() function in the call to data.frame. E.g., > d <- data.frame(X=1:3, Y=1:3, Substance=I(expression(H[2]*O, H[2] * O[2], H*S*O[4]))) > with(d, {plot(X,Y,type="n",xlim=c(0,4)); text(X, Y, Substance)}) Bill Dunlap TIBCO Software wdunlap tibco.com On Sat, Mar 21, 2020 at 1:45 AM Tr

[R] How to save output of multiple loops in a matrix

2020-03-21 Thread Ioanna Ioannou
Hello everyone, I am having this data.frame. For each row you have 26 values aggregated in a cell and separated by a comma. I want to do some calculations for all unique names and taxonomy which include the four different damage states. I can estimate the results but i am struggling to save the

[R] cannot coerce class '"expression"' to a data.frame

2020-03-21 Thread Troels Ring
Dear friends - I have some old data of chemical results and want to annotate the points with chemical formula. If I just do ID <- c("HCl 7","HCl 5.25","HCl 3.5","HCL 7 no Na","HCl 3.5 No Na", "HSO4 7 no Na", "HNO3 7 No Na") I can make a data.frame like DD <- data.frame(x=1:7,ID)