[R] plot command error message

2017-06-04 Thread Benjamin Gföhler
I tried to plot a clustered linear regression model with the cplot command in R (code below). Leaflet is a binary variable (I know logit would be better), partisan is nummeric variable (0-4) and partisan_mis a dummy (0,1). As you can see it is clustered around two variables: around individuals

Re: [R] Format y axis

2017-06-04 Thread Jim Lemon
Hi Pedro, Try this: par(mar=c(5,5,4,2)) plot(seq(0,9000,1000),yaxt="n",ylab="") axis(2,seq(1000,9000,1000), labels=formatC(seq(1000,9000,1000),format="f", big.mark=",",digits=2),las=2) Jim On Sun, Jun 4, 2017 at 7:11 PM, Pedro páramo wrote: > Hi all, > > I have been looking on documentation

Re: [R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread John Kane via R-help
I am not really sure what the warning means but I think your underlying problem is that all your variables are factors. Did you intend the values in each variable to be character? data.frame':    3 obs. of  5 variables:  $ V1: Factor w/ 3 levels "Name1","Name2",..: 1 2 3  $ V2: Factor w/ 3 levels

[R] Format y axis

2017-06-04 Thread Pedro páramo
Hi all, I have been looking on documentation but I´m not able to find how to customize format on y axis so that for example: y value goes from 1000 to 9000 it appears on thousand position a 1,000 and on the comas with "," and two decimals. (For the previous answers many thanks) [[altern

Re: [R] New var

2017-06-04 Thread David R Forrest
Sent from my iPhone > On Jun 4, 2017, at 1:36 PM, David L Carlson wrote: > > Since the number of choices is small (6), how about this? > > Starting with Jeff's initial DFM: > > DFM <- structure(list(obs = 1:6, start = structure(c(16467, 14710, 13152, > 13787, 15126, 12696), class = "Date"),

Re: [R] New var

2017-06-04 Thread David L Carlson
Since the number of choices is small (6), how about this? Starting with Jeff's initial DFM: DFM <- structure(list(obs = 1:6, start = structure(c(16467, 14710, 13152, 13787, 15126, 12696), class = "Date"), end = structure(c(17167, 14975, 13636, 13879, 15340, 12753), class = "Date"), D = c(700,

Re: [R] New var

2017-06-04 Thread Val
Thank you Jeff and All, Within a given time period (say 700 days, from the start day), I am expecting measurements taken at each time interval;. In this case "0" means measurement taken, "1" not taken (stopped or opted out and " -1" don't consider that time period for that individual. This wil

Re: [R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
Is this the solution? > d1<- as.data.frame(lapply(data,as.character),stringsAsFactors=FALSE) > str(d1) 'data.frame':3 obs. of 5 variables: $ V1: chr "Name1" "Name2" "Name3" $ V2: chr "nam1" "name_12" "name-1" $ V3: chr "nam2" "nam_34" "name-2" $ V4: chr "nam3" "nam_56" "" $ V5: chr

[R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
Here is a small reproducible example: data <- structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2", "Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label = c("nam1", "name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label = c("nam2", "nam_34", "name-2"), class = "

Re: [R] nmax parameter in factor function

2017-06-04 Thread peter dalgaard
No anomaly, it is just that you need to know what it is for, before trying to use it. Basically, duplicated() works by looking up entries in a hash table (for which there is a substantial literature, just google it). This will be somewhat more efficient if you know the number of unique values