Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane
You have curly quotes rather than plain ones here : col=4,type=“l”,xlab=“Region”,ylab=“factor") John Kane Kingston ON Canada -Original Message- From: d...@u.washington.edu Sent: Wed, 10 Jun 2015 11:32:59 -0700 To: rosit...@gmail.com Subject: Re: [R] graphs, need urgent help (deadline :

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane
Hi Don, You got caught by the old curly quotation marks vs plain quotations problem. My guess is that at one point the code went through HTML or a word processor that automatically changes straight quotes " to curly ” (if that comes through). A couple of long and painful debugging sessions

Re: [R] Milisecond problem in as.POSIXct ?

2015-06-10 Thread Joshua Ulrich
This is known behavior with how POSIXt objects are printed. See the discussion on StackOverflow: http://stackoverflow.com/questions/7726034/how-r-formats-posixct-with-fractional-seconds On Wed, Jun 10, 2015 at 7:41 PM, ce wrote: > Dear all, > > my main problem is with miliseconds. I have an arr

[R] Milisecond problem in as.POSIXct ?

2015-06-10 Thread ce
Dear all, my main problem is with miliseconds. I have an array : library(xts) options(digits.secs = 3) > x [1] "2015-06-10 10:22:06.389 EDT" "2015-06-10 10:22:07.473 EDT" [3] "2015-06-10 10:22:08.717 EDT" "2015-06-10 10:22:09.475 EDT" > x[1] [1] "2015-06-10 10:22:06.38 EDT" > x[2] [1] "2015-06-1

[R] help with ff matrix indexing and value assignment

2015-06-10 Thread Ken Nussear
Hi all I'm trying to make some assignments to an ffdf using values coming in as 3 columns (row, col, values) As an example with a regular matrix assigning data (d) to row r and column c from a data frame assigns the 3 specific values as desired reg.mat <- matrix(0, nrow=5, ncol=5) > reg.mat

[R] Different behavior of model.matrix between R 3.2 and R 3.1.1

2015-06-10 Thread Frank Harrell
For building design matrices for Cox proportional hazards models in the cph function in the rms package I have always used this construct: Terms <- terms(formula, specials=c("strat", "cluster", "strata"), data=data) specials <- attr(Terms, 'specials') stra<- specials$strat Terms.ns <- Ter

Re: [R] Finding index of specific values in a data.frame

2015-06-10 Thread David Winsemius
On Jun 10, 2015, at 1:00 PM, Kevin Kowitski wrote: > Oh I see, I'm sorry I just plopped it in GitHub for ease of help, I didn't > notice I put it under coursera work. This task is not related to coursera, I > will separate it out. > > -Kevin > > Sent from my iPhone > >> On Jun 10, 2015, at

[R] Revolutions blog: May 2015 roundup

2015-06-10 Thread David Smith
Since 2008, Revolution Analytics staff and guests have written about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you missed them, here are

Re: [R] Split data frame into 250-row chunks

2015-06-10 Thread David Winsemius
On Jun 10, 2015, at 5:39 AM, Liz Hare wrote: > Hi R-Experts, > > I have a data.frame like this: > >> head(map) > chr snp poscm posbpdist > 1 1 M1 2.99043 3249189 NA > 2 1 M2 3.06457 3273096 0.07414 > 3 1 M3 3.17018 3307151 0.10561 > 4 1 M4 3.20892 3319643 0.03874 > 5

Re: [R] powerTransform Convergence error

2015-06-10 Thread John Fox
Dear Brittany, As explained in ?powerTransform, this function uses optim() to optimize a generalized Box-Cox criterion. For explanation of return codes, see ?optim. In particular, code 1 indicates that the maximum number of iterations was exceeded. Although you might try increasing the permitt

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
Here is code that IS tested. I am sending Rosa the (ugly) output in a separate file. Crazy problems with argument order; I never figured out exactly what was wrong. # therapy plot plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],xlab="Region",ylab="f

[R] ggpairs question

2015-06-10 Thread Roy Mendelssohn - NOAA Federal
Hi All: I am not totally grasping GGally, in particular how to customize ggpairs (or maybe I need to use a different part of GGally for what I want). Toy example: > dput(junk) > structure(list(state1 = c(-1.78772815343945, 0.347049897473099, > -0.18529149576171, 1.79047951942822, 1.133454846

Re: [R] Split data frame into 250-row chunks

2015-06-10 Thread David Winsemius
On Jun 10, 2015, at 12:18 PM, David Winsemius wrote: > > On Jun 10, 2015, at 5:39 AM, Liz Hare wrote: > >> Hi R-Experts, >> >> I have a data.frame like this: >> >>> head(map) >> chr snp poscm posbpdist >> 1 1 M1 2.99043 3249189 NA >> 2 1 M2 3.06457 3273096 0.07414 >> 3 1

Re: [R] Split data frame into 250-row chunks

2015-06-10 Thread Marc Schwartz
> On Jun 10, 2015, at 2:21 PM, Marc Schwartz wrote: > > >> On Jun 10, 2015, at 7:39 AM, Liz Hare wrote: >> >> Hi R-Experts, >> >> I have a data.frame like this: >> >>> head(map) >> chr snp poscm posbpdist >> 1 1 M1 2.99043 3249189 NA >> 2 1 M2 3.06457 3273096 0.07414 >> 3

Re: [R] Finding index of specific values in a data.frame

2015-06-10 Thread David Winsemius
On Jun 10, 2015, at 9:41 AM, Kevin Kowitski wrote: > Hey everyone, > > I am new to R and I am trying to find the index of all of the values in a > data.frame. I have a .csv file that outputs pass, fail, error, and > indeterminate readings. I have passed the data from the .csv to a > dat

Re: [R] Split data frame into 250-row chunks

2015-06-10 Thread Marc Schwartz
> On Jun 10, 2015, at 7:39 AM, Liz Hare wrote: > > Hi R-Experts, > > I have a data.frame like this: > >> head(map) > chr snp poscm posbpdist > 1 1 M1 2.99043 3249189 NA > 2 1 M2 3.06457 3273096 0.07414 > 3 1 M3 3.17018 3307151 0.10561 > 4 1 M4 3.20892 3319643 0.03874

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
You were caught by a mysterious issue that I don’t understand either. plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[therapy.df$sample==50],col=4,type=“l”,xlab=“Region”,ylab=“factor") Error: unexpected input in "plot(therapy.df$Region[therapy.df$sample==50],therapy.df$factor.a[

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
belay that — something else is wrong > On Jun 10, 2015, at 11:21 AM, Don McKenzie wrote: > > You need to substitute the real name of the data frame for “my.data”. That > was just my example. :-) > >> On Jun 10, 2015, at 11:03 AM, Rosa Oliveira > > wrote: >> >> Sor

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Rosa Oliveira
Sorry, I taught I attached the cvs file :) Don, I tried, but I got an error: > my.data$Region [1] 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 > my.data$sample [1] 50 50 50 50 50 50 50 50 50 50 250 250 250 250 250 250

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
You need to substitute the real name of the data frame for “my.data”. That was just my example. :-) > On Jun 10, 2015, at 11:03 AM, Rosa Oliveira wrote: > > Sorry, > > I taught I attached the cvs file :) > > > > > Don, > > I tried, but I got an error: > > > my.data$Region > [1] 1 2

[R] nonlinear MVA in R/knitr

2015-06-10 Thread Jan de Leeuw
http://rpubs.com/deleeuw/83572. The paper uses monotone B-splines and majorization in an R function that implements nonlinear generalizations of PCA, multiple regression, image analysis, SEM. And much more. This extends methods in the CRAN package `aspect`. The theory has been around for 30 yea

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
For a legend, try (untested) legend(0.15,0.9,c("factora","factorb","factorc"),col=c(4,2,3),lty=1) If it overlaps data points move the first two arguments (0.15 and 0.9) around, or change the “ylim” argument in the plot() to ~1.2. to avoid clutter, put the line-types information in the figure ca

[R] powerTransform Convergence error

2015-06-10 Thread Brittany Demmitt
Hello, I am trying to use the powerTransform function in the package car to identify the lambda: transform my data. However, I receive the following warning: Warning message: In estimateTransform(x, y, NULL, ...) : Convergence failure: return code = 1 I can not find a description of what ret

[R] Finding index of specific values in a data.frame

2015-06-10 Thread Kevin Kowitski
Hey everyone,    I am new to R and I am trying to find the index of all of the values in a data.frame.   I have a .csv file that outputs pass, fail, error, and indeterminate readings.  I have passed the data from the .csv to a data.frame, have performed the proper matching criteria to generate

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Rosa Oliveira
Dear All, I attach my data. Dear Jim, when I run your code (even the one you send me, not in my data), I get: Don't know how to automatically pick scale for object of type function. Defaulting to continuous Error in data.frame(x = c(0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.2, 0.1, : argumen

Re: [R] reading as date

2015-06-10 Thread Rui Barradas
Hello, Inline. Em 10-06-2015 13:03, khatri escreveu: Hey sorry for my typing. I have actually used the same format with % that is No you have not, like others allready have told you. You need %H:%M:%S not H:M:S. strptime(dd,"%d/%m %H:%M:%S") [1] "2015-01-21 11:11:11 GMT" Hope this helps,

[R] Split data frame into 250-row chunks

2015-06-10 Thread Liz Hare
Hi R-Experts, I have a data.frame like this: > head(map) chr snp poscm posbpdist 1 1 M1 2.99043 3249189 NA 2 1 M2 3.06457 3273096 0.07414 3 1 M3 3.17018 3307151 0.10561 4 1 M4 3.20892 3319643 0.03874 5 1 M5 3.28120 3342947 0.07228 6 1 M6 3.29624 3347798 0.01504 I

[R] PORT Library

2015-06-10 Thread Lise Cahuzac
I am looking for the documentation of the PORT algorithm used in order to resolve problem of optimization on the software R. I am using the package optimx which is using the PORT routines, but there is not information about how it works. I have a code of convergence saying : "See PORT documentation

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Don McKenzie
> On Jun 10, 2015, at 9:08 AM, Rosa Oliveira wrote: > > Dear All, > > > I attach my data. > > Dear Jim, > > when I run your code (even the one you send me, not in my data), I get: > > Don't know how to automatically pick scale for object of type function. > Defaulting to continuous > Err

Re: [R] Different random intercepts but same random slope for groups

2015-06-10 Thread li li
Thanks all for the reply, I think what Bert specified is what I wanted. Thanks very much. So this model allows different random intercept term but the same random slope term for the three methods. I have an additional question. I would like to require differnt residual variance also for the three

Re: [R] Symbols to data set

2015-06-10 Thread jim holtman
Is this what you want: > x <- read.table(text = "place Rupees Percentage Dollars + India 125248 + USA 78000 5640 + UK 6 50 56" + , header = T

Re: [R] How to validate the cluster analysis?

2015-06-10 Thread Jeff Newmiller
>> PS: I have marked this mail to both help and devel list. Is it ok? No. >> [[alternative HTML version deleted]] Failing to post in plain text format on this list can quickly lead to miscommunication. Note that reading the Posting Guide would have addressed both of these issues. ---

Re: [R] Change Julian function in SPlus to R date code

2015-06-10 Thread boB Rudis
The parameters for the built-in julian() are a bit different. This should be what you can use: start <- julian(as.Date(sprintf("%d-%d-%d", nn, mt1, 1)), origin=as.Date("1971-01-01")) end <- julian(as.Date(sprintf("%d-%d-%d", nn, mt2, 1)), origin=as.Date("1971-01-01"))

Re: [R] How to validate the cluster analysis?

2015-06-10 Thread John Kane
Hi Harmeet, Welcome to R-help but I think you are here too soon. This is a list for helping people do things in R once they have some idea of what tey need to do in terms of statistics etc. There are mobs of stats experts here but this not the list you should be asking in unless I am misunde

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread John Kane
Hi Jim, I was looking at that last night and had the same problem of visualizing what Rosa needed. Hi Rosa This is nothing like what you wanted and I really don't understand your data but would something like this work as a substitute or am I completely lost? dat1 <- structure(list(region

Re: [R] Summarizing data based on Date

2015-06-10 Thread John Kane
Hi Shivi I think the names issue is just that that is aggregate()'s default. Just rename using ?names For the 'sort' problem, AFAIK you cannot sort within aggregate(), at least not how you are doing it, nor do you want to do a sort(). You need ?order for what you want to do with a data.frame.

Re: [R] reading as date

2015-06-10 Thread Jeff Newmiller
Your example is not the same as the answers you have received. Look again. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] reading as date

2015-06-10 Thread Sarah Goslee
No really, what Jim said: you need the % for H:M:S as well. > dd<-c("21/01 11:11:11") > strptime(dd,"%d/%m %H:%M:%S") [1] "2015-01-21 11:11:11 EST" On Wed, Jun 10, 2015 at 8:03 AM, khatri wrote: > Hey sorry for my typing. > I have actually used the same format with % that is > > >> dd<-c("21/01

Re: [R] How to validate the cluster analysis?

2015-06-10 Thread stephen sefick
You could look at silhouette width in, I think, the cluster package. Please excuse my brevity; this message was sent from my telephone. On Jun 10, 2015 1:37 AM, "My List" wrote: > All, > > I am new to the world of statistics. I am interested in finding out the > validation techniques employed on

Re: [R] reading as date

2015-06-10 Thread khatri
Hey sorry for my typing. I have actually used the same format with % that is > dd<-c("21/01 11:11:11") > strptime(dd,"%d/%m H:M:S") [1] NA it is giving NA. -- View this message in context: http://r.789695.n4.nabble.com/reading-as-date-tp4708434p4708441.html Sent from the R help mailing li

[R] Symbols to data set

2015-06-10 Thread venkadesan venky
Hello Friends, I have a data like this place Rupees Percentage Dollars India 125248 USA 78000 5640 UK 6 50 56 and i want to make Rupees co

Re: [R] Change Julian function in SPlus to R date code

2015-06-10 Thread Adams, Jean
Try looking at the julian() function in base ... ?julian Jean On Wed, Jun 10, 2015 at 2:46 AM, roslinazairimah zakaria < roslina...@gmail.com> wrote: > Dear r-users, > > I have a code in SPlus which use julian function. What is the similar code > used in R? > > define.date1<-function(dt1,mt1,m

Re: [R] reading as date

2015-06-10 Thread Jim Lemon
Hi khatri, strptime("6/20 21:56:32","%m/%d %H:%M:%S") [1] "2015-06-20 21:56:32 AEST" You forgot the % signs in the format for H:M:S Jim On Wed, Jun 10, 2015 at 8:20 PM, khatri wrote: > My date column is in following format : "%m/%d H:M:S" > There is not mention of year in the data.So how can I

Re: [R] reading as date

2015-06-10 Thread K. Elo
Hi! 10.06.2015, 13:20, khatri wrote: My date column is in following format : "%m/%d H:M:S" There is not mention of year in the data.So how can I read this using strptime function. I have tried strptime(dates,"%m/%d H:M:S") but this is returning NA. Thanks How about: strptime(dates,"%m/%d %H:%

[R] Change Julian function in SPlus to R date code

2015-06-10 Thread roslinazairimah zakaria
Dear r-users, I have a code in SPlus which use julian function. What is the similar code used in R? define.date1<-function(dt1,mt1,mt2,nn,da) { mt2<-mt2+1 start<-julian(mt1, 1, nn, origin=c(month=1, day=1, year=1971))+1 end<-julian(mt2, 1, nn, origin=c(month=1, day=1, year=1971))+da a<-dt1[start

[R] reading as date

2015-06-10 Thread khatri
My date column is in following format : "%m/%d H:M:S" There is not mention of year in the data.So how can I read this using strptime function. I have tried strptime(dates,"%m/%d H:M:S") but this is returning NA. Thanks -- View this message in context: http://r.789695.n4.nabble.com/reading-as-d

Re: [R] graphs, need urgent help (deadline :( )

2015-06-10 Thread Jim Lemon
Hi Rosa, Like Don, I can't work out what you want and I don't even have the picture. For example, your specification of color and line type leaves only one point for each color and line type, and the line from one point to the same point is not going to show up. Here is a possibility that may lead

Re: [R] Cross-over Data with Kenward-Roger correction

2015-06-10 Thread peter dalgaard
On 08 Jun 2015, at 22:59 , Ben Bolker wrote: > As a statistical point, I don't understand why you can't just > do a paired t-test on these data?? It's a cross-over trial, so you need to account for the period effect. However, a standard way of treating it is by to calculate period differences