Re: [R] Reverse the scoring of some Columns of a Data Set

2017-03-08 Thread Daniel Nordlund
On 3/8/2017 6:14 AM, AbouEl-Makarim Aboueissa wrote: Dear All: goods morning Is there is a way to reverse the scoring of the first three columns x1, x2, and x3 and keep the original scores for the fourth column x4. *Here is an example of the data set:* x1 x2 x3 x4 2 5 4 4 1 1 1 6 1

Re: [R] Reverse the scoring of some Columns of a Data Set

2017-03-08 Thread Jeff Newmiller
Perhaps dta <- cbind( dta[ rev( seq.int( nrow( dta ) ) ), 1:3 ], dta[ , 4, drop=FALSE ] ) ? -- Sent from my phone. Please excuse my brevity. On March 8, 2017 6:14:25 AM PST, AbouEl-Makarim Aboueissa wrote: >Dear All: goods morning > >Is there is a way to reverse

[R] Reverse the scoring of some Columns of a Data Set

2017-03-08 Thread AbouEl-Makarim Aboueissa
Dear All: goods morning Is there is a way to reverse the scoring of the first three columns x1, x2, and x3 and keep the original scores for the fourth column x4. *Here is an example of the data set:* x1 x2 x3 x4 2 5 4 4 1 1 1 6 1 2 1 6 2 3 2 4 1 2 1 6 1 3 1 6 2 2

Re: [R] how to draw the confidence interval

2017-03-08 Thread laomeng_3
thanks a lot. 发自网易邮箱大师 On 2017-03-06 18:19 , Jim Lemon Wrote: Hi laomeng, If you know how to plot the means and calculate the standard deviations, perhaps look at the "dispersion" function in the plotrix package. Jim On Sat, Mar 4, 2017 at 5:39 PM, laomeng_3 wrote: >

Re: [R] FOR TAKING PERCENTAGES of OTUS in each column (n=2910 COLUMNs)

2017-03-08 Thread Thilini Maddegoda Vidanelage
Dear all, Thank you very much for all of your inputs. I finally managed to get a table with the percentages using R. I'm definitely going to invest more time to learn R. Thank you again for taking your valuable time to answer my question. Really appreciate it. *Thilini Jayasinghe* PhD Candidate

Re: [R] Has anyone created diagrammatic representations of Access/ODBC databases using R?

2017-03-08 Thread Chris Evans
Many thanks Paul, That looks very good and certainly the end result is absolutely along the lines I was hoping to find. I will read that article thoroughly and it will clearly teach me a lot about the graphics you used there. I was really hoping that someone might have wrapped something

Re: [R-es] Primer valor

2017-03-08 Thread Xavi tibau alberdi
Buenas, Tienes diversas formulas, una de ellas es crear una submuestra, con por ejemplo el comando subset(). Algo así como: datos_nuevos <- subset(datos_originales, datos_originales$datos1 == 0) Ahora puedes hacer las estadísticas que quieras con esta submuestra. Un saludo, Xavier Tibau

Re: [R] Why is merge sorting even when sort = F?

2017-03-08 Thread Dimitri Liakhovitski
I understood your answer. The point is that sort = TRUE that doesn't sort is plain confusing. Instead, the option should have been something like efficient = TRUE or FALSE. At least then no one would stupidly expect sort = TRUE to sort and sort = FALSE to NOT sort. On Wed, Mar 8, 2017 at 12:51

Re: [R] Why is merge sorting even when sort = F?

2017-03-08 Thread Jeff Newmiller
If you are still wondering, try re-reading my answer. FALSE is more efficient, TRUE is sorted. Lack of sorting has nothing to do with preserving order. -- Sent from my phone. Please excuse my brevity. On March 8, 2017 8:55:06 AM PST, Dimitri Liakhovitski wrote:

Re: [R] Why is merge sorting even when sort = F?

2017-03-08 Thread Rui Barradas
Hello, If you need to preserve the order you can do it like this. inx <- order(grades2$grade) result <- merge(grades2, info, by = "grade", all.x = T, all.y = F, sort = FALSE) result[order(inx), ] Hope this helps, Rui Barradas Em 08-03-2017 16:55, Dimitri Liakhovitski escreveu: Thank you.

Re: [R] Approach for Storing Result Data

2017-03-08 Thread Jeff Newmiller
Seems pretty normal except that your one-by-one lookup process usually gets old eventually, and comparing results is much easier if you merge the study data with the lookup data all at once and then use aggregate() (or any of numerous equivalents from contributed packages) to collect results or

Re: [R] Why is merge sorting even when sort = F?

2017-03-08 Thread Dimitri Liakhovitski
Thank you. I was just curious what sort=FALSE had no impact. Wondering what it is there for then... On Wed, Mar 8, 2017 at 11:43 AM, Jeff Newmiller wrote: > Merging is not necessarily an order-preserving operation, but sorting can > make the operation more efficient.

Re: [R] Why is merge sorting even when sort = F?

2017-03-08 Thread Jeff Newmiller
Merging is not necessarily an order-preserving operation, but sorting can make the operation more efficient. The sort=TRUE argument forces the result to be sorted, but sort=FALSE is in not a promise that order will be preserved. (I think the imperfect sorting occurs when there are multiple keys

Re: [R] Approach for Storing Result Data

2017-03-08 Thread Bert Gunter
This does not appear to be a legitimate topic for r-help: it is are not a consulting service. Please see the posting guide. Of course, others may disagree and reply. Wouldn't be the first time I'm wrong. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming

[R] Why is merge sorting even when sort = F?

2017-03-08 Thread Dimitri Liakhovitski
Hello! I have a vector 'grades' and a data frame 'info': grades2 <- data.frame(grade = c(1,2,2,3,1)) info <- data.frame( grade = 3:1, desc = c("Excellent", "Good", "Poor"), fail = c(F, F, T) ) I want to get the info for all grades I have in info: This solution resorts everything in the

[R] Approach for Storing Result Data

2017-03-08 Thread G . Maubach
Hi All, today I have a more general question concerning the approach of storing different values from the analysis of multiple variables. My task is to compare distributions in a universe with distributions from the respondents using a whole bunch of variables. Comparison shall be done on

[R] Has anyone created diagrammatic representations of Access/ODBC databases using R?

2017-03-08 Thread Chris Evans
I have been on a fair old learning curve handling a fairly complex Access database with my beloved, if sometimes tantaslising, R. I've been using RODBC to do this and, despite the database not being all that well designed, the power of R and RODBC has been fantastic (of course). Huge thanks to

Re: [R-es] Merge con fechas

2017-03-08 Thread Carlos J. Gil Bellosta
Hola, ¿qué tal? La mejor manera es transformar la tabla2 en otra con la estructura cliente - fecha - orden. Es decir, algo así como cliente / fecha / orden cli1 / dia1 / 1 cli1 / dia2 / 2 cli2 / dia3 / 1 cli2 / dia4 / 2 cli2 / dia5 / 3 ... Luego haces el join por fecha. Y en la tabla final,

[R] [R-pkgs] New package on CRAN: remindR

2017-03-08 Thread Bert Gunter
remindR is a simple, small package with essentially a single purpose: to Insert/extract text "reminders" into/from function source code comments or as the "comment" attribute of any object. The intent is that the former could be handy in the course of program development to remind one of e.g.

Re: [R] Transport and Earth Mover's Distance

2017-03-08 Thread Schuhmacher, Dominic
Dear Lorenzo, No, the code does not do what you are after. R-package transport is for point patterns and histograms in two and more dimensions. You have a distribution in one dimension. > 1) two distributions with the same bins (I identify each bin by the > central point in the bin). > >

[R] Follow-up: RStudio: Place for Storing Options (as plain text)

2017-03-08 Thread G . Maubach
Hi All, I got a late reply from RStudio Support concerning the question where RStudio store options and configurations: -- cut -- The post RStudio Config Files has a new comment. . . . Unfortunately, it's unlikely that we'll be able to provide a programmatic R interface in the near future --

[R] Follow-up: RStudio: Place for Storing Options

2017-03-08 Thread G . Maubach
Hi All, I got a late reply from RStudio Support concerning the question where RStudio store options and configurations: -- cut -- The post RStudio Config Files has a new comment. . . . Unfortunately, it's unlikely that we'll be able to provide a programmatic R interface in the near future --