[R] R-help

2017-11-08 Thread john lukore
Generate a clustered pattern in [0; 1]2 as follows: (a) Generate nc, say 20, independent cluster centres (which can be called parents) that are distributed i.i.d. uniformly in the unit square; (b) then n daughters are assigned i.i.d. uniformly to these parents and such that each daughter is

Re: [R] Help Converting Calendars

2017-11-08 Thread Jim Lemon
Or if you want a slightly prettier output: formatDate<-function(x) { return(paste(x$year,formatC(x$month,width=2,flag=0), formatC(x$day,width=2,flag=0),sep="-")) } formatDate(p.dates) Jim On Thu, Nov 9, 2017 at 10:32 AM, David L Carlson wrote: > How about > >> p_dates <-

Re: [R] Help Converting Calendars

2017-11-08 Thread David L Carlson
How about > p_dates <- paste0(p.dates[[3]], "-", p.dates[[2]], "-", p.dates[[1]]) > myData$p_dates <- p_dates > print(myData, right=FALSE) dates p_dates 1 2017-10-01 1396-7-9 2 2017-10-02 1396-7-10 3 2017-10-03 1396-7-11 > str(myData) 'data.frame': 3 obs. of 2 variables: $ dates :

[R] Help Converting Calendars

2017-11-08 Thread Jeff Reichman
R-Help Trying to convert a Gregorian calendar dataset to a Persian calendar dataset. But I end up with a list and not sure what to do. For example ... dates <- c("2017-10-1","2017-10-2","2017-10-3") myData <- data.frame(dates) myData$dates <- as.Date(myData$dates, format = "%Y-%m-%d") >

Re: [R] Missing information in source()

2017-11-08 Thread Tom Backer Johnsen
Hello Thank you all for most useful responses. I was looking for answers in the wrong place, that is why I have not responded before! Tom Backer Johnsen > On 7 Nov 2017, at 21:25, Rui Barradas wrote: > > Hello, > > Try > > print(head(...)) > > Hope this helps, > >

Re: [R] Sharing an R installation via NFS on ubuntu cluster

2017-11-08 Thread Ista Zahn
On Wed, Nov 8, 2017 at 6:14 AM, Florian Oswald wrote: > hi all, > > i want to share an R installation from a master node to several compute > nodes via NFS. all nodes run ubuntu 16.04. I tried building R from source > but hit a wall several times because of missing

[R] Sharing an R installation via NFS on ubuntu cluster

2017-11-08 Thread Florian Oswald
hi all, i want to share an R installation from a master node to several compute nodes via NFS. all nodes run ubuntu 16.04. I tried building R from source but hit a wall several times because of missing dependencies. So I am looking for something that uses the usual apt-get install proceedure, but

Re: [R] Ggplot error

2017-11-08 Thread John Kane via R-help
I get the same result as Eric  withR version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 17.04 It looks like you have "tidyverse" loaded so I tried it with just ggplot2 loaded and with tidyverse loaded.  On Wednesday, November 8, 2017, 4:16:14 AM EST,

[R] dendrogram adjustment in heatmap.2

2017-11-08 Thread Fix Ace via R-help
Dear R Community, Is there a way to adjust the line width of the dendrogram in heat map.2 function? I tried "lwd", but it didn't work... Also, is there a way to adjust the general height/width/position of the dendrogram using heatmap.2 function? I feel the portion of the dendrogram is huge

Re: [R] Adding Records to a Table in R

2017-11-08 Thread Eric Berger
Hi Paul, The following worked for me: library(lubridate) dataset1 <- read.csv("dataset1.csv",stringsAsFactors=FALSE) dataset1$TransitDate <- mdy(dataset1$TransitDate) TransitDateFrame <- data.frame(TransitDate=seq(as.Date("1985-10-01"), as.Date("2017-10-01"), by = "month")) dataset1NEW <-

Re: [R] Adding Records to a Table in R

2017-11-08 Thread PIKAL Petr
Sorry, I was too quick Should be dput(TransitDateFrame[1:20,]) dput(dataset1[1:20, ]) Cheers Petr > Hi > > Instead of attachments copy directly result of dput(TransitDateFrame) and > dput(dataset1) to your email. Or, if your data have more than about 20 rows > you could copy only part of it. >

Re: [R] Adding Records to a Table in R

2017-11-08 Thread PIKAL Petr
Hi Instead of attachments copy directly result of dput(TransitDateFrame) and dput(dataset1) to your email. Or, if your data have more than about 20 rows you could copy only part of it. dput(TransitDateFrame[,1:20]) dput(dataset1[,1:20]) Only with this approach we can evaluate your data in all

Re: [R] Adding Records to a Table in R

2017-11-08 Thread Paul Bernal
Dear Eric, Hope you are doing great. I also tried the following: #First I created the complete date sequence TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]), as.Date(dataset1[nrow(dataset1),1]), by = "month")) #Then I did the merging dataset1NEW <-

Re: [R] Adding Records to a Table in R

2017-11-08 Thread Paul Bernal
Dear Eric, thank you for your kind reply, Assume dataset1Frame is the table containing the missing dates, and TransitDateFrame <- seq(as.Date(dataset1Frame[1,1]), as.Date(dataset1Frame[nrow(dataset1Frame),1]), "months") #dataset1Frame is basically reading some fields from a SQL Server table,

Re: [R] Problem with r project in ubuntu xenial

2017-11-08 Thread Ista Zahn
On Tue, Nov 7, 2017 at 6:46 PM, George Balas wrote: > For anyone who sees this conversation. > > There is a bug in installation of igraph in R language in Ubuntu. There is > a solution in stackoverflow. A link would be nice. We have to use the devtools. Write this code: >

Re: [R] Ggplot error

2017-11-08 Thread Zeki ÇATAV
Thanks, I think, I found the problem. It seems to related locale setting. If I start with 'LANG=C R' everything's good. -- Zeki Çatav zekicatav.com On Nov 8, 2017 1:56 PM, "John Kane" wrote: I get the same result as Eric with R version 3.4.2 (2017-09-28) Platform:

Re: [R] Ggplot error

2017-11-08 Thread Eric Berger
I was not able to reproduce this problem. I tried two environments 1. Ubuntu 14.04.5 LTS, R version 3.4.2 (same R version as yours) 2. Windows 10, same R version On Wed, Nov 8, 2017 at 9:50 AM, Zeki ÇATAV wrote: > Hello, > I've an error recently. > > ggplot(data = mtcars,

[R] Ggplot error

2017-11-08 Thread Zeki ÇATAV
Hello, I've an error recently. ggplot(data = mtcars, aes(x= wt, y= mpg)) + geom_line() Error: Found object is not a stat. > sessionInfo() R version 3.4.2 (2017-09-28) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS Matrix products: default BLAS: