Re: [R] simple matrix calculation

2012-03-28 Thread Petr Savicky
On Wed, Mar 28, 2012 at 10:46:11PM +0200, Kehl Dániel wrote: > Dear list-members, > > I have a 9-by-9 matrix lets call it A with first row a11, a12, a13,..., > a19 etc. > I also have a vector of length 3 (B). > I want to construct a matrix of size 3x3 in the following way: > - divide matrix A to

Re: [R] Making Knitr work

2012-03-28 Thread Jessica Streicher
Ah.. well, i thought this was the option to set the directory to where plot images should go. I'll comment it out fr the time being. thanks Am 28.03.2012 um 19:38 schrieb Yihui Xie: > You must have set the package option 'base.dir' > (opts_knit$set(base.dir = )), and this directory does no

[R] Re : Spatstat users.

2012-03-28 Thread Pascal Oettli
"No I am not an active spatstat user" __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reprod

Re: [R] subset problem

2012-03-28 Thread andrija djurovic
Hi. You can try this: df[type%in%type_list, ] You can also use sqldf package and subset data frames usign sql statements: library(sqldf) df <- data.frame(x1=1:10, type=10:1) type_list <- data.frame(index=seq(1,10,by=2)) sqldf("select df.* from df where df.type in (select * from ty

Re: [R] subset problem

2012-03-28 Thread peter dalgaard
On Mar 29, 2012, at 07:25 , reeyarn wrote: > Hi, > > If my data frame "df" has a index "type", I want to get a subset such > that the type belongs to a "type_list"; > using sql, I want > SELECT name, type FROM df >WHERE type in type_list; > > Now in R I have to write a loop like > mysubse

[R] different offset for each label?

2012-03-28 Thread Jinsong Zhao
Hi there, I hope to give a different offset for each label in a complex plot. However, the following code does not work. > plot(1:4) > text(c(1:4), letters[1:4], pos = c(4,3,2,1), offset=c(1,2,3,4)) it seems that text() only use the first element of c(1,2,3,4), i.e., 1. Is it possible to ass

Re: [R] "cv.glmnet" object

2012-03-28 Thread Joshua Wiley
Hi, It should be a matrix of the explanatory variables. Is that really all your question? Did you look at the help for ?glmnet it shows several examples that may help you understand how to use it. You can also find useful papers online from the authors of the book "Elements of Statistical Le

Re: [R] subset problem

2012-03-28 Thread reeyarn
Hi, If my data frame "df" has a index "type", I want to get a subset such that the type belongs to a "type_list"; using sql, I want SELECT name, type FROM df WHERE type in type_list; Now in R I have to write a loop like mysubset<- df [ df$type == type_list[1], ] for (type1 in type_list[

[R] "cv.glmnet" object

2012-03-28 Thread yx78
dose anybody know In "cv.glmnet" object say fit=cv.glmnet(x,y) what is matrix "x", if it is a data frame or something else thanks a lot -- View this message in context: http://r.789695.n4.nabble.com/cv-glmnet-object-tp4514236p4514236.html Sent from the R help mailing list archive at Nabble.co

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Markus Weisner
Thanks Justin and Bill. That did the trick!! * ~Markus * On Wed, Mar 28, 2012 at 4:45 PM, Justin Haynes wrote: > wow! and here I thought I was starting to know most things about > regexes... > > On Wed, Mar 28, 2012 at 1:34 PM, William Dunlap wrote: > > You can use the \< and \> patterns (ba

[R] binomial sample size calculation

2012-03-28 Thread McGuire, Rhydwyn
Hi everyone. I need to do a sample size calculation for a one sample based on a CI interval of +- 5% of the proportion, we expect to have a rate of 0.07 based on similar studies. I have looked at the pwr-package as well as the power.prop.test function, but I can't see how to make either do wha

Re: [R] resampling for correlation and testing

2012-03-28 Thread ilai
On Wed, Mar 28, 2012 at 8:03 PM, Benton, Paul wrote: > > On Mar 29, 2012, at 1:41 AM, ilai wrote: > >> On Wed, Mar 28, 2012 at 3:53 PM, Benton, Paul >> wrote: >>> Hello all R-er, >>> >>> ## Then test if rho.A[1,1] come from the distribution of rho.B[1,1] >>> pvalueMat[1,1]<-wilcox.test(rho.ar

Re: [R] Rcmd build -binary -- problem

2012-03-28 Thread jack306
After I used rtools 2.15 and R-2.14.2 to create an R package, I have some thoughts that some R users may try: 1. If rcmd is not recognized even the path is set under advanced environmental variables, use "path C:\Program Files\R\R-2.14.2\bin\x64" if you try to use win-64 bit under cmd dos mode.

Re: [R] How to access value of the conditioning variable in my panel

2012-03-28 Thread Bert Gunter
pass the conditioning variables into the panel function as arguments. Then ?packet.number or the 'subscripts' argument can then be used to identify what the levels or shingles are for the panel within the panel. -- Bert On Wed, Mar 28, 2012 at 8:33 PM, Aziz, Muhammad Fayez wrote: > > Hi, > > I h

Re: [R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Dominic Comtois
Thanks for the reply. I finally succeeded. For some reason, I had to specify explicitly the path to the sas.exe file with the sasprog parameter, even though the directory is in my path environment variable. Not sure why this is, but in any case, now it works. Regards, DC -Message d'origine-

Re: [R] Spatstat users.

2012-03-28 Thread Rolf Turner
Further to my cri de coeur of yesterday, asking people to indicate whether they are "active spatstat users". I've had quite a few replies but I'd like a lot more. Please answer; it'll only take you a few seconds. Just reply to this email with a "Yes" (yes I am an active spatstat user) or "No" (

[R] How to access value of the conditioning variable in my panel

2012-03-28 Thread Aziz, Muhammad Fayez
Hi, I have 10 panels in the "mypanel" function of my xyplot based on the conditioning variable and I want to print those ten values, panel headings, groups, .. whatever you want to call them. Easiest way please! Fayez [[alternative HTML version deleted]] _

Re: [R] resampling for correlation and testing

2012-03-28 Thread Benton, Paul
On Mar 29, 2012, at 1:41 AM, ilai wrote: > On Wed, Mar 28, 2012 at 3:53 PM, Benton, Paul > wrote: >> Hello all R-er, >> >> I'm trying to run a resampling method on some data. The current method I >> have takes 2+ days or a lot of memory . I was wondering if anyone has a >> better suggestion.

Re: [R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Phil Spector
I've found the keep,log=TRUE option of sas.get to be useful in cases like this. There's also a log.file= option if you don't want the default location for the log file. - Phil Spector Statistical Computing Facility

Re: [R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Dominic Comtois > Sent: Wednesday, March 28, 2012 3:09 PM > To: r-help@r-project.org > Subject: [R] SAS Import with sas.get {Hmisc} - status 127 error > > I'm trying to import a

Re: [R] simple matrix calculation

2012-03-28 Thread Kjetil Halvorsen
see inline. On Wed, Mar 28, 2012 at 2:46 PM, Kehl Dániel wrote: > Dear list-members, > > I have a 9-by-9 matrix lets call it A with first row a11, a12, a13,..., a19 > etc. > I also have a vector of length 3 (B). > I want to construct a matrix of size 3x3 in the following way: > - divide matrix A

Re: [R] resampling for correlation and testing

2012-03-28 Thread ilai
On Wed, Mar 28, 2012 at 3:53 PM, Benton, Paul wrote: > Hello all R-er, > > I'm trying to run a resampling method on some data. The current method I have > takes 2+ days or a lot of memory . I was wondering if anyone has a better > suggestion. > > Currently I take a matrix and get the correlation

Re: [R] rep with bigz in gmp

2012-03-28 Thread Peter Ehlers
On 2012-03-27 21:03, Kohske Takahashi wrote: Hi With package:gmp, is this an expected behavior? rep(1:3, rep(3, 3)) [1] 1 1 1 2 2 2 3 3 3 rep(as.bigz(1:3), rep(3, 3)) Big Integer ('bigz') object of length 9: [1] 1 2 3 1 2 3 1 2 3 This code is used inside `outer`, so more worse outer(1:3

Re: [R] Changing multiple instances in data.frame

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 6:40 PM, Trevor Davies wrote: Thank you, works perfectly. Good. There is also a recode function in package 'car' (IIRC) which attempts to replicate the syntax of the same command in SPSS. But once I figured out how to use match() as an index with "[", I have never n

Re: [R] Changing multiple instances in data.frame

2012-03-28 Thread Trevor Davies
Thank you, works perfectly. On Wed, Mar 28, 2012 at 3:11 PM, David Winsemius wrote: > > On Mar 28, 2012, at 5:26 PM, Trevor Davies wrote: > > I've looked but I cannot find a more elegant solution. >> >> I would like to be able to scan through a data.frame and remove multiple >> and various insta

Re: [R] create waveform sawtooth

2012-03-28 Thread Uwe Ligges
On 26.03.2012 19:33, R. Michael Weylandt wrote: Perhaps something like this, x<- seq(0, 10, length = 1000) y<- x %%1 Or if people like a package: library("tuneR") st <- sawtooth(10) plot(st) Uwe Ligges Michael On Mon, Mar 26, 2012 at 10:18 AM, mail me wrote: Hi: I am trying to crea

Re: [R] How to move files from one folder to another

2012-03-28 Thread Uwe Ligges
On 28.03.2012 19:11, Sarah Goslee wrote: Within R? On what OS? You could presumably use system() with the OS-specific command, which might be cp or mv or copy or move depending on your OS. But I'm not sure why you'd want to do this from R. Actually it is sometimes handy, and file.rename()

Re: [R] Changing multiple instances in data.frame

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 5:26 PM, Trevor Davies wrote: I've looked but I cannot find a more elegant solution. I would like to be able to scan through a data.frame and remove multiple and various instances of certain contents. A trivial example is below. It works, it just seems like there sho

[R] SAS Import with sas.get {Hmisc} - status 127 error

2012-03-28 Thread Dominic Comtois
I'm trying to import a .sas7bdat dataset into R with sas.get. I'm using Win-7 and SAS 9.2. I have read the following post and did tweak the line (127, incidentally) of code. http://r.789695.n4.nabble.com/R

Re: [R] simple matrix calculation

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 4:46 PM, Kehl Dániel wrote: Dear list-members, I have a 9-by-9 matrix lets call it A with first row a11, a12, a13,..., a19 etc. I also have a vector of length 3 (B). I want to construct a matrix of size 3x3 in the following way: - divide matrix A to 9 3x3 blocks - first

Re: [R] Connect lines in a dot plot on a subject-by-subject basis

2012-03-28 Thread John Sorkin
Thank you Bert. I will try your suggestion. You are ever gracious with your knowledge and expertise. John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (B

[R] resampling for correlation and testing

2012-03-28 Thread Benton, Paul
Hello all R-er, I'm trying to run a resampling method on some data. The current method I have takes 2+ days or a lot of memory . I was wondering if anyone has a better suggestion. Currently I take a matrix and get the correlation matrix from it. This will be called rho.A. Each element in this

Re: [R] CI with confint

2012-03-28 Thread Benjamin Caldwell
Oh, interesting - here I thought I was getting a confidence region for the model (which of course you're right has two parameters) and in fact confint is giving me the confidence interval for each of the two parameters in the model. The ellipse package does a nice job of helping me visualize that.

Re: [R] Connect lines in a dot plot on a subject-by-subject basis

2012-03-28 Thread Bert Gunter
Oh ... you may need to specify a single color to avoid a rainbow: xyplot( Value ~ Time, Group = SubjectID, data = dat, type = "b", col = "black") -- Bert On Wed, Mar 28, 2012 at 2:39 PM, John Sorkin wrote: > I am trying to plot where data points from a give subject are connected by a > line. E

Re: [R] Connect lines in a dot plot on a subject-by-subject basis

2012-03-28 Thread Bert Gunter
Trivial with xyplot. Convert the data frame to long form (perhaps using reshape() or functions in the reshape2 package) to get ( in data frame dat) 3 columns: SubjectID Time Value (results do not have to be in time order or grouped by subject) Then: xyplot( Value ~ Time, Group = SubjectID, da

[R] Connect lines in a dot plot on a subject-by-subject basis

2012-03-28 Thread John Sorkin
I am trying to plot where data points from a give subject are connected by a line. Each subject is represented by a single row of data. Each subject can have up to five observations. The first five columns of mydata give the time of observation, columns 6-10 give the values at each time point. So

Re: [R] fun.zero.omit {GLDEX}

2012-03-28 Thread Nelson Nomura
Peter, That's perfect. Thanks very much for your help. Best, Nelson -Original Message- From: peter dalgaard [mailto:pda...@gmail.com] Sent: Wednesday, March 28, 2012 5:31 PM To: Nelson Nomura Cc: r-help@r-project.org Subject: Re: [R] fun.zero.omit {GLDEX} On Mar 28, 2012, at 14:39 ,

Re: [R] fun.zero.omit {GLDEX}

2012-03-28 Thread peter dalgaard
On Mar 28, 2012, at 14:39 , Nelson Nomura wrote: > Hello. Sorry for the newbie question. When I run the function > fun.zero.omit (from the GLDEX package), I get a matrix and some descriptive > information. Can someone tell me how to strip out the descriptive > information so that I'm only left

Re: [R] simple matrix calculation

2012-03-28 Thread Ted Harding
On 28-Mar-2012 Kehl Dániel wrote: > Dear list-members, > I have a 9-by-9 matrix lets call it A with first row > a11, a12, a13,..., a19 etc. > I also have a vector of length 3 (B). > I want to construct a matrix of size 3x3 in the following way: > - divide matrix A to 9 3x3 blocks > - first is >

[R] Changing multiple instances in data.frame

2012-03-28 Thread Trevor Davies
I've looked but I cannot find a more elegant solution. I would like to be able to scan through a data.frame and remove multiple and various instances of certain contents. A trivial example is below. It works, it just seems like there should be a one line solution. #Example data: a <- data.frame

Re: [R] plot points using circles filled half in red and half in blue.

2012-03-28 Thread Greg Snow
I would use the my.symbols function from the TeachingDemos package (but then I might be a little bit biased), here is a simple example: library(TeachingDemos) x <- runif(25) y <- runif(25) z <- sample(1:4, 25, TRUE) ms.halfcirc2 <- function(col, adj=pi/2, ...) { theta <- seq(0, 2*pi, len

Re: [R] CI with confint

2012-03-28 Thread peter dalgaard
On Mar 28, 2012, at 21:33 , Benjamin Caldwell wrote: > Hello all, > > I'm trying to use confint from the MASS package to compute confidence > intervals for an nls object. When I plot the results, however, they don't > make sense - lines cross over the fitted model or just don't match the > data.

[R] simple matrix calculation

2012-03-28 Thread Kehl Dániel
Dear list-members, I have a 9-by-9 matrix lets call it A with first row a11, a12, a13,..., a19 etc. I also have a vector of length 3 (B). I want to construct a matrix of size 3x3 in the following way: - divide matrix A to 9 3x3 blocks - first is a11, a12, a13 a21, a22, a23

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Justin Haynes
wow! and here I thought I was starting to know most things about regexes... On Wed, Mar 28, 2012 at 1:34 PM, William Dunlap wrote: > You can use the \< and \> patterns (backslashing the backslashes) to > mean start and end of "word", respectively.  E.g., > >  > addresses <- c("S S Main St & Inte

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread William Dunlap
You can use the \< and \> patterns (backslashing the backslashes) to mean start and end of "word", respectively. E.g., > addresses <- c("S S Main St & Interstate 95", "3421 BIGS St") > gsub("\\", "S", addresses) [1] "S Main St & Interstate 95" "3421 BIGS St" Bill Dunlap Spotfir

Re: [R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Justin Haynes
In most regexs the carrot( ^ ) signifies the start of a line and the dollar sign ( $ ) signifies the end. gsub('^S S', 'S', a) gsub('^S S', 'S', '3421 BIGS St') you can use logical or inside your pattern too: gsub('^S S|S S$| S S ', 'S', a) the " S S " condition is difficult. gsub('^S S|S S$|

Re: [R] Why does this work? plyr within-subset normalization

2012-03-28 Thread Justin Haynes
To those without access to nabble, the code in reference is: relative <- ddply(ranktable, .(Timestamp), function(x) data.frame(relative = x[,5]/max(x[,5]))) I may be misunderstanding your question, but: ddply splits your data.frame, ranktable, by the column Timestamp into many smaller data.fram

Re: [R] How to get all possible combinations?

2012-03-28 Thread Berend Hasselman
On 28-03-2012, at 21:17, Somnath Dhar wrote: > Dear all, suppose I have a vector with elements as: > > Vec <- c(2,3,4,5,6) > > Now I want to have all possible combination of length 3 using those > elements and without any repetition. Like, I want to have 1 > possibility like 2-3-4 but not 3-2-4

Re: [R] scanning data into r

2012-03-28 Thread Justin Haynes
What have you tried? What type of file are you trying to import from? What do you want your data to look like in R? take a look at ?read.table and ?readLines On Wed, Mar 28, 2012 at 11:23 AM, joel.green wrote: > Hey > > I am having trouble importing data into R, my data field looks like this

Re: [R] scanning data into r

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 2:23 PM, joel.green wrote: Hey I am having trouble importing data into R, my data field looks like this 21 TEST DATA 32 year:2012 33 34 5 36 > read.table(text="21 TEST DATA + 32 year:2012 + 33 + 34 + 5 + 36", fill=TRUE)[1] V1 1 21 2 32 3 33 4 34 5 5 6 36 I r

[R] how to match exact phrase using gsub (or similar function)

2012-03-28 Thread Markus Weisner
trying to switch out addresses that have double directions, such as the following example: a = "S S Main St & Interstate 95" a = gsub(pattern="S S ", replacement="S ", a) … the problem is that I don't want to affect instances where this might be a correct address such as the following: "3421

Re: [R] How to get all possible combinations?

2012-03-28 Thread Jorge I Velez
Perhaps this? t(combn(c(2,3,4,5,6), 3)) HTH, Jorge.- On Wed, Mar 28, 2012 at 3:17 PM, Somnath Dhar <> wrote: > Dear all, suppose I have a vector with elements as: > > Vec <- c(2,3,4,5,6) > > Now I want to have all possible combination of length 3 using those > elements and without any repetiti

Re: [R] scanning data into r

2012-03-28 Thread z2.0
Just read into a data.frame with read.table and then subset to use the first column. e.g., your_desired_data <- data.frame(read.table("path_to_file", sep = " ", fill = T)) your_desired_data <- your_desired_data[,1] -- View this message in context: http://r.789695.n4.nabble.com/scanning-data-in

[R] Why does this work? plyr within-subset normalization

2012-03-28 Thread z2.0
Working code that normalize each row's value against the subset's maximum. Does the invocation of max() somehow instruct R to 'step back' and evaluate the subset? Thanks, Zack -- View this message in context: http://r.789695.n4.nabble.com/Why-does-this-work-plyr-within-subset-normalization-tp

[R] How to get all possible combinations?

2012-03-28 Thread Somnath Dhar
Dear all, suppose I have a vector with elements as: Vec <- c(2,3,4,5,6) Now I want to have all possible combination of length 3 using those elements and without any repetition. Like, I want to have 1 possibility like 2-3-4 but not 3-2-4. Can somebody guide me how to achieve that in R? Thanks fo

[R] scanning data into r

2012-03-28 Thread joel.green
Hey I am having trouble importing data into R, my data field looks like this 21 TEST DATA 32 year:2012 33 34 5 36 I require the the number at the start of each line however the text is not needed, i am struggling to get R to import the data with out changing the file itself? how do i impor

[R] length(unique(v))

2012-03-28 Thread Sam Steingold
is there a built-in synonym for function(v) length(unique(v)) ?? thanks -- Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000 http://www.childpsy.net/ http://pmw.org.il http://iris.org.il http://ffii.org http://honestreporting.com http://openvotingconsortium.org Two w

[R] CI with confint

2012-03-28 Thread Benjamin Caldwell
Hello all, I'm trying to use confint from the MASS package to compute confidence intervals for an nls object. When I plot the results, however, they don't make sense - lines cross over the fitted model or just don't match the data. Code is : Thanks for help dat<-data.frame(a,b) with(dat, plot(a,

Re: [R] lapply and paste

2012-03-28 Thread Thomas Lumley
On Thu, Mar 29, 2012 at 7:44 AM, Ed Siefker wrote: > Thank you, I was confused about that.  What exactly is lapply for then, > if R handles this kind of thing automatically?  Are there functions that are > not "vectorized"? > There are, especially ones you write yourself that don't need to be vec

Re: [R] lapply and paste

2012-03-28 Thread R. Michael Weylandt
Yes, there are non-vectorized functions e.g, integrate(), or you can use lapply() to apply a vectorized function to each element of a list (which is not what suff was) individually: x <- list(1:3, 1:4, 1:5, 2:7) mean(x) # bad lapply(x, mean) #good Michael On Mar 28, 2012, at 2:44 PM, Ed Siefke

Re: [R] lapply and paste

2012-03-28 Thread Sarah Goslee
suff isn't a list, so lapply() isn't the right choice. How about instead: > suff<- c("C1", "C2", "C3") > sapply(suff, function(x)paste("filename_", x, ".ext", sep="")) C1C2C3 "filename_C1.ext" "filename_C2.ext" "filename_C3.ext" On Wed, Mar 28, 2012

Re: [R] lapply and paste

2012-03-28 Thread Ed Siefker
Thank you, I was confused about that. What exactly is lapply for then, if R handles this kind of thing automatically? Are there functions that are not "vectorized"? On Wed, Mar 28, 2012 at 1:37 PM, R. Michael Weylandt wrote: > I think you're confused about the need for lapply -- paste is > vec

Re: [R] lapply and paste

2012-03-28 Thread R. Michael Weylandt
I think you're confused about the need for lapply -- paste is vectorized so this paste("filename_", suff, ".ext", sep = "") will work. But if you want to use lapply (for whatever reason) try this: lapply(suff, function(x) paste("filename_", x, ".ext", sep = "") Michael On Wed, Mar 28, 2012 at

Re: [R] Is it possible to de-select with sqlQuery from the RODBC library?

2012-03-28 Thread Eric Fail
Thank you Bart for your idea, the thing is that I have a large number of tables and I would like to avoid having to pull them at all. I currently have a list that I use as a lookup table in a loop with an if else statement to sort between tables I want to sqlFetch (take everything) and tables wher

[R] lapply and paste

2012-03-28 Thread Ed Siefker
I have a list of suffixes I want to turn into file names with extensions. suff<- c("C1", "C2", "C3") paste("filename_", suff[[1]], ".ext", sep="") [1] "filename_C1.ext" How do I use lapply() on that call to paste()? What's the right way to do this: filenames <- lapply(suff, paste, ...) ? Can

[R] discrepancy between paired t test and glht on lme models

2012-03-28 Thread Rajasimhan Rajagovindan
Hi folks, I am working with repeated measures data and I ran into issues where the paired t-test results did not match those obtained by employing glht() contrasts on a lme model. While the lme model itself appears to be fine, there seems to be some discrepancy with using glht() on the lme model

Re: [R] Making Knitr work

2012-03-28 Thread Yihui Xie
You must have set the package option 'base.dir' (opts_knit$set(base.dir = )), and this directory does not exist. I do not recommend you to use this option unless you really understand it. Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa St

Re: [R] blocked MRPP and ISA

2012-03-28 Thread Rachel W
I am not sure why it wouldn't let me see your thread, so I am replying directly. Look at the BLOSSOM software. It comes with a pretty clear manual too. http://www.fort.usgs.gov/products/software/blossom/ Hope this helps. > From: mdwhi...@bsu.edu > To: r-help@r-project.org > Date: Wed, 2

Re: [R] Making Knitr work

2012-03-28 Thread Peter Langfelder
On Wed, Mar 28, 2012 at 9:09 AM, Jessica Streicher wrote: > Might not be the best place to ask, but i could get lucky.. > > I have setup an eclipse environment to write sweave files lately and wanted > to switch to knitr. I could get it to work on easy files, but my earlier > written sweave file

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-28 Thread Paul Miller
Hello All, Figured out how to get the gaps in the bars when a drug stops and the starts again (see below). Made the graph overlaid/superimposed/stacked and got the desired result. Not sure this is how an expert would do it. But it's simple and it works. Paul setwd("N:/Regimen Coding/0906/Pl

Re: [R] Extract index column the max

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 11:18 AM, MSousa wrote: Hello, I have this data.frame, and i need the value the column where the value in matrix is maximum res3 77 86 93 106 161 77 20 0 0 1 0 86 1 12 1 2 1 93 0 2 3 3 0 106 0 4 3 18 0 161 0 0 0 1 55 I use

Re: [R] POSIXlt vs POSIXct

2012-03-28 Thread Duncan Murdoch
On 28/03/2012 10:06 AM, Steven R Corsi wrote: Hello R users I am searching for a descriptive summary of the use of POSIXlt as compared to POSIXct date/time formats. I have been using them extensively for different purposes, but still can't quite understand when to use which one for the most effi

Re: [R] Need Help

2012-03-28 Thread Sarah Goslee
On Wed, Mar 28, 2012 at 11:49 AM, Partha Sinha wrote: > Sir, I am not a "Sir," but nonetheless I'd suggest you start with http://www.rseek.org and do some reading on the packages and functions available for those methods. The Optimization task view might also be of interest. I'm not sure you'll

Re: [R] How to move files from one folder to another

2012-03-28 Thread Sarah Goslee
Within R? On what OS? You could presumably use system() with the OS-specific command, which might be cp or mv or copy or move depending on your OS. But I'm not sure why you'd want to do this from R. On Wed, Mar 28, 2012 at 8:07 AM, sagarnikam123 wrote: > How to move files from one folder to ano

Re: [R] Logistic regression

2012-03-28 Thread Sarah Goslee
On Wed, Mar 28, 2012 at 11:49 AM, carlb1 wrote: > Hi > > does anyone know how to do a logistic regression in R? I do. And doubtless many other folks on R-help do too. > any help appreciated You should probably start here: http://www.rseek.org/?cx=010923144343702598753%3Aboaz1reyxd4&q=logistic+r

Re: [R] matrix(unlist(strsplit(""))) 'missing value' issue

2012-03-28 Thread MaartenJacobs
Thank you!! Been googling for hours, but kind of hard to find something if you don't know how to look for it. So thanks again!! Greetings Maarten ilai-2 wrote > > On Wed, Mar 28, 2012 at 6:49 AM, Petr PIKAL wrote: >> What problem? Nabble is not available to all and here is not mu

[R] p-value using survival ROC

2012-03-28 Thread Anamaria Crisan
It is possible to calculate the c-index for time dependent outcomes (such as disease) using the survivalROC package in R. My question is : is it possible to produce a p-value for the c-index that is calculated (at a specific point

[R] Making Knitr work

2012-03-28 Thread Jessica Streicher
Might not be the best place to ask, but i could get lucky.. I have setup an eclipse environment to write sweave files lately and wanted to switch to knitr. I could get it to work on easy files, but my earlier written sweave file fails to be knit properly. Here is the error message: Quitting fr

[R] Need Help

2012-03-28 Thread Partha Sinha
Sir, Which modules/package should I use to solve the following statistical models: 1. Multiple Objective Programming (MOP) 2. Data Envelopment Analysis (DEA) 3. Lab Experiments 4. Multiple Criteria Decision Making (MCDM) Regards, PS __ R-help@r-proje

[R] Extract index column the max

2012-03-28 Thread MSousa
Hello, I have this data.frame, and i need the value the column where the value in matrix is maximum res3 77 86 93 106 161 77 20 0 0 1 0 86 1 12 1 2 1 93 0 2 3 3 0 106 0 4 3 18 0 161 0 0 0 1 55 I use this d<-which(res3==max(res3), arr.ind=

[R] Logistic regression

2012-03-28 Thread carlb1
Hi does anyone know how to do a logistic regression in R? any help appreciated Carl -- View this message in context: http://r.789695.n4.nabble.com/Logistic-regression-tp4512658p4512658.html Sent from the R help mailing list archive at Nabble.com.

[R] POSIXlt vs POSIXct

2012-03-28 Thread Steven R Corsi
Hello R users I am searching for a descriptive summary of the use of POSIXlt as compared to POSIXct date/time formats. I have been using them extensively for different purposes, but still can't quite understand when to use which one for the most efficient coding and use. I typically use them

Re: [R] Lacking a dataset called "nztrees"?

2012-03-28 Thread mandova
yeah I forgot to library(XX) first... Didn't know packages have their own datasets. Thx! -- View this message in context: http://r.789695.n4.nabble.com/Lacking-a-dataset-called-nztrees-tp4511692p4512375.html Sent from the R help mailing list archive at Nabble.com. ___

[R] blocked MRPP and ISA

2012-03-28 Thread Whitby, Michael D
I have been trying to find a way to do a blocked MRPP (MRBP) and blocked ISA in R but have not found anything (in fact I found some things that say it is not possible). Does anyone know of a package, or written a script, that can do either of these? Thank you for any help.

[R] How to move files from one folder to another

2012-03-28 Thread sagarnikam123
How to move files from one folder to another i.e. cutting/copying from one location & pasting to another -- View this message in context: http://r.789695.n4.nabble.com/How-to-move-files-from-one-folder-to-another-tp4512087p4512087.html Sent from the R help mailing list archive at Nabble.com. ___

[R] fun.zero.omit {GLDEX}

2012-03-28 Thread Nelson Nomura
Hello. Sorry for the newbie question. When I run the function fun.zero.omit (from the GLDEX package), I get a matrix and some descriptive information. Can someone tell me how to strip out the descriptive information so that I'm only left with the matrix? Here's an example: > x=fun.zero.omit

[R] Local linear regression

2012-03-28 Thread Dimitris.Kapetanakis
Dear all, I wrote a code which supposedly should create a function which performs a local linear regression at point x (lower case). The issue is that I have no reference to check if indeed my code performs correctly a local linear regression. Is there any function in R that performs a local lin

Re: [R] Urgent - I really need some help lme4 model avg Estimates

2012-03-28 Thread Dragonwalker
Thank you Mitchell, I will try that. So I presume that the initial paper where they showed the estimates AND the intercept from a model averaging procedure may have been done using a different method? Would it still be prudent to use a global model and then perhaps show the top so many, perhaps t

Re: [R] inefficient ifelse() ?

2012-03-28 Thread Berend Hasselman
On 28-03-2012, at 17:19, Manta wrote: > I have a similar problem. I have a dataset and an element. If the element is > equal to "YY", I want to take the first column of the dataset, otherwise I > want to take the second column. The following does not work, as it only > evaluates the first element

Re: [R] matrix(unlist(strsplit(""))) 'missing value' issue

2012-03-28 Thread ilai
On Wed, Mar 28, 2012 at 6:49 AM, Petr PIKAL wrote: > What problem? Nabble is not available to all and here is not much to cook > from. Indeed. Also the OP actually provided their own solution, just 5 more minutes of googling to find ?sub. bankoffer.3 <- factor(c('999','429000:notaccepted','4

Re: [R] inefficient ifelse() ?

2012-03-28 Thread R. Michael Weylandt
Just use a regular if statement: X <- if(b == "YY") a else substr(a, 1,3) Michael On Wed, Mar 28, 2012 at 11:19 AM, Manta wrote: > I have a similar problem. I have a dataset and an element. If the element is > equal to "YY", I want to take the first column of the dataset, otherwise I > want to

Re: [R] What are the color's name in heat.color(5)

2012-03-28 Thread Eik Vettorazzi
Hi, just one more note, col2rgb works for color codes as well: (HC.m <- col2rgb(heat.colors(5))) and to convert named colors to color codes, something like tabl<-apply(col2rgb(colors()),2,function(x)do.call(rgb,c(as.list(x),alpha=255,maxColorValue=255))) names(tabl)<-colors() tabl should work.

Re: [R] inefficient ifelse() ?

2012-03-28 Thread Manta
I have a similar problem. I have a dataset and an element. If the element is equal to "YY", I want to take the first column of the dataset, otherwise I want to take the second column. The following does not work, as it only evaluates the first element. Any idea? a=c("AAAXXX","BBBXXX") a=merge(a,c(

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-03-28 Thread ilai
On Wed, Mar 28, 2012 at 4:21 AM, maxbre wrote: > After a long and winding road (sorry but I'm a novice) I get to a final > result which is quite close to what I need; > nevertheless I would like to tweak a little further the xyplot Without dput(mydata) you are the only one who can do that... so

Re: [R] R_unload_[PACKAGENAME] not called

2012-03-28 Thread Duncan Murdoch
On 28/03/2012 10:25 AM, Henrik Alsing Friberg wrote: I experimented with this earlier, but it is indeed tricky business. Last I tried my registered finalizer addressed unmapped memory, because garbage collection happened after my package (and thus the clean-up stuff) was unloaded. This happened u

Re: [R] R_unload_[PACKAGENAME] not called

2012-03-28 Thread Henrik Alsing Friberg
I experimented with this earlier, but it is indeed tricky business. Last I tried my registered finalizer addressed unmapped memory, because garbage collection happened after my package (and thus the clean-up stuff) was unloaded. This happened using the R_RegisterFinalizerEx function from C++ on som

Re: [R] rgl package broke with R 2.14.2

2012-03-28 Thread Duncan Murdoch
On 12-03-27 6:31 PM, Grimes Mark wrote: Dear People I can't figure out how to fix this problem: rgl won't run under R 2.14.2 (it was working for me before under 2.14.0). The error message is: rgl is currently changing fairly rapidly. I'd suggest trying to install again (the current versio

Re: [R] SVM. How to use categorical attributes?

2012-03-28 Thread Steve Lianoglou
Sorry -- I should add that I'm pointing out the potential shogun implementation because I suspect their implementation of a bag-of-words -like kernel would use the kernel trick, so you won't have to map all of your data explicitly into some huge feature space that will blow your memory away. I'm n

Re: [R] SVM. How to use categorical attributes?

2012-03-28 Thread Steve Lianoglou
Hi, These suggestions still require you to explicitly compute your feature space or kernel matrix first, which might kill you memory wise. You might consider taking a look at the shogun toolbox: http://www.shogun-toolbox.org/ With some digging, I'm pretty sure you'll find a bag-of-words type of

Re: [R] What are the color's name in heat.color(5)

2012-03-28 Thread David Winsemius
On Mar 28, 2012, at 9:08 AM, Kevin Wright wrote: They have hex RGB values instead of names: R> heat.colors(5) [1] "#FFFF" "#FF5500FF" "#FFAA00FF" "#00FF" "#80FF" Kevin The first one is the same as 'red' as can be seen by parsing the RGB values above: > col2rgb("red")

  1   2   >