[R] Discrepancies in the estimates of Partial least square (PLS) in SAS and R

2012-05-02 Thread rakeshnb
I have been using R and SAS from past 6 months and i found a interesting thing while doing PLS in R and SAS is that when we use NO SCALE option in SAS and scale=FALSE in R , we see the estimates are matching but if we use scaling option in SAS and R the estimates differ to greater extent , you can

[R] Rprofile.site in R 2.15.0 on Windows?

2012-05-02 Thread Spencer Graves
Hello: I have so far failed to get Rprofile.site to be processed in R 2.15.0 under Windows 7 as I remember having done it in previous version of R. For example, I've included "options(max.print=222)" in "R_HOME/etc/Rprofile.site" (with and without the environmental variable R_HOME set

Re: [R] (no subject)

2012-05-02 Thread Jeff Newmiller
This is the R-help list, not the do-your-work-for-you list. Please read the Posting Guide and: - use the approved support resources within your educational institution until you finish your class - use a sensible subject line - provide a self-contained example, at least showing how far you got b

Re: [R] R help!

2012-05-02 Thread Jeff Newmiller
Hard to say.. your example is not reproducible. (Study the Posting Guide mentioned at the end of every message on this list.) A stab in the dark might be that z$dt is a factor and needs to be converted to character first. Use the str function to study your data. -

Re: [R] Hmisc's latex: na.blank and grouping not working as expected

2012-05-02 Thread Marius Hofert
I forgot to say what 'rmNames' is: rmNames <- function(x) {x[c(FALSE, x[-1]==x[-length(x)])] <- ""; x} With rmNames <- function(x) {x[c(FALSE, x[-1]==x[-length(x)])] <- NA; x} the option na.blank=TRUE works as expected. Also, the two empty columns are inserted due to "cgroup", but I don't k

Re: [R] R help!

2012-05-02 Thread Berend Hasselman
On 02-05-2012, at 22:00, Alex Roth wrote: > Hello there, I was wondering if you could help me with a quick R issue. > > I have a data set where one of the columns has both date and time in > it, e.g. "12/31/11 23:45" in one cell. I want to use R to split this > column into two new columns: date

Re: [R] (no subject)

2012-05-02 Thread Jorge I Velez
?quantile HTH, Jorge.- On Wed, May 2, 2012 at 7:42 PM, Drew Duckett <> wrote: > Hi there I am new to R, and I was hoping you guys could help me out. I > want to make a vector that is: vec(1,2,3,4,5,6,7,8,9,10) and i want to > create a function called PercentileFinder, that if i plug in > Perce

Re: [R] R help!

2012-05-02 Thread Jorge I Velez
Hi Alex, Here is one way: s <- "12/31/11 23:45" strsplit(s, " ")[[1]] # [1] "12/31/11" "23:45" * HTH, Jorge.- * On Wed, May 2, 2012 at 4:00 PM, Alex Roth <> wrote: > Hello there, I was wondering if you could help me with a quick R issue. > > I have a data set where one of the columns has both

Re: [R] (no subject)

2012-05-02 Thread R. Michael Weylandt
Take a look at the quantile function. You can view help by typing ?quantile at the prompt and get interactive examples by typing example(quantile) Michael On Wed, May 2, 2012 at 7:42 PM, Drew Duckett wrote: > Hi there I am new to R, and I was hoping you guys could help me out.  I > want to make

Re: [R] output Shapiro-Wild results to a table

2012-05-02 Thread Jorge I Velez
Hi Mary Ann, Use (untested) either # after creating F1.norm res <- lapply(F1.norm, function(x) c(statistics = x$statistics, p = x$p.value)) write.table(res, ...) or # before creating F1.norm out <- t(apply(F1.n.mat, 1, function(x){ result <- shapiro.test(x) c(stat = result$stati

Re: [R] output Shapiro-Wild results to a table

2012-05-02 Thread R. Michael Weylandt
I'd loop (possibly but not necessarily with *apply) over F1.norm and get the results directly before returning. E.g., lapply(F1.norm, function(x) c(x$p.value, x$statistic)) Michael On Wed, May 2, 2012 at 1:45 PM, Mary Ann Middleton wrote: > > Hello, > > I have applied the Shapiro test to a matr

Re: [R] How can a function in R handle different types of input?

2012-05-02 Thread R. Michael Weylandt
You can run multiple regressions at once: x <- 1:4 y <- x + 10 z <- 0:3 lm(cbind(x,y) ~ z) Michael On Wed, May 2, 2012 at 9:48 AM, stella wrote: > Hi, > > How can a function in R handle different types of input? > I have written a function, which should calculate the slope from several > 3-time

[R] Identifying the particular X or Y in a sorted list

2012-05-02 Thread Shankar Lanke
Dear All, I have a data sets as shown below A (Patient ID ), B and C are the Concentration of drug in blood on day 1 and day 4, D is the difference in conc. To do this in R I have written a code as follows, identified the number of patients who have more concentration on day 4 . Here I want to ide

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
So with case (6) here's the general structure of what I have: chw = read.table("crac.csv", skip = 1, header = TRUE, colClasses = rep(c("NULL", NA, "numeric", "NULL"), c(3, 1, 1, 24)), sep = ",") chw$Time.1 = as.POSIXct(chw$Time.1, format = fmt, tz = TZ) chw = na.omit(chw) chw = read.zo

Re: [R] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Rui Barradas
Hello, Far from the "absolute fastest" but apparently portable, big <- function(con, n, pass=5000){ if(file.exists(con)) unlink(con) fc <- file(con, "wb") on.exit(close(fc)) m <- n %/% pass r <- n %% pass replicate(m, writeBin(double(pass), fc))

[R] (no subject)

2012-05-02 Thread Drew Duckett
Hi there I am new to R, and I was hoping you guys could help me out. I want to make a vector that is: vec(1,2,3,4,5,6,7,8,9,10) and i want to create a function called PercentileFinder, that if i plug in PercentileFinder (vec, .9) it will give me 9. Creating the function is my biggest hurdle pleas

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Denham Robert
Jonathon, 10,000 numbers is pretty small, so I don't think time will be a big problem. You could write this using writeBin with no problems. For larger files, why not just use a loop? The writing is pretty fast, so I don't think you'll have too many problems. On my machine: > ptm <- proc

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread Rui Barradas
Hello, knavero wrote > > case (6) - regress back to read.table apparently > Or to readLines. tmp <- readLines("http://dl.dropbox.com/u/41922443/test.csv";) # Why doesn't it work? sapply(strsplit(tmp, ","), length) # Don't argue with computers, they don't listen. tmp <- tmp[-1] tmp <- str

[R] Plotting network without overlapping vertices

2012-05-02 Thread mdvaan
Hello, I am using the plot.igraph function in the igraph package to plot a network. How do I keep vertices from overlapping? One option would be to pass an argument that restricts vertices to occupy the same coordinates given their size. A second option would be to increase the area of the plot (a

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
case (6) - regress back to read.table apparently -- View this message in context: http://r.789695.n4.nabble.com/uneven-vector-length-issue-with-read-zoo-tp4604287p4604537.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-pro

[R] select month data in ts objects

2012-05-02 Thread S. Georgakarakos
In a time series ts object, like the z1.ts below: z1 = array(1:235) z1.ts = ts(z1, frequency =12) I would like to select only a certain month, for instance the "February" data If I transform the data to a matrix, I have the problem that 235 is not a multiple of 12 I do not like to cut or add

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
blank.lines.skip is not working either... -- View this message in context: http://r.789695.n4.nabble.com/uneven-vector-length-issue-with-read-zoo-tp4604287p4604360.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org ma

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
Actually case (4) didn't work. The issue is also with the index.."fill" only seems to work with the dimensions/columns that contain the data associated to the index. Dang.yeah, I need help here. -- View this message in context: http://r.789695.n4.nabble.com/uneven-vector-length-issue-with-rea

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
Case (4) - use the fill argument in ?read.tablethis looks useful...guess I answered my own question...going to delete this thread now... -- View this message in context: http://r.789695.n4.nabble.com/uneven-vector-length-issue-with-read-zoo-tp4604287p4604332.html Sent from the R help mailing

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
So far I see two options: (1) nrows argument to specify max number of rows to read in or (2) go into excel, and put a bunch of NA's . Both which are inefficient in that they're not so "automated". For case (1), I have to wait till an error pops up each time and deal with each one individually taki

Re: [R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
Make that 3 options actually. In case (3) I would have to take each category on the spreadsheet and isolate each to its own csv file using excel. Fun stuff... -- View this message in context: http://r.789695.n4.nabble.com/uneven-vector-length-issue-with-read-zoo-tp4604287p4604329.html Sent from t

[R] R help!

2012-05-02 Thread Alex Roth
Hello there, I was wondering if you could help me with a quick R issue. I have a data set where one of the columns has both date and time in it, e.g. "12/31/11 23:45" in one cell. I want to use R to split this column into two new columns: date and time. One of the problems with splitting here is

[R] Performing negative binomial regression on data, using stepwise selection

2012-05-02 Thread Eli Cohen
hello all, I've been trying for some time to try and model a big dataset using generalized linear models, or more precisely negative binomial regression. Unfortunately i have too many explanatory variables and i'd like to cut some of them off using a stepwise selection method. i've been struggeling

[R] uneven vector length issue with read.zoo?

2012-05-02 Thread knavero
I truncated and simplified my code and the read in data that I'm working with to isolate the issue. Here is the read in data and R script respectively: http://r.789695.n4.nabble.com/file/n4604287/test.csv test.csv http://pastebin.com/rCdaDqPm Here is the terminal/R shell output that I hope the

Re: [R] Help with stemDocument

2012-05-02 Thread Triss.Ashton
I am having a problem with stemDocuments also. I can make it work by moving the data into a Corpus by using: > a <- Corpus(VectorSource(df$text)) # create corpus object > a <- tm_map(a, stemDocument, language = "english") but it is horrably slow. I want to stem outside the Corpus object like:

Re: [R] How can a function in R handle different types of input?

2012-05-02 Thread Rui Barradas
Hello, stella wrote > > Hi, > > How can a function in R handle different types of input? > I have written a function, which should calculate the slope from several > 3-time-point measurements by linear regression > > 4 three-time-point-measurements: > x<-cbind(c(1,2,3,4),c(2,3,4,5),c(3,4,5,6

[R] output Shapiro-Wild results to a table

2012-05-02 Thread Mary Ann Middleton
Hello, I have applied the Shapiro test to a matrix with 26.925 rows of data using the following F1.norm<-apply(F1.n.mat,1,shapiro.test) I would now like to view and export a table of the p and W values from the Shapiro test, but I am not sure how to approach this. I have tried the follow

Re: [R] Referencing factors through their equivalent numeric level

2012-05-02 Thread Kaushik Krishnan
That did it! Thanks very much Berend. On Wed, May 2, 2012 at 4:19 AM, Berend Hasselman wrote: > > On 02-05-2012, at 07:22, Kaushik Krishnan wrote: > >> Hey folks >> >> I'm sorry for bringing what must be a very simple question to R-help, >> but after some research I haven't been able to find a so

[R] Multiple correlation

2012-05-02 Thread Silvia Molteni
I'm looking for a function for the "multiple correlation" among three variables. I have created three vectors (x, y and z) and I want to find a correlation coefficient and evaluate its significance. Can anyone help me?   Thanks in advance. [[alternative HTML version deleted]]

[R] Binary logistic regression with binary predictors

2012-05-02 Thread F.j. Berg
Ey R-people Trying to do a binary logistic regression with only categorical(age,ballot) and binary predictors for a binary response variable. I can model them at least at least i treat the binary predictors as categorical with the use of as.factor(etc) and use glm with binomial distribution

Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Rui Barradas
Hello, > > I must be missing something very obvious, but I just cannot see it. > The hardest to find errors. Wrong manual calculation in t1, powers have precedence right to left and before additions. t1b <- 10^(params[1]-xx)^params[2] t3b <- 1 + t1b t4b <- t2/t3b t5b <- params[4] + t4b all.equal

Re: [R] date and time conversion

2012-05-02 Thread Rui Barradas
Hello, mpostje wrote > > Hi > > I've been trying to convert numbers from an online temperature database > into dates and time that R recognizes. the problem is that the database > has put a T > between the numbers and R will not accept any conversions. > > this is the format that it's in now

[R] pick up the values

2012-05-02 Thread jiangxijixzy
Hi, I have a list of data, e.g. r[[i]] r[[1]]= 1 2 1 6 5 5 5.5 3 r[[2]]= 46 35 78 35 … r[[500]]. In the first column, the selected values should like this: (the later value)-(the former value)>=1 In the second column, the selected values should like this: (the form

[R] How can a function in R handle different types of input?

2012-05-02 Thread stella
Hi, How can a function in R handle different types of input? I have written a function, which should calculate the slope from several 3-time-point measurements by linear regression 4 three-time-point-measurements: x<-cbind(c(1,2,3,4),c(2,3,4,5),c(3,4,5,6)) time points: time<-c(1,3,9) function

[R] error fitting coxph model

2012-05-02 Thread Jessica Myers
Hi, I am using coxph from the survival package to fit a large model (100,000 observations, ~35 covariates) using both ridge regression (on binary covariates) and penalized splines (for continuous covariates). In fitting, I get a strange error: Error in if (abs((y[nx] - target)/(y[nx - 1] -

Re: [R] scanning a data set for strings

2012-05-02 Thread Daniel_55
Worked like a charm. Thanks for the help! It's really appreciated. -- View this message in context: http://r.789695.n4.nabble.com/scanning-a-data-set-for-strings-tp4602953p4603410.html Sent from the R help mailing list archive at Nabble.com. __ R-help

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Jeff Newmiller
On most UNIX systems this will leave a large unallocated virtual "hole" in the file. If you are not bothered by spreading the allocation task out over the program execution interval, this won't matter and will probably give the best performance. However, if you wanted to benchmark your algorith

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Simon Urbanek
On May 2, 2012, at 6:23 PM, Jonathan Greenberg wrote: > R-helpers: > > What would be the absolute fastest way to make a large "empty" file (e.g. > filled with all zeroes) on disk, given a byte size and a given number > number of empty values. I know I can use writeBin, but the "object" in > thi

Re: [R] is there a way of identifying batch mode running?

2012-05-02 Thread William Dunlap
interactive() does not do exactly what you ask for, but may be close enough. It returns FALSE when run from Rscript and TRUE from R when you have not redirected standard input. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.o

[R] is there a way of identifying batch mode running?

2012-05-02 Thread Paul.Rustomji
Hello list Is there a way of identifying from within R whether a script has been source(d) from Rgui.exe or via Rscript.exe in batch mode? For the code I have I use the commandArgs() function to pick up command line args when running in batch mode via Rscript.exe However I like to get the code

Re: [R] Numeric data not numeric in .csv file

2012-05-02 Thread Eve Proper
Thanks everyone for your helpful responses. I looked at the csv file in a text editor and saw no spaces or non-numerical characters (other than periods as decimals) outside of the header. str() says me that the variables are either num or int. David was spot-on; I was trying > storage.mode(~miles)

Re: [R] error in La.svd Lapack routine 'dgesdd'

2012-05-02 Thread Philipp Grueber
Addendum to my first post: Since I wish to understand what plm does to my data, I tried to manually calculate the demeaned values and use OLS. See below how far I got with the Grunfeld data; formula's are based on Greene's Econometric Analysis. Obviously, I am missing at least one important step

Re: [R] Forestplot question

2012-05-02 Thread Thomas Lumley
It works for me with your data: > dat<-read.table("/tmp/foo.txt",header=TRUE) > metaplot(a$coef,a$se_coef) It has boxes of size zero for the point estimates, but that's because you give the standard error as zero for the second estimate, which implies all the other boxes should be infinitely smal

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Jeff Ryan
Something like: http://markus.revti.com/2007/06/creating-empty-file-with-specified-size/ Is one way I know of. Jeff Jeffrey Ryan|Founder|jeffrey.r...@lemnica.com www.lemnica.com On May 2, 2012, at 5:23 PM, Jonathan Greenberg wrote: > R-helpers: > > What would be the absolu

Re: [R] Problems accessing environment() in function

2012-05-02 Thread Duncan Murdoch
On 12-05-02 5:20 PM, Heiko Neuhaus wrote: Thank you very much for your suggestion. f<- function(a,b,c) { names<- ls(environment()) # get all the names result<- list() for (n in names) { if (!do.call(missing, list(as.name(n result[n]<- get(n) } result } I have already figured out a very si

Re: [R] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Henrik Bengtsson
An R solution is: allocateFile <- function(pathname, nbrOfBytes) { con <- file(pathname, open="wb"); on.exit(close(con)); seek(con, where=nbrOfBytes-1L, origin="start", rw="write"); writeBin(as.raw(0), con=con); invisible(pathname); } # allocateFile() > allocateFile("foo.bin", nbrOfByte

Re: [R] [R-sig-hpc] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Jeff Ryan
Look at the man page for dd (assuming you are on *nix) A quick google will get you a command to try. I'm not at my desk or I would as well. Jeff Jeffrey Ryan|Founder|jeffrey.r...@lemnica.com www.lemnica.com On May 2, 2012, at 5:23 PM, Jonathan Greenberg wrote: > R-helpers:

[R] Quickest way to make a large "empty" file on disk?

2012-05-02 Thread Jonathan Greenberg
R-helpers: What would be the absolute fastest way to make a large "empty" file (e.g. filled with all zeroes) on disk, given a byte size and a given number number of empty values. I know I can use writeBin, but the "object" in this case may be far too large to store in main memory. I'm asking bec

Re: [R] Problems accessing environment() in function

2012-05-02 Thread Heiko Neuhaus
Thank you very much for your suggestion. f <- function(a,b,c) { names <- ls(environment()) # get all the names result <- list() for (n in names) { if (!do.call(missing, list(as.name(n result[n] <- get(n) } result } I have already figured out a very similar solution using for/eval that bas

Re: [R] Problem with 'nls' fitting logistic model (5PL)

2012-05-02 Thread Bert Gunter
Plot the data. You're clearly overfitting. (If you don't know what this means or why it causes the problems you see, try a statistical help list or consult your local statistician). -- Bert On Wed, May 2, 2012 at 12:32 PM, Michal Figurski wrote: > Dear R-Helpers, > > I'm working with immunoassa

[R] Problem with 'nls' fitting logistic model (5PL)

2012-05-02 Thread Michal Figurski
Dear R-Helpers, I'm working with immunoassay data and 5PL logistic model. I wanted to experiment with different forms of weighting and parameter selection, which is not possible in instrument software, so I turned to R. I am using R 2.14.2 under Win7 64bit, and the 'nls' library to fit the m

[R] adding a caption to a mosaic plot?

2012-05-02 Thread Simon Kiss
Dear all: Is there a way to add text to the margins or outer margins of a mosaic plot using the vcd package? I understand the margins argument to mosaic, but I don't know how to add text to that. I'd like to add a caption to a plot. If possible, I'd like to know how to set the font and size fo

Re: [R] Problems accessing environment() in function

2012-05-02 Thread Duncan Murdoch
On 02/05/2012 12:59 PM, Heiko Neuhaus wrote: Thanks a lot for your answer! >> -- >> >> test1<- function(a, b, c) >> { >> x<- as.list(environment()) >> print ("hi from test1!") >> test2(a = a, b = b, c = c) > > You are rying to pass a, b, c here and hence R trie

[R] Forestplot question

2012-05-02 Thread Ben Ganzfried
Hi, I'm trying to build a Forest Plot using the second and fourth columns in the table (test.csv) below. My code is the following: curated <- data.frame("test.csv") tmp <- curated$coef tmp1 <- curated$se_coef plt <- metaplot(tmp, tmp1, xlim = c(-.45, .45)) I keep getting the following error at th

Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Petr Savicky
On Wed, May 02, 2012 at 11:42:27AM -0400, Rajarshi Guha wrote: > Hi, I'm running a calculation in two ways. The first way is to employ > vectors and evaluate a function in one go. The second way is to break > down the function into pieces and combine the pieces to the final > answer. > > Algebraic

Re: [R] Problems accessing environment() in function

2012-05-02 Thread Heiko Neuhaus
Thanks a lot for your answer! -- test1 <- function(a, b, c) { x <- as.list(environment()) print ("hi from test1!") test2(a = a, b = b, c = c) You are rying to pass a, b, c here and hence R tries to insert those into the environment of test2 once it is called, you h

Re: [R] selection by two unique variables

2012-05-02 Thread jim holtman
try this: > x <- read.table(text = "id wtdt wt lastpk + + 64050256 2010-09-18 275 2010-09-16 + + 64050256 2010-09-19 277 2010-09-18 + + 64050256 2010-09-20 272 2010-09-18 + + 64050256 2010-09-21 277 2010-09-18", as.is = TRUE, header = TRUE) > > first

Re: [R] convert numbers into dates and time

2012-05-02 Thread Uwe Ligges
On 02.05.2012 11:19, mpostje wrote: Hi I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. the problem is that the database has put a T between the numbers and R will not accept any conversions. this is the format that it's in now 198

Re: [R] please help me

2012-05-02 Thread Uwe Ligges
On 02.05.2012 02:55, Ulfa Hasanah wrote: hi all,can you help me? index moran is very difficut for me, i have data n neighbor as enclosure: please help me to make the program for find index moran value each variabel,...thank very much Which translates to: please help me, and note that - I

Re: [R] rgl.Sweave not producing transparency in pdf plots with alpha

2012-05-02 Thread Alexander Shenkin
On 5/2/2012 11:40 AM, Duncan Murdoch wrote: > On 02/05/2012 12:26 PM, Duncan Murdoch wrote: >> On 02/05/2012 11:00 AM, Alexander Shenkin wrote: >> > Hi Folks, >> > >> > I'm trying to get rgl.Sweave to produce plots with transparency. >> > However, it just seems to produce opaque plots when pdf

Re: [R] rgl.Sweave not producing transparency in pdf plots with alpha

2012-05-02 Thread Duncan Murdoch
On 02/05/2012 12:26 PM, Duncan Murdoch wrote: On 02/05/2012 11:00 AM, Alexander Shenkin wrote: > Hi Folks, > > I'm trying to get rgl.Sweave to produce plots with transparency. > However, it just seems to produce opaque plots when pdf is the output > type. Perhaps this is a known issue? I'll

Re: [R] interactive loop

2012-05-02 Thread Sarah Goslee
And now we have two entirely different interpretations of the question. I think Ondřej needs to provide a more detailed explanation of the problem and intended result. Sarah On Wed, May 2, 2012 at 12:23 PM, R. Michael Weylandt wrote: > I think readline() will do what you want. It can display a

Re: [R] Problems accessing environment() in function

2012-05-02 Thread Uwe Ligges
On 01.05.2012 19:57, Heiko Neuhaus wrote: Hi all, I am trying to create a list of all variable/value combinations in environment(). When a function with unset arguments is called, the method I have been using fails with a "missing argument" error. However it should be possible to simply skip

[R] Statistical test for predictor selection

2012-05-02 Thread jing tang
Hi, In a data I have two predictors and one response variable. The response variable is categorical and fixed. Now I want to choose which predictor would better predict the response variable. Is there a statistical test for that? Best, Jing -- Jing Tang, PhD Senior Researcher Institute

Re: [R] interactive loop

2012-05-02 Thread Sarah Goslee
You might start with par(ask=TRUE) and identify(). A reproducible example might get you actual code. Also, how do you know they're superfluous? Perhaps that knowledge can be used to automate identification. Sarah On Wed, May 2, 2012 at 12:08 PM, Ondřej Mikula wrote: > Dear R-helpers, > I have a

Re: [R] rgl.Sweave not producing transparency in pdf plots with alpha

2012-05-02 Thread Duncan Murdoch
On 02/05/2012 11:00 AM, Alexander Shenkin wrote: Hi Folks, I'm trying to get rgl.Sweave to produce plots with transparency. However, it just seems to produce opaque plots when pdf is the output type. Perhaps this is a known issue? I'll just use .png in the meantime, but wanted to see about thi

Re: [R] interactive loop

2012-05-02 Thread R. Michael Weylandt
I think readline() will do what you want. It can display a message and take user input, assigning it to a character value so you might need as.numeric() Michael On May 2, 2012, at 12:08 PM, Ondřej Mikula wrote: > Dear R-helpers, > I have a number of point configurations representing skull shap

[R] interactive loop

2012-05-02 Thread Ondřej Mikula
Dear R-helpers, I have a number of point configurations representing skull shapes, but some of them contain superfluous points. I want to write a loop in which each configuration is plotted and I am asked to write the numbers of points that are superfluous. However, I don't know how to introduce th

Re: [R] strange differences in vector operation versus manual calculation

2012-05-02 Thread William Dunlap
Your multistep approach corresponds to the following, which has one more set of parentheses than you used yy <- params[4] + (params[3] - params[4])/((1 + 10^(params[1]-xx))^params[2]) In R lingo, both of your approaches are vectorized and you probably won't find a huge difference in speed betwee

Re: [R] error bars for a barchart

2012-05-02 Thread Beatriz De Francisco
Walmes, Thank you so much!!! I am still trying to understand all of your code but it works. I have changed it a bit so that I get upper and lower limits for the error bar, and that the origin starts at 0 so the negative values are plotted correctly. barchart(Change~fTreat,groups=Process,change,

[R] strange differences in vector operation versus manual calculation

2012-05-02 Thread Rajarshi Guha
Hi, I'm running a calculation in two ways. The first way is to employ vectors and evaluate a function in one go. The second way is to break down the function into pieces and combine the pieces to the final answer. Algebraically, they should give me the same result. But the final vector differs sig

Re: [R] selection by two unique variables

2012-05-02 Thread Bert Gunter
?tapply ?with is also useful here as in (untested) with(yourdataframe, tapply(lastpk, id, unique)) -- Bert On Wed, May 2, 2012 at 7:58 AM, Ayyappa Chaturvedula wrote: > Dear Group, > > I am working with a large dataset where I need to select for each unique id > the the unique lastpk row.  Her

[R] rgl.Sweave not producing transparency in pdf plots with alpha

2012-05-02 Thread Alexander Shenkin
Hi Folks, I'm trying to get rgl.Sweave to produce plots with transparency. However, it just seems to produce opaque plots when pdf is the output type. Perhaps this is a known issue? I'll just use .png in the meantime, but wanted to see about this, as I didn't see it in the documentation (though

[R] selection by two unique variables

2012-05-02 Thread Ayyappa Chaturvedula
Dear Group, I am working with a large dataset where I need to select for each unique id the the unique lastpk row. Here is a sample subject: id wtdt wt lastpk 64050256 2010-09-18 275 2010-09-16 64050256 2010-09-19 277 2010-09-18 64050256 201

Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread peter dalgaard
On May 2, 2012, at 15:48 , meredith wrote: > Peter- > Maybe I have not articulately my problem clearly, I have had local help > with the statistical part just trying to figure out how to correctly program > this test. For clarity's sake, I have months worth of data, I want to > potentially comb

Re: [R] factor conversion to date/time

2012-05-02 Thread John Kane
Try something like this. Convert the vector to character and grab the first 10 characters then convert to a date. aa <- as.factor("1981-01-02T08:00I") aa <- as.character(aa) aa <- substr(aa, 1, 10) class(b) John Kane Kingston ON Canada > -Original Message- > From: mayo_j...@hotmail.co

Re: [R] Two ecdf with log-scales

2012-05-02 Thread David Winsemius
On May 2, 2012, at 6:14 AM, Johannes Radinger wrote: Hi, i want to plot empirical cumulative density functions for two variables in one plot. For better visualizing the differences in the two cumulative curves I'd like to log-scale the axis. So far I found 3 possible functions to plot ec

Re: [R] Extracting results from a median polish

2012-05-02 Thread R. Michael Weylandt
write.csv() is definitely the right way to go so you're on track What is str(medpolish)? >From the error message, it sounds like it's a functionIf it is, are you sure you don't mean write.csv(medpolish( xx )) ? Michael On Wed, May 2, 2012 at 12:39 AM, Martin Raymond Lefebvre wrote: > Quick

Re: [R] coxph reference hazard rate

2012-05-02 Thread David Winsemius
As has been answered several times on rhelp ... the baseline hazard is for a case with the "mean value". It's not a meaningful case with all factor variables. There can be no cases where fidelity>3 has a fractional value. You should be using predict() and survfit() to display estimates for

Re: [R] Arules and different item columns with same item labelsŠ.

2012-05-02 Thread John Kane
It is not clear what you mean. Can you supply some sample data? Have a look at ?dput for a handy way to supply data. John Kane Kingston ON Canada > -Original Message- > From: lterle...@anadolu.edu.tr > Sent: Tue, 1 May 2012 17:55:25 + > To: r-help@r-project.org > Subject: [R] Arul

Re: [R] calibration of Garch models to historical data

2012-05-02 Thread R. Michael Weylandt
This might be more of a question for R-SIG-Finance and followup should probably be there, but you might get a start with the rugarch package. Michael On Wed, May 2, 2012 at 4:13 AM, Ivette wrote: > I have done the usual estimation of GARCH models, applied to my historical > dataset (commodities

Re: [R] Numeric data not numeric in .csv file

2012-05-02 Thread David Winsemius
On May 1, 2012, at 8:47 PM, Eve Proper wrote: I am a raw novice to R, playing around with a mini .csv dataset created in Excel. I can read it in and the data looks OK in Excel and upon initial inspection in R: hikes <- read.csv("/Users/eproper/Desktop/hikes.csv", header=TRUE) print(hikes)

Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread meredith
Peter- Maybe I have not articulately my problem clearly, I have had local help with the statistical part just trying to figure out how to correctly program this test. For clarity's sake, I have months worth of data, I want to potentially combine those months into four, shall we say seasons, that

Re: [R] factor conversion to date/time

2012-05-02 Thread R. Michael Weylandt
Please don't triple post. Michael On Wed, May 2, 2012 at 8:08 AM, marjolein post wrote: > > > > > Hi, I've been trying to convert numbers from an online temperature database > into dates and time that R recognizes. I've tried as.Date, as.POSIXlt and > strptime  the problem is that the database

Re: [R] date and time conversion

2012-05-02 Thread R. Michael Weylandt
Quick and dirty solution is to use sub() to change the T to a space and then use as.POSIXct as usual. x <- "1981-01-02T08:00" as.POSIXct(sub("T"," ", x), format = "%Y-%m-%d %H:%M") but it does look to me like R can work around the T if you give a good format argument: as.POSIXct(x, format = "%Y

Re: [R] scanning a data set for strings

2012-05-02 Thread R. Michael Weylandt
I think you are looking for something like aggregate(cbind(VPts, HPts) ~ VTm + HTm, data = NFL, sum) but you should look at the examples for ?aggregate to tweak it to what you need. Michael On Wed, May 2, 2012 at 7:45 AM, Daniel_55 wrote: > Hello, > > I'm looking for what I'm sure is a quick a

Re: [R] Numeric data not numeric in .csv file

2012-05-02 Thread R. Michael Weylandt
On Wed, May 2, 2012 at 4:34 AM, Jim Lemon wrote: > On 05/02/2012 10:47 AM, Eve Proper wrote: >> >> I am a raw novice to R, playing around with a mini .csv dataset created in >> Excel. I can read it in and the data looks OK in Excel and upon initial >> inspection in R: >> >> hikes<- read.csv("/User

Re: [R] factor conversion to date/time

2012-05-02 Thread Duncan Murdoch
On 02/05/2012 8:08 AM, marjolein post wrote: Hi, I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. I've tried as.Date, as.POSIXlt and strptime the problem is that the database has put a T between the numbers and R will not accept

Re: [R] Hypothesis Testing using Wald Criterion for two regression models with dummy variables

2012-05-02 Thread Bert Gunter
Meredith: You are clearly out of your depth. Get local help. R-help is, err, an R help list, not a resource for remote statistical consulting. Although, I admit, there is often some overlap. -- Bert On Wed, May 2, 2012 at 5:58 AM, peter dalgaard wrote: > > On May 1, 2012, at 22:01 , meredit

Re: [R] DepmixS4

2012-05-02 Thread Ingmar Visser
Deepak, On Wed, May 2, 2012 at 7:53 AM, deepakw wrote: > Hi I am trying to use depmixS4 package. Based on the documentation, it > seems > that depmix allows one to fit an HMM model based on a training data with > time-varying co-variates. However, I did not find any routines which can > help tes

[R] Multiple plots

2012-05-02 Thread alcesgabbo
I have a variable : *sim.var[,1] * Object of class SpatialPixelsDataFrame Object of class SpatialPixels Grid topology: cellcentre.offset cellsize cells.dim Xloc 0.3 0.0597 Yloc 0.1 0.05 117 SpatialPoints: Xloc Yloc [1,] 0.30 1.70

Re: [R] How to read ANOVA output

2012-05-02 Thread John Kane
Or look for A handbook of Statistical Analyses using R. (Everitt and Holhorn) available on line in pdf format. John Kane Kingston ON Canada > -Original Message- > From: istaz...@gmail.com > Sent: Wed, 2 May 2012 07:01:22 -0400 > To: sydney.ver...@gmail.com > Subject: Re: [R] How to read

[R] scanning a data set for strings

2012-05-02 Thread Daniel_55
Hello, I'm looking for what I'm sure is a quick answer. I'm working with a data set that looks like this: Week Game.ID VTm VPts HTm HPts Differential HomeWin 11 NFL_20050908_OAK@NE OAK 20 NE 30 10 FALSE 21 NFL_20050911

[R] factor conversion to date/time

2012-05-02 Thread marjolein post
Hi, I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. I've tried as.Date, as.POSIXlt and strptime the problem is that the database has put a T between the numbers and R will not accept any conversions. currently it sees the date as

[R] convert numbers into dates and time

2012-05-02 Thread mpostje
Hi I've been trying to convert numbers from an online temperature database into dates and time that R recognizes. the problem is that the database has put a T between the numbers and R will not accept any conversions. this is the format that it's in now 1981-01-02T08:00 can anyone help? cheers!

  1   2   >