Re: [R] dput(treat)

2017-10-11 Thread roslinazairimah zakaria
Hi, If you have a data, run dput(data), then in the console you will see the output. Copy the output and place it in your email. HTH. On Wed, Oct 11, 2017 at 6:59 PM, Ted Beginner (RStudio) via R-help < r-help@r-project.org> wrote: > > I got advice here that I didn't understand! Can I ask to

Re: [R-es] ggplot ayuda con argumento

2017-10-11 Thread Freddy Omar López Quintero
Hola. Plagiando parte de lo que está en: > > > https://stackoverflow.com/questions/12018499/how-to-put-labels-over-geom-bar-for-each-bar-in-r-with-ggplot2 > se puede usar algo como: dat <- read.table(text = "sample Types Number > sample1 A 3641 > sample2 A 3119 > sample1 B 15815 >

Re: [R] issues with the WD

2017-10-11 Thread Jim Lemon
Hi Peter, What is the command that you used in R-3.1.1? If this is embedded in code, do you still have the same directory structure that you had then? Jim On Thu, Oct 12, 2017 at 1:48 AM, Peter Wight wrote: > ood morning, > > I am reaching out to discus an issue I am

Re: [R] RFM analysis

2017-10-11 Thread Jim Lemon
Hi Hemant, Let's take it one step at a time. Save this code as "qdrfm.R" in your R working directory: It includes the comments I added last time and fixes a bug in the recency scoring. qdrfm<-function(x,rbreaks=3,fbreaks=3,mbreaks=3, date.format="%Y-%m-%d",weights=c(1,1,1),finish=NA) { # if no

Re: [R] about taylor.diagram

2017-10-11 Thread Jim Lemon
Hi lily, I assume that you are using the taylor.diagram function from the plotrix package. You have most likely started a plot window that is not square or specified margins that distort the plot. As your image did not come through, we can't see what has gone wrong. Jim On Wed, Oct 11, 2017 at

Re: [R] Converting SAS Code

2017-10-11 Thread Mitchell Maltenfort
I believe the lmerTest package's "difflsmeans" is what you need. On Wed, Oct 11, 2017 at 2:33 PM, Andrew Harmon wrote: > I have no problem setting up my mixed model, or performing anova or lsmeans > on my model’s outputs. However, performing lsd mean separation is

Re: [R] Converting SAS Code

2017-10-11 Thread Andrew Harmon
I have no problem setting up my mixed model, or performing anova or lsmeans on my model’s outputs. However, performing lsd mean separation is giving me fits. So I do not have a problem when using two-way anova model. When using the code: fit.yield.add <- lm(data = ryzup, Yield ~ Rep + Nitrogen

[R] issues with the WD

2017-10-11 Thread Peter Wight
ood morning, I am reaching out to discus an issue I am having with setting a working directing. I have tried github, stack overload, setwd, getwd, all to no avail. I am used to setting a working directory in 3.1.1 and have yet to get 3.4.1 to work properly. Let me know if there is anyone who I

Re: [R] about taylor.diagram

2017-10-11 Thread David Winsemius
> On Oct 10, 2017, at 9:22 PM, lily li wrote: > > Hi R users, > > I don't know if you have used taylor.diagram function. Why my diagram is > not like 1/4th of a round shape, but more flat, like 1/4th of an oval? > Thanks. Posters to rhelp are asked in the posting guide to

Re: [R] Iterate in a Spatial Polygon Dataframe in R?

2017-10-11 Thread Jon.SKOIEN
Ashraf, What do you want your function to do? Currently you are overwriting p each time you go through your for-loop, and you finally return p = x[nrow(x), ] It is similar to y = 101:200 for (i in 1:100) { x = y[i] } x Best, Jon -- Jon Olav Skøien European Commission Joint Research

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread David L Carlson
Minor modification: fff <- function(x) as.numeric(chartr(",", ".", x)) BX <- sapply(AX, fff) Or this keeps the original data frame: AX[, 1:2] <- sapply(AX[, 1:2], fff) David L Carlson Department of Anthropology Texas A University College Station, TX

[R] Iterate in a Spatial Polygon Dataframe in R?

2017-10-11 Thread Ashraf Afana via R-help
Hi all,  I'm trying to iterate in a SpatialPolygonDataFrame thatcontains 110 features. I tried to use the following code  iterate.spdf =function(x){ for (i in 1:nrow(x)){ p = x[i, ]} return(p)} but with no success as it returns with aSpatialPolygonDataFrame that contains onlyone feature. The

Re: [R] dput(treat)

2017-10-11 Thread Rui Barradas
Hello, The best way to post data is to use dput. The moderator/admin (?) did NOT say that you should "first get the structure, and then assign it back", they gave you an example of the use of dput and then what us, when reading your post would do with that output. They wrote that "Then we

Re: [R] dput(treat)

2017-10-11 Thread Michael Dewey
Dear Ted Comments in line On 11/10/2017 11:59, Ted Beginner (RStudio) via R-help wrote: I got advice here that I didn't understand! Can I ask to explain me the meaning of this procedure: first get the structure, and then assign it back. For what? Thanks!  (Great thanks to Moderator/Admin!)

[R] dput(treat)

2017-10-11 Thread RStudio
I got advice here that I didn't understand! Can I ask to explain me the meaning of this procedure: first get the structure, and then assign it back. For what? Thanks!  (Great thanks to Moderator/Admin!) You should learn to post in plain text and use dput to present your data structures. At

Re: [R] Notes for new R version 3.4.2

2017-10-11 Thread Uwe Ligges
Sounds like you have some base packages from an old version of R. Perhaps copy in another library tree that comes firt on the search path? Best, Uwe Ligges On 11.10.2017 02:58, kevin luo wrote: Dear officers, Sorry to bother you. Recently, I have installed the R version 3.4.2. But some

Re: [R] Unbalanced data in split-plot analysis with aov()

2017-10-11 Thread peter dalgaard
> On 11 Oct 2017, at 00:07 , Samuel Knapp wrote: > > Dear all, > > I'm analysing a split-plot experiment, where there are sometimes one or > two values missing. I realized that if the data is slightly unbalanced, > the effect of the subplot-treatment will also appear and

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread Eric Berger
Along the lines of Petr's followup: AXnew <- data.frame(lapply( AX, function(s) sub(",",".",s))) On Wed, Oct 11, 2017 at 10:59 AM, PIKAL Petr wrote: > And as follow up, > > fff<-function(x) gsub(",", ".", x) > > BX <- apply(apply(AX, 2, fff), 2, as.numeric) > > this

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread Troels Ring
Thanks a lot - BW Troels Den 11-10-2017 kl. 09:58 skrev Berend Hasselman: On 11 Oct 2017, at 09:45, Troels Ring wrote: Dear friends - I have a data.frame with "," instead of "." and found the discussion

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread PIKAL Petr
And as follow up, fff<-function(x) gsub(",", ".", x) BX <- apply(apply(AX, 2, fff), 2, as.numeric) this seems to be easier. Cheers Petr S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje | Research Manager PRECHEZA a.s. nábř. Dr. Edvarda Beneše 1170/24 | 750 02 Přerov |

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread Berend Hasselman
> On 11 Oct 2017, at 09:45, Troels Ring wrote: > > Dear friends - I have a data.frame with "," instead of "." and found the > discussion > > http://r.789695.n4.nabble.com/How-to-replace-all-commas-with-semicolon-in-a-string-tt4721187.html#a4721192 > > so copying the code of

Re: [R] changing "," to "." in data.frame

2017-10-11 Thread PIKAL Petr
Hi missing ) after if statement. adply(AX, 2, function(x){ if(!is.numeric(x[[1]])){ gsub(",", ".", x[[1]]) }else{ x[[1]] } }) However the data frame is transposed after the function which could be desired or not. Cheers Petr > -Original Message- > From: R-help

[R] changing "," to "." in data.frame

2017-10-11 Thread Troels Ring
Dear friends - I have a data.frame with "," instead of "." and found the discussion http://r.789695.n4.nabble.com/How-to-replace-all-commas-with-semicolon-in-a-string-tt4721187.html#a4721192 so copying the code of Ulrik(I hope:-)) I tried (making some data) AX <-

Re: [R] "Time Series Plotting"

2017-10-11 Thread PIKAL Petr
Hi keep your emails to R help, I do not offer private consultance and others could have different opinion how to solve your problem. Did you even try my suggestion? If not, why not? If yes in what respect it does not comply with your expectations. Cheers Petr From: niharika singhal