Re: [R] library Dplyr

2016-08-24 Thread Partha Sinha
yes. I start a fresh session and start to load the library On 25 August 2016 at 09:34, Jeff Newmiller wrote: > And the only input you give to trigger this is > > library(dplyr) > > ? > -- > Sent from my phone. Please excuse my brevity. > > On August 24, 2016 8:01:41

Re: [R] [FORGED] Rotating points, preferably in grid

2016-08-24 Thread Thomas Levine
Well this is great. Now I have answers for both graphics and grid. The rot argument is exactly what I had wanted, except that I had imagined it also working on points. But I had not thought to use unicode, and that will probably make this plot even easier. Thanks

Re: [R] library Dplyr

2016-08-24 Thread Jeff Newmiller
And the only input you give to trigger this is library(dplyr) ? -- Sent from my phone. Please excuse my brevity. On August 24, 2016 8:01:41 PM PDT, Partha Sinha wrote: >i have used sessioninfo() >the output I have got >R version 3.3.1 (2016-06-21) >Platform:

Re: [R] [FORGED] Rotating points, preferably in grid

2016-08-24 Thread Paul Murrell
Hi Do you mean something like this ... ? library(grid) grid.newpage() pushViewport(viewport(xscale=c(-2,2), yscale=c(-2,2))) grid.text('T', cos(theta), sin(theta), default.units="native", rot=(360/(2*pi))*(theta+(1/4)*2*pi)) Paul On 25/08/16 14:16, Thomas Levine wrote: I want to

Re: [R] library Dplyr

2016-08-24 Thread Partha Sinha
i have used sessioninfo() the output I have got R version 3.3.1 (2016-06-21) Platform: i386-w64-mingw32/i386 (32-bit) Running under: Windows 7 (build 7600) locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 [3] LC_MONETARY=English_United Kingdom.1252

Re: [R] Rotating points, preferably in grid

2016-08-24 Thread Dalthorp, Daniel
Silly? Not really. It's simple. It works. You could jump into unicode for your text and make it look nicer, e.g., using '\u2191' or some other shape in place of 'T' http://unicode.org/charts/ http://unicode.org/charts/PDF/U2190.pdf -Dan On Wed, Aug 24, 2016 at 7:16 PM, Thomas Levine

[R] Rotating points, preferably in grid

2016-08-24 Thread Thomas Levine
I want to make a plot in polar coordinates. I want to use pch with shapes that do not have radial symmetry, so I want to rotate them such that they face inwards. I am using grid for my plotting, but I provide motivating examples in graphics. The following plot almost gets me what I want. theta

[R] How do you capture warning messages from rstan package's stan() function, when running an R script that calls stan() on the command line?

2016-08-24 Thread Qian Sophia Zhang
Hi R people, I have an R script Fit12_for_stack.R that calls rstan’s stan(). When I run the code in an interactive R session, I see warning messages from stan() about divergent transitions, but when I run the code on the command line with “Rscript Fit12_for_stack.R”, I don’t see stan() warning

Re: [R] lme to determine if there is a group effect

2016-08-24 Thread Bert Gunter
I never used the groupedData structure, precisely because I found it confusing, but I think: 1. group is *not* a (random) grouping variable; it's a fixed effect covariate. 2. so I believe your groupedData call should be: GD<- groupedData(value~time|SS,data=data1,outer = group) Of course, as you

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread William Dunlap via R-help
dump("yourObject", file=stdout()) is, IMO, a bit nicer than plain dput(yourObject). It makes copying and pasting even easier by putting "yourObject <-" in front of dput()'s output so readers don't have to type that themselves. E.g., > myData <- data.frame(X=1:2, Y=c(exp(1), pi)) > dump("myData",

[R] lme to determine if there is a group effect

2016-08-24 Thread John Sorkin
I apologize for sending this message again. The last time I sent it, the subject line was not correct. I have corrected the subject line. I am trying to run a repeated measures analysis of data in which each subject (identified by SS) has 3 observations at three different times (0, 3, and 6).

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread John Sorkin
I am trying to run a repeated measures analysis of data in which each subject (identified by SS) has 3 observations at three different times (0, 3, and 6). There are two groups of subjects (identified by group). I want to know if the response differs in the two groups. I have tried to used lme.

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread Jim Lemon
Hi John, I think it is "dput". Jim On Thu, Aug 25, 2016 at 8:00 AM, John Sorkin wrote: > > There is a function that can be used to convert data structures such as a > data frame into a different format that allows the data to be sent to the > mailing list. The

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread David Winsemius
> On Aug 24, 2016, at 3:00 PM, John Sorkin wrote: > > > There is a function that can be used to convert data structures such as a > data frame into a different format that allows the data to be sent to the > mailing list. The structure that is created can be used

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread Bert Gunter
?dput Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Aug 24, 2016 at 3:00 PM, John Sorkin wrote: > > There is

Re: [R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread John Sorkin
Jim, Yes, you are correct! Give yourself a pat on the back and a gold start THANK YOU, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical

[R] function that converts data into a form that can be included in a question to mailing list

2016-08-24 Thread John Sorkin
There is a function that can be used to convert data structures such as a data frame into a different format that allows the data to be sent to the mailing list. The structure that is created can be used to easily reconstruct the data structure. Unfortunately, I don't remember the function

Re: [R] aggregate

2016-08-24 Thread Gang Chen
Yes, this works out perfectly! Thanks a lot, David. Have a wonderful day... On Wed, Aug 24, 2016 at 4:24 PM, David L Carlson wrote: > This will work, but you should double-check to be certain that CP and > unique(myData[, 3:5]) are in the same order. It will fail if N is not

Re: [R] Loop over folder files

2016-08-24 Thread Juan Ceccarelli Arias
Ok. Please, declare this issue as solved. And thanks again for your help. On Wed, Aug 24, 2016 at 2:18 PM, wrote: > Maybe it's better to open a new thread. > > Rui Barradas > > > Citando Juan Ceccarelli Arias : > > The error wasn't in the loop. It was in

Re: [R] Loop over folder files

2016-08-24 Thread Juan Ceccarelli Arias
The error wasn't in the loop. It was in the file list. It's running now because i added full.names option to TRUE fuente=list.files("C:/Users/Jceccarelli/Bases/Stata", pattern="dta$", full.names=T) Now R can proccess the data. Now it callapses or stops because other kind of error. ¿Should i open

Re: [R] question about cleaning up data labels on a plot3d plot

2016-08-24 Thread LMH
Sarah Goslee wrote: text3d(x, y, z, text=letters[1:10], cex=2 Thank you for the help. Is there a way to remove the text from the plot as well. I am finding it difficult to see what I am looking for with the text in the way. It would be useful to be able to identify a point and then clear the

[R] package.skeleton fails

2016-08-24 Thread Strunk, Jacob (DNR)
Hello, I have been using package.skeleton from within an lapply statement successfully (assuming good source code) with the following setup in the past: writeLines("testfun=function(){}", "c:\\temp\\testfun.r") x=try(package.skeleton("test_pack",path="c:\\temp\\tests\\",code_files=

Re: [R] aggregate

2016-08-24 Thread David L Carlson
This will work, but you should double-check to be certain that CP and unique(myData[, 3:5]) are in the same order. It will fail if N is not identical for all rows of the same S-Z combination. > CP <- sapply(split(myData, paste0(myData$S, myData$Z)), function(x) + crossprod(x[, 1], x[,

Re: [R] aggregate

2016-08-24 Thread Gang Chen
Thanks again for patiently offering great help, David! I just learned dput() and paste0() now. Hopefully this is my last question. Suppose a new dataframe is as below (one more numeric column): myData <- structure(list(X = c(1, 2, 3, 4, 5, 6, 7, 8), Y = c(8, 7, 6, 5, 4, 3, 2, 1), N =c(rep(2.1,

Re: [ESS] turning off ess-r-package-mode

2016-08-24 Thread Tyler Smith
The `ess-r-package-auto-activate` toggle isn't working for me. From `emacs -Q`, I'm setting up with this script: (require 'package) (setq package-load-list '((ess t) (julia-mode t)) (package-initialize) (require 'ess-site) (setq ess-r-package-auto-activate nil) And I'm still getting

[ESS] turning off ess-r-package-mode

2016-08-24 Thread Tyler Smith
Hi, I am working on a package that is currently unloadable (conflicts between NAMESPACE and current R/ code). Working on this is very difficult, because I can't convince ESS to treat my code files as regular files, rather than as part of the package. For example, I can pass a class definition to

Re: [R] A question on data frame

2016-08-24 Thread David Winsemius
> On Aug 24, 2016, at 11:48 AM, Christofer Bogaso > wrote: > > Hello again, > > Let say I have a data.frame which I call as reference data frame : > > Ref = data.frame(c("a", "d", "c", "e", "f", "x"), matrix(NA, 6, 5)) > colnames(Ref) = c("a1", "a2", "a3", "a4",

[R] A question on data frame

2016-08-24 Thread Christofer Bogaso
Hello again, Let say I have a data.frame which I call as reference data frame : Ref = data.frame(c("a", "d", "c", "e", "f", "x"), matrix(NA, 6, 5)) colnames(Ref) = c("a1", "a2", "a3", "a4", "a5", "a6") Ref Now I have another data.frame, which I call as value data frame : Value =

Re: [R] question about cleaning up data labels on a plot3d plot

2016-08-24 Thread Sarah Goslee
You could take a look at ?identify3d You should probably also read https://cran.r-project.org/web/packages/rgl/vignettes/rgl.html Beyond that, if it's difficult to see what you're looking for, maybe you should rethink your approach. Sarah On Wed, Aug 24, 2016 at 1:21 PM, LMH

Re: [R] Loop over folder files

2016-08-24 Thread ruipbarradas
Maybe it's better to open a new thread. Rui Barradas   Citando Juan Ceccarelli Arias : > The error wasn't in the loop. It was in the file list. > It's running now because i added full.names option to TRUE > fuente=list.files("C:/Users/Jceccarelli/Bases/Stata", >

Re: [R] aggregate

2016-08-24 Thread David L Carlson
You need to spend some time with a basic R tutorial. Your data is messed up because you did not use a simple text editor somewhere along the way. R understands ', but not ‘ or ’. The best way to send data to the list is to use dput: > dput(myData) structure(list(X = c(1, 2, 3, 4, 5, 6, 7, 8),

Re: [R] aggregate

2016-08-24 Thread Gang Chen
Thanks a lot, David! I want to further expand the operation a little bit. With a new dataframe: myData <- data.frame(X=c(1, 2, 3, 4, 5, 6, 7, 8), Y=c(8, 7, 6, 5, 4, 3, 2, 1), S=c(‘S1’, ‘S1’, ‘S1’, ‘S1’, ‘S2’, ‘S2’, ‘S2’, ‘S2’), Z=c(‘A’, ‘A’, ‘B’, ‘B’, ‘A’, ‘A’, ‘B’, ‘B’)) > myData X Y S Z 1

Re: [R] aggregate

2016-08-24 Thread David L Carlson
Your is fine, but it will be a little simpler if you use sapply() instead: > data.frame(Z=levels(myData$Z), CP=sapply(split(myData, myData$Z), + function(x) crossprod(x[, 1], x[, 2]))) Z CP A A 10 B B 10 David C -Original Message- From: Gang Chen [mailto:gangch...@gmail.com]

Re: [R] Loop over folder files

2016-08-24 Thread Juan Ceccarelli Arias
I just doesn't work... Im loading the read,dta13 package already. When i try to perform a simple table(sex), i received the "File not found" message. However, if i load the data using the file.choose() option inside read.dta13, i can open the stata file. I don't know what am i doing wrong... On

Re: [R] aggregate

2016-08-24 Thread Gang Chen
Thank you all for the suggestions! Yes, I'm looking for the cross product between the two columns of X and Y. A follow-up question: what is a nice way to merge the output of lapply(split(myData, myData$Z), function(x) crossprod(x[, 1], x[, 2])) with the column Z in myData so that I would get a

Re: [R] library Dplyr

2016-08-24 Thread Jeff Newmiller
This is not normal. I suggest making use of the maintainer() and sessionInfo() functions. -- Sent from my phone. Please excuse my brevity. On August 24, 2016 7:47:25 AM PDT, Partha Sinha wrote: >I am using windows 7 , R version 3.3.1 >whenever I am trying use

Re: [R] question about cleaning up data labels on a plot3d plot

2016-08-24 Thread Sarah Goslee
Sure, you can do any of that in R. You might benefit from reading some introductory material so you understand at least graphical parameters and subsetting, but here's some sample code with fake data that does what you're asking. library(rgl) x <- sort(rnorm(10)) y <- rnorm(10) z <- rnorm(10) +

Re: [R] Loop over folder files

2016-08-24 Thread ruipbarradas
Hello, That means that probably the files are in a different folder/directory. Use getwd() to see what is your current directory and setwd("path/to/files") to set the right place where the files can be found. Rui Barradas   Citando Juan Ceccarelli Arias : > I just doesn't

[R] library Dplyr

2016-08-24 Thread Partha Sinha
I am using windows 7 , R version 3.3.1 whenever I am trying use library(dplyr) i am getting the follwing error: Error in get(Info[i, 1], envir = env) : cannot allocate memory block of size 2.5 Gb Error: package or namespace load failed for ‘dplyr’ pl help Regards Partha

Re: [R] aggregate

2016-08-24 Thread David L Carlson
Thank you for the reproducible example, but it is not clear what cross product you want. Jim's solution gives you the cross product of the 2-column matrix with itself. If you want the cross product between the columns you need something else. The aggregate function will not work since it will

Re: [R] Hierarchical Clustering in R

2016-08-24 Thread K. Elo
Hi, what is the exact problem? I tried you code and it works fine... Best, Kimmo 24.08.2016, 10:07, Serpil ŞEN wrote: Dear Authorized Sir / Madam, I need your help on clustering with R. I have symmetric distance matrix which i created usign ClustalOmega program. and used this R codes for

Re: [R] Estimated Effects Not Balanced

2016-08-24 Thread peter dalgaard
On 22 Aug 2016, at 17:15 , Justin Thong wrote: > Something does not make sense in R. It has to do with the question of > balance and unbalance. > > *A<-factor(c(1,1,1,1,1,1,2,2,2,2,2,2))* > *B<-factor(c(1,1,2,2,3,3,1,1,2,2,3,3))* > *y<-rnorm(12)* > *mod<-aov(y~A+B)*

[R] Hierarchical Clustering in R

2016-08-24 Thread Serpil ŞEN
Dear Authorized Sir / Madam, I need your help on clustering with R. I have symmetric distance matrix which i created usign ClustalOmega program. and used this R codes for clustering purpose. *data=read.table("my_distance_matrix", header=FALSE)[-1]* *attach(data)* *head(data)*

[R] question about cleaning up data labels on a plot3d plot

2016-08-24 Thread LMH
Hello, I am rather unfamiliar with R but need a 3D plot for something I am working on. I was able to generate a plot with the following, library(rgl) setwd("G:/shared_data/R_projects/3D_plot") df <- read.table("R_input_3D_PCA-3_RI9_60.txt", header = TRUE) plot3d(df$PCA_Axis1, df$PCA_Axis2,