[R] R2HTML: how to include comments in html output

2010-07-16 Thread Vikas Rawal
Is there any way to include comments in the html output of R2HTML? Or is there any other function in any package that produces an html output including comments, commands and output of the commands. Vikas Rawal __ R-help@r-project.org mailing list http

Re: [R] How to generate PDF help file for our internal R package?

2010-07-16 Thread Romain Francois
Le 17/07/10 08:23, noclue_ a écrit : Currently, we have developed an R package for our company's internal use (at least for now). I have successfully built the package and generated zip file which can be easily installed. However, I am not sure how to generate the big HELP file in PDF. Right

[R] How to generate PDF help file for our internal R package?

2010-07-16 Thread noclue_
Currently, we have developed an R package for our company's internal use (at least for now). I have successfully built the package and generated zip file which can be easily installed. However, I am not sure how to generate the big HELP file in PDF. Right now, I have about 30+ Rd files for t

Re: [R] how to comment off sections

2010-07-16 Thread Joshua Wiley
I use XEmacs + ESS, and looking for ways to add text to a region of code, I see it is quite easy with C-x r t. Thanks for your great advice. On Fri, Jul 16, 2010 at 7:32 PM, Erik Iverson wrote: > On 07/16/2010 06:59 PM, Joshua Wiley wrote: >> >> Hello, >> >> Is there an way to easy comment of se

[R] cca in ade4

2010-07-16 Thread elaine kuo
Dear List, I used spec and envi for cca in ade4. (both are data.frame) However, there is a message telling that error in if (nf > rank) nf <- rank R missing value in TRUE/FALSE Please kindly help how to modify the code below. Thank you. Elaine code rm(list=ls()) spec <-read.csv("c:/migration

[R] data.frame required for cca in ade4

2010-07-16 Thread elaine kuo
Dear List, I tried to conduct cca using csv data but failed. The message said that data.frame is required. Please kindly share how to convert a csv-imported file to a data.frame. Thank you. Elaine code rm(list=ls()) spec <-read.csv("c:/migration/M_R_20100718_winterM_spec_vegan.csv",header=T, r

Re: [R] cca in vegan (formula instead of community matrix data)

2010-07-16 Thread Bill.Venables
As it says, (at least) one of your rows is all zeros. CCA cannot handle such sites. You might want to try something like this: m.cca <- cca(WinterM_ratio ~ topo_mean + coast + prec_max + temp_min + evi_min, data = datam, subset = rowSums(WinterM_ratio) > 0) ### Note. (Note that you do n

[R] cca in vegan (formula instead of community matrix data)

2010-07-16 Thread elaine kuo
Dear List, I tried to do cca based on species data and environmental variables (formula instead of community data). However, there was an error saying row sums must be >0. I searched the previous related messages but found few solutions. Please kindly help and thank you in advance. code This is

Re: [R] Creating Enumerated Variables

2010-07-16 Thread Gabor Grothendieck
On Thu, Jul 15, 2010 at 10:45 AM, jdellava wrote: > > Hi, > > I am trying to create a variable counting the number of individuals based on > two variables. I am able to do it or one variable, but not two. In SAS I was > able to sort by two variables and use a first. statement to create the > count

Re: [R] how to comment off sections

2010-07-16 Thread Erik Iverson
On 07/16/2010 06:59 PM, Joshua Wiley wrote: Hello, Is there an way to easy comment of sections of code? I was thinking something along the lines of \dontrun{ codeline 1 codeline k } but that could be used in regular script files. When I am still working on a script, I often want to bein

[R] package anacor possible for formula lm ?

2010-07-16 Thread elaine kuo
Dear list I found package anacor very user-friendly but wanted to learn more after reading the publication "a simple..." and its manual. Please kindly help with the following questions and thanks in advance. 1. is it possible to implement lm formula in anacor? 2. is there manual to a

Re: [R] RMySQL package on 64bit R for Windows

2010-07-16 Thread Steven McKinney
I think this is a question for R-devel so I'm cross-posting there with apologies. I've just acquired a Windows 7 64-bit box and also will need RMySQL eventually. Is there any information about issues involved with compiling RMySQL for Windows 64-bit? Steven McKinney Statistician Molecular Oncol

Re: [R] multivariate graphs, averaging on some vars

2010-07-16 Thread Wu Gong
Hi, you can try plot3d library(rgl) plot3d(x=x[,2],y=x[,3],z=rowMeans(x[,2:4])) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/multivariate-graphs-averaging-on-some-vars-tp2292039p2292076.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] how to comment off sections

2010-07-16 Thread Joshua Wiley
That's a great idea. Thanks! On Fri, Jul 16, 2010 at 5:02 PM, RICHARD M. HEIBERGER wrote: > if (FALSE)  { > codeline 1 > > codeline k > } > > > On Fri, Jul 16, 2010 at 7:59 PM, Joshua Wiley > wrote: >> >> Hello, >> >> Is there an way to easy comment of sections of code?  I was thinking >>

Re: [R] how to comment off sections

2010-07-16 Thread RICHARD M. HEIBERGER
if (FALSE) { codeline 1 codeline k } On Fri, Jul 16, 2010 at 7:59 PM, Joshua Wiley wrote: > Hello, > > Is there an way to easy comment of sections of code? I was thinking > something along the lines of > > \dontrun{ > codeline 1 > > codeline k > } > > but that could be used in regul

[R] how to comment off sections

2010-07-16 Thread Joshua Wiley
Hello, Is there an way to easy comment of sections of code? I was thinking something along the lines of \dontrun{ codeline 1 codeline k } but that could be used in regular script files. When I am still working on a script, I often want to being using what is done, but I would like the par

[R] multivariate graphs, averaging on some vars

2010-07-16 Thread skan
Hello I have a table of this kind: functionx1 x2 x3 2.232 1 1 1.00 2.242 1 1 1.01 2.732 1 1 1.02 2.770 1 2 1.00 1.932 1 2 1.01 2.132 1 2 1.02 3.2

Re: [R] invalid factor level, NAs generated

2010-07-16 Thread Jared Stabach
Yes, this is problem. Thanks for the suggestion. I had deleted the N/A values later in the script but should have taken care of them in this first step. Thanks very much Jared On Fri, Jul 16, 2010 at 4:11 PM, Peter Ehlers wrote: > On 2010-07-16 13:38, Jared Stabach wrote: > >> I've seen a f

Re: [R] invalid factor level, NAs generated

2010-07-16 Thread Peter Ehlers
On 2010-07-16 13:38, Jared Stabach wrote: I've seen a few threads about this, but none that seem to answer my problem I have a list of .txt files in a directory that I am reading into R and row binding together. I am using the following code to do so: # Directory where files are found my.txt.f

Re: [R] a issue about the qutation mark?

2010-07-16 Thread MacQueen, Don
You need to understand the difference between a variable and a value. In your case that doesn't work, you are supplying a value, "trait.value". but you have no file named "trait.value". In the case that does work you are supplying a variable, trait.value, and the value contained in that variable

Re: [R] a issue about the qutation mark?

2010-07-16 Thread Ista Zahn
Hi Karena, On Fri, Jul 16, 2010 at 11:23 AM, karena wrote: > So, as we all know, when using "read.csv", we need to use qutation mark out > side the filename which we wanna read in. At first, for line 8, I wrote: > read.csv("trait.file"), at last line, I wrote: > funcname(folder/hyper.csv), but

Re: [R] Nested if help

2010-07-16 Thread Dennis Murphy
Hi: I'm guessing that your time variable is not defined with a class that respects (time) ordering, so your first if statement is meaningless. In the absence of further information, either create a meaningful time/date variable or at the very least, an ordered factor. Given what you've provided,

Re: [R] sqldf modify table

2010-07-16 Thread Gabor Grothendieck
On Fri, Jul 16, 2010 at 2:46 PM, PeterTucker wrote: > > Hi - I am something of a newbie and am a little perplexed.  When (trying to) > modify a table I issue the following commands with subsequent errors > > sqldf("alter table Korea drop column code", dbname = "mydb") > error in statement: near "d

Re: [R] RMySQL package on 64bit R for Windows

2010-07-16 Thread abeSRT
Did you ever find a solution for this? -- View this message in context: http://r.789695.n4.nabble.com/RMySQL-package-on-64bit-R-for-Windows-tp2248726p2291892.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Creating symbolic expressions in R

2010-07-16 Thread Erin
Hello, I'm trying to do some differential equation modeling in R using the package 'deSolve.' Briefly, I'm trying to use the law of mass action (the details of which aren't really important) to structure a vector of rate equation which will be passed into an ODE function and solved with associate

[R] Troubles with DBI's dbWriteTable in RMySQL

2010-07-16 Thread Ted Byers
I am feeling rather dumb right now. I created what I thought was a data.frame as follows: aaa <- lapply(split(moreinfo,list(moreinfo$m_id),drop = TRUE), fun_m_id) m_id_default_res <- do.call(rbind, aaa) print("==") m_id_default_res print("==

[R] Nested if help

2010-07-16 Thread George Coyle
Hello, I am trying to find a direct way to write a nested if of sorts to find data for a specific time range for a specific day (across a range of days) and have exhausted my abilities with the manuals I have at hand. I have a good deal of data of this approximate form: day time price 1

[R] a issue about the qutation mark?

2010-07-16 Thread karena
Following is a function that I wrote (It is working well). It's a simple one, nothing complicated. The only question that I have is a qutation mark issue, I guess. # funcname <- function(trait.file){#line1 setwd('/root/sub

[R] Mixed Conditional Logit with nested data

2010-07-16 Thread Paul Miller
Hello Everyone,   This is my first attempt to do something in R. As a precursor to a Willingness to Pay analysis, I want to conduct a Mixed Conditional Logit analysis but am unsure how to proceed because of some nesting within my data.   Below is some data and code that illustrate what I’m t

[R] sqldf modify table

2010-07-16 Thread PeterTucker
Hi - I am something of a newbie and am a little perplexed. When (trying to) modify a table I issue the following commands with subsequent errors sqldf("alter table Korea drop column code", dbname = "mydb") error in statement: near "drop": syntax error or sqldf("alter table Korea rename column

Re: [R] Access web content from within R

2010-07-16 Thread Henrique Dallazuanna
Try this: library(XML) readHTMLTable("http://extranet.pheur.org/4DLink1/4DCGI/Web_View/mono/198";, which = 5) On Fri, Jul 16, 2010 at 4:08 PM, Bart Joosen wrote: > > Marsh, > > you are absolutely right, I forget the link to the db. > Actually its a webpage for each monograph number: > > http://

Re: [R] how to skip a specific value when using apply() function to a matrix?

2010-07-16 Thread Shuhua Zhan
Hello Joshua and Wu, Thank you for your excellent solutions. Joshua - Original Message - From: "Joshua Wiley" To: "Shuhua Zhan" Cc: r-help@r-project.org Sent: Friday, July 16, 2010 12:39:22 PM GMT -05:00 US/Canada Eastern Subject: Re: [R] how to skip a specific value when using apply() f

Re: [R] Deleting a variable number of characters from a string

2010-07-16 Thread Gabor Grothendieck
On Fri, Jul 16, 2010 at 1:59 PM, Davis, Brian wrote: > I have a text processing problem I'm hoping someone can help me solve.  This > issue it this. > >  I have a character string in which I need to delete a variable number of > characters from the string.  The string itself contains the number

Re: [R] make an model object (e.g. nlme) available in a user defined function (xyplot related)

2010-07-16 Thread Deepayan Sarkar
On Mon, Jul 12, 2010 at 8:16 AM, Jun Shen wrote: > Dear Deepayan, > > Thank you for taking the time to look into this issue. > > I have a data object called "Data", please find it at the end of the > message. Then I can run the code below separately in the console. [...] > ##

[R] Sage and R (was: Mathematica and R)

2010-07-16 Thread Karl-Dieter Crisman
Dear David, > I managed to install Sage on Windows (via a Linux VM), but I cannot find any > documentation on how to use R from Sage. Maybe I > should use the web interface of Sage to avoid having to install R on the VM. In the Sage command line, you can type sage: r? to get some very basic in

Re: [R] invalid factor level, NAs generated

2010-07-16 Thread Dennis Murphy
Hi Jared: Is it possible you're using read.table with variable names in line 1 but not using header = TRUE as an argument? HTH, Dennis On Fri, Jul 16, 2010 at 12:41 PM, Erik Iverson wrote: > > > > >> I think I have identified the problem such that when I identify the >> structure of some of t

[R] Multinomial logistic regression in complex surveys

2010-07-16 Thread Rosario Austral
Dear R-list members, I´m using the package "survey" and I need to find a function for multinomial logistic regression in a complex design. The functions that I see are only for dicotomic and ordinal variables. Thank you! Rosario Austral De: "r-help-requ...@r-

Re: [R] invalid factor level, NAs generated

2010-07-16 Thread Erik Iverson
I think I have identified the problem such that when I identify the structure of some of the files that I am reading in, columns are labeled as "Factors". In other files, the same columns are labeled as numeric values. Is there a way to assign the data structure to these columns in the dataf

[R] invalid factor level, NAs generated

2010-07-16 Thread Jared Stabach
I've seen a few threads about this, but none that seem to answer my problem I have a list of .txt files in a directory that I am reading into R and row binding together. I am using the following code to do so: # Directory where files are found my.txt.file.directory <- "C:/Jared/Data/Kenya/Wildeb

Re: [R] Dot Plot with Confidence Limits

2010-07-16 Thread Deepayan Sarkar
On Wed, Jul 14, 2010 at 10:12 AM, Neil123 wrote: > > Hi, > > I have the following dataset and I would like to create a dotplot with > confidence limits: > >        CAT1              CAT2          MEAN                 Lower > Upper > 1         1                     1            0.619              

Re: [R] how to collapse categories or re-categorize variables?

2010-07-16 Thread Ista Zahn
Hi, On Fri, Jul 16, 2010 at 5:18 PM, CC wrote: > I am sure this is a very basic question: > > I have 600,000 categorical variables in a data.frame - each of which is > classified as "0", "1", or "2" > > What I would like to do is collapse "1" and "2" and leave "0" by itself, > such that after re-c

[R] Elementary question about computing confidence intervals.

2010-07-16 Thread Ted Byers
I would have thought this to be relatively elementary, but I can't find it mentioned in any of my stats texts. Please consider the following: library(fitdistrplus) fp = fitdist(y,"exp"); rate = fp$estimate; sd = fp$sd fOneWeek = exp(-rate*7); #fraction that happens within a week - y is m

Re: [R] how to collapse categories or re-categorize variables?

2010-07-16 Thread Dennis Murphy
Hi: See ? levels. Here's a toy example: > x <- factor(sample(0:2, 10, replace = TRUE)) > x [1] 1 2 1 0 2 2 2 2 2 1 Levels: 0 1 2 > levels(x) <- c(0, 1, 1)# Change level 2 to 1 > x [1] 1 1 1 0 1 1 1 1 1 1 Levels: 0 1 HTH, Dennis On Fri, Jul 16, 2010 at 10:18 AM, CC wrote: > I am sure t

Re: [R] Access web content from within R

2010-07-16 Thread Bart Joosen
Marsh, you are absolutely right, I forget the link to the db. Actually its a webpage for each monograph number: http://extranet.pheur.org/4DLink1/4DCGI/Web_View/mono/198 http://extranet.pheur.org/4DLink1/4DCGI/Web_View/mono/731 ... As I have a list with the numbers of interest (l<- c(198, 731,

Re: [R] Help with Sink Function

2010-07-16 Thread Matt Shotwell
Your code between calls to sink() does not generate any output. Hence, nothing will be diverted to the file. To illustrate this point, consider for(i in 1:10) i This produces no output. However, for(i in 1:10) print(i) produces output as expected. -Matt On Fri, 2010-07-16 at 13:34 -0400, Ad

Re: [R] Deleting a variable number of characters from a string

2010-07-16 Thread Wu Gong
Hi Davis, Please try ??regex gsub("(\\-|\\+)([0-9]+)(\\w*)(\\w)", replacement="\\4", x) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Deleting-a-variable-number-of-characters-from-a-string-tp2291754p2291797.html Sent from the R help mailing list archive at

Re: [R] threshold in plot

2010-07-16 Thread Dennis Murphy
Hi: Here's a simple example (divide through by 10 for your case): x <- 1:10 y <- rnorm(10, x, s = 0.3) clr <- ifelse(x <= 5, 'red', 'blue') plot(x, y, col = clr) HTH, Dennis On Fri, Jul 16, 2010 at 6:08 AM, azam jaafari wrote: > Hi > > I want to draw a plot from observed and predicted data an

Re: [R] Creating Enumerated Variables

2010-07-16 Thread Dennis Murphy
Hi: Hadley's solution is certainly preferred here due to its relative simplicity. I just wanted to correct an error from my earlier post. On Thu, Jul 15, 2010 at 2:08 PM, Dennis Murphy wrote: > Hi: > > I sincerely hope there's an easier way, but one method to get this is as > follows, > with d

[R] Deleting a variable number of characters from a string

2010-07-16 Thread Davis, Brian
I have a text processing problem I'm hoping someone can help me solve. This issue it this. I have a character string in which I need to delete a variable number of characters from the string. The string itself contains the number of characters to be deleted. The number of characters to be d

Re: [R] Mathematica and R

2010-07-16 Thread David Bickel
Hi Albyn, Thank you very much for the suggestion. I managed to install Sage on Windows (via a Linux VM), but I cannot find any documentation on how to use R from Sage. Maybe I should use the web interface of Sage to avoid having to install R on the VM. Best regards, David On 10-07-14 10:2

Re: [R] how to collapse categories or re-categorize variables?

2010-07-16 Thread Wu Gong
Do you want to replace specific values of a data set? df <- sample(c(0,1,2),600,replace=T) table(df) df[df==2]<-1 table(df) - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/how-to-collapse-categories-or-re-categorize-variables-tp2291704p2291727.html Sent from t

Re: [R] Help with Sink Function

2010-07-16 Thread Addi Wei
Sorry about that. Still new to this... The code below should be reproducible.All R2 should just be 1, and I should write 1 to R2outputKKNN.txt 10 timesnothing is happening. Appreciate the efforts to help! for (i in 1:10) { adata = 1:5 bdata = 6:10 lm <- lm(adata

Re: [R] Help with Sink Function

2010-07-16 Thread Erik Iverson
This is not reproducible, and does not look minimal. You'll get better answers, and probably solve many issues on your own, if you construct small examples that illustrate the same problem you're having with your real data. Addi Wei wrote: iterations <- 100 nvars <- 4 combined <- rbind(scale

[R] Help with Sink Function

2010-07-16 Thread Addi Wei
iterations <- 100 nvars <- 4 combined <- rbind(scaleMiceTrain, scaleMiceTest) reducedSample <- combined reducedSample <- subset(reducedSample, select = -pID50) reducedSample <- subset(reducedSample, select = -id) for (i in 1:iterations) { miceSample <- sample(combined[,-c(1,2)],nvars, repl

[R] how to collapse categories or re-categorize variables?

2010-07-16 Thread CC
I am sure this is a very basic question: I have 600,000 categorical variables in a data.frame - each of which is classified as "0", "1", or "2" What I would like to do is collapse "1" and "2" and leave "0" by itself, such that after re-categorizing "0" = "0"; "1" = "1" and "2" = "1" --- in the en

Re: [R] Access web content from within R

2010-07-16 Thread Marshall Feldman
On 7/16/2010 6:00 AM, r-help-requ...@r-project.org wrote: Message: 5 Date: Thu, 15 Jul 2010 03:36:21 -0700 (PDT) From: Bart Joosen To:r-help@r-project.org Subject: [R] Access web content from within R Message-ID:<1279190181074-2289953.p...@n4.nabble.com> Content-Type: text/plain; charset=us-ascii

Re: [R] setting up dates

2010-07-16 Thread Gabor Grothendieck
On Fri, Jul 16, 2010 at 12:38 PM, Erin Hodgess wrote: > I have several data sets, which begin early in 2002 and run until > yesterday.  They do not have observations every day.  For example: >> xd1[1:10] > 2002-02-25 2002-02-26 2002-02-28 2002-03-01 2002-03-04 2002-03-05 2002-03-07 >         7    

Re: [R] how to skip a specific value when using apply() function to a matrix?

2010-07-16 Thread Wu Gong
Hi szhan, I think Joshua gives all you wants -- scale is a really good function. You can also make your own function work by setting an argument na.rm. tmp1[tmp1==0]<-NA student<- function(x){ x<-(x-mean(x,na.rm=T))/sd(x,na.rm=T) return (x) } tmp4<-apply(tmp1, 2, student) -

Re: [R] package for rank ordered logit

2010-07-16 Thread Suresh Singh
My understanding is that polr will do ordered logit but I am not sure if it is also suited for rank ordered logit (or is there no such distinction) I am thinking of following two situations 1. there is an ordered response (say small,medium,large coffee) and each individual selects one of these op

Re: [R] how to skip a specific value when using apply() function to a matrix?

2010-07-16 Thread Joshua Wiley
Hello, This does what you want. The simple solution is shorter but requires that there is only one value you wish to exclude (e.g., 0). The second works for any number of values you wish to exclude, but is subsequently longer. Also there is no need to create your own function to 'studentize', ?

[R] Toggle between the various pages for multi-page figures

2010-07-16 Thread mahesh samtani
Hello, I am a new R user having transitioned over from S-plus recently. I have a question that is probably very trivial but I am having trouble finding a solution. In S-plus, graphic pages are created as tabs when multi-page figures are created. I have shown the R code for xpose.VPC (a function wi

[R] setting up dates

2010-07-16 Thread Erin Hodgess
I have several data sets, which begin early in 2002 and run until yesterday. They do not have observations every day. For example: > xd1[1:10] 2002-02-25 2002-02-26 2002-02-28 2002-03-01 2002-03-04 2002-03-05 2002-03-07 7 8 1 9 12 3 5

Re: [R] I need help making a data.fame comprised of selected columns of an original data frame.

2010-07-16 Thread Ted Byers
Hi Steve, Thanks Here is a tiny subset of the data: > dput(head(moreinfo, 40)) structure(list(m_id = c(171, 206, 206, 206, 206, 206, 206, 218, 224, 224, 227, 229, 229, 229, 229, 229, 229, 229, 229, 233, 233, 238, 238, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251,

Re: [R] Simple question regarding name of column headers

2010-07-16 Thread jim holtman
subset(miceTrainSample, select = -plD50) On Fri, Jul 16, 2010 at 11:22 AM, Addi Wei wrote: > > names(miceTrainSample) > [1] "b_double"  "KierA2"    "KierFlex"  "Q_VSA_POS" "pID50" > > In the above code, how do I delete "pID50" column to store the resulting > object without indicating column "5".

Re: [R] read.table input array

2010-07-16 Thread jim holtman
Here is a way of creating a separate list of variable length vectors that you can use in your processing: > # read into a dataframe > x <- read.table(textConnection("ABCTLengths + 14.00.001525878918c(1,2,3) + 14.00.001525878918c(1,2,6,7,8,3) + 14

Re: [R] how to skip a specific value when using apply() function to a matrix?

2010-07-16 Thread Shuhua Zhan
Hello Nikhil and Wu, Thank you very much for your reply! What I want is to calculate the student's score column-wise by ignoring the specific values such as zeros for example only using c(2,1) in column 8 in the tmp1 and generate tmp2. I changed the zeros to NAs and modified my stud fun to stude

Re: [R] Simple question regarding name of column headers

2010-07-16 Thread Erik Iverson
Anyway, I have often wished that something like new.mt.sample <- miceTrainSample[, -"pID50"] would return miceTrainSample without the pID50 column. Here are three alternative ways to do it. # Method 1: Assign NULL to the column new.mt.sample <- miceTrainsSample new.mt.sample$pID50 <- NULL # Me

Re: [R] I need help making a data.fame comprised of selected columns of an original data frame.

2010-07-16 Thread Steve Lianoglou
Hi, First: it's kind of hard to play along w/o some reproducible data. To that end, you can paste into an email the output of: dput(moreinfo) If there are lots of rows in `moreinfo`, just give us the first ~10-20 dput(head(moreinfo, 20)) Anyway: > At this point, each row in m_id_default_res

Re: [R] discrepancy matrix

2010-07-16 Thread Wu Gong
I guess your data frame is a little different from the reference, so your as.logical doesn't work. attach(Q) FUN <- function(X, Y) {abs(X - Y)} round(outer(rank(date)[colour=="b"],rank(date)[colour=="g"],FUN) + outer(rank(number)[colour=="b"],rank(number)[colour=="g"],FUN)) detach(Q) - A

[R] I need help making a data.fame comprised of selected columns of an original data frame.

2010-07-16 Thread Ted Byers
I must have missed something simple, but still, i don't know what. I obtained my basic data as follows: x <- sprintf("SELECT m_id,sale_date,YEAR(sale_date) AS sale_year,WEEK(sale_date) AS sale_week,return_type,0.0001 + DATEDIFF(return_date,sale_date) AS elapsed_time FROM `merchants2`.`risk_input`

Re: [R] changing names numeric to a time series

2010-07-16 Thread Gabor Grothendieck
On Fri, Jul 16, 2010 at 11:26 AM, Erin Hodgess wrote: > Dear R People: > > What is the best way to change a named numeric (in which the names are > dates) to a time series, please? > >> str(y1) >  Named int [1:730] 102 145 147 120 132 125 137 103 128 130 ... >  - attr(*, "names")= chr [1:730] "200

Re: [R] Simple question regarding name of column headers

2010-07-16 Thread Ista Zahn
Hi Addi, On Fri, Jul 16, 2010 at 3:22 PM, Addi Wei wrote: > > names(miceTrainSample) > [1] "b_double"  "KierA2"    "KierFlex"  "Q_VSA_POS" "pID50" > > In the above code, how do I delete "pID50" column to store the resulting > object without indicating column "5".  The code below does the trick, b

Re: [R] package for rank ordered logit

2010-07-16 Thread Tal Galili
Did you try: library(MASS) ?polr ? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) -

[R] changing names numeric to a time series - solved

2010-07-16 Thread Erin Hodgess
Here is the original question: What is the best way to change a named numeric to a time series > str(y1) Named int [1:730] 102 145 147 120 132 125 137 103 128 130 ... - attr(*, "names")= chr [1:730] "2006-01-01" "2006-01-02" "2006-01-03" "2006-01-04" ... > y2 <- zoo(y1,order=names(y1)) Perfec

[R] changing names numeric to a time series

2010-07-16 Thread Erin Hodgess
Dear R People: What is the best way to change a named numeric (in which the names are dates) to a time series, please? > str(y1) Named int [1:730] 102 145 147 120 132 125 137 103 128 130 ... - attr(*, "names")= chr [1:730] "2006-01-01" "2006-01-02" "2006-01-03" "2006-01-04" ... > Thanks in adv

[R] Simple question regarding name of column headers

2010-07-16 Thread Addi Wei
names(miceTrainSample) [1] "b_double" "KierA2""KierFlex" "Q_VSA_POS" "pID50" In the above code, how do I delete "pID50" column to store the resulting object without indicating column "5". The code below does the trick, but I wish to delete the column by specifying "-pID50" instead of "5".

Re: [R] save plot

2010-07-16 Thread Erik Iverson
We need to know how you're doing this, with a minimal example that we can run. Most graphics devices accept a file or filename argument, so that's one way. If you're using the pdf device, multiple plots will create multiple pages in the final output.. linda.s wrote: I made a plot, but after

[R] save plot

2010-07-16 Thread linda.s
I made a plot, but after I made a second plot, the previous plot was gone. How can I save all the plots in a file (I do not manually copy and paste them one by one)? Thanks. Linda __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] package for rank ordered logit

2010-07-16 Thread Suresh Singh
Is there a package in R that can run rank-ordered logit? Thanks, Suresh __ 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,

Re: [R] question about string handling....

2010-07-16 Thread karena
hey, guys, all these methods work perfectly. thank you!! -- View this message in context: http://r.789695.n4.nabble.com/question-about-string-handling-tp2289178p2291497.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Philip Whittall
Hi Duncan, That fixed it. Many thanks indeed, I now know what to do if it happens again, Philip -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 16 July 2010 16:00 To: Philip Whittall Cc: r-help@r-project.org Subject: Re: [R] Packages built before R 2.10

Re: [R] assign

2010-07-16 Thread Duncan Murdoch
On 16/07/2010 10:57 AM, linda.s wrote: Hi. I am a beginner. What is the difference between: x<-2 and x=2 It depends on the context. "x <- 2" always assigns the value 2 to the variable named x. Typed as an isolated command, that's what "x = 2" does too. However, when used as an argument

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Duncan Murdoch
On 16/07/2010 10:51 AM, Philip Whittall wrote: I should have added that this problem is not serious under 2.10 as you only get a Warning and everything works > require(candisc) Loading required package: candisc Loading required package: car Loading required package: heplots Warning message: pa

[R] assign

2010-07-16 Thread linda.s
Hi. I am a beginner. What is the difference between: x<-2 and x=2 Thanks. Linda __ 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 co

[R] read.table input array

2010-07-16 Thread Balpo
Hello to all! I am new with R and I need your help. I'm trying to read a file which contests are similar to this: ABCTLengths 14.00.001525878918c(1,2,3) 11.00.001716613824c(1,1,4) So all the columns are numeric values, except Lengths, which is supp

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Philip Whittall
I should have added that this problem is not serious under 2.10 as you only get a Warning and everything works > require(candisc) Loading required package: candisc Loading required package: car Loading required package: heplots Warning message: package 'car' was built under R version 2.9.2 and

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Duncan Murdoch
On 16/07/2010 10:41 AM, Philip Whittall wrote: Hi Duncan, Many thanks for the response. I did indeed re-install car and this is what occurred ... > utils:::menuInstallLocal() package 'car' successfully unpacked and MD5 sums checked > require(candisc) Loading required package: candisc Loading re

Re: [R] Question about KLdiv and large datasets

2010-07-16 Thread Peter Ehlers
On 2010-07-16 7:56, Ralf B wrote: Hi all, when running KL on a small data set, everything is fine: require("flexmix") n<- 20 a<- rnorm(n) b<- rnorm(n) mydata<- cbind(a,b) KLdiv(mydata) however, when this dataset increases require("flexmix") n<- 1000 a<- rnorm(n) b<- rnorm(n) mydata<- cbin

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Philip Whittall
Hi Duncan, Many thanks for the response. I did indeed re-install car and this is what occurred ... > utils:::menuInstallLocal() package 'car' successfully unpacked and MD5 sums checked > require(candisc) Loading required package: candisc Loading required package: car Error: package 'car' was buil

Re: [R] Packages built before R 2.10.0

2010-07-16 Thread Duncan Murdoch
On 16/07/2010 9:50 AM, Philip Whittall wrote: Dear list, I am running R2.11.1 on 32 bit windows. I am receiving messages as follows ... > require(car) Loading required package: car Error: package 'car' was built before R 2.10.0: please re-install it The package kohonen was another example. Thi

[R] filtered back-projection

2010-07-16 Thread Kendralin Freeman
Hi List, Does R have a package that will do filtered back-projection? I'm a medical physicist trying to produce an image of a dose cloud within a phantom using software other than Matlab and wondered if R has this capability. I looked through the imaging pages on the project site but didn't see

[R] Question about KLdiv and large datasets

2010-07-16 Thread Ralf B
Hi all, when running KL on a small data set, everything is fine: require("flexmix") n <- 20 a <- rnorm(n) b <- rnorm(n) mydata <- cbind(a,b) KLdiv(mydata) however, when this dataset increases require("flexmix") n <- 1000 a <- rnorm(n) b <- rnorm(n) mydata <- cbind(a,b) KLdiv(mydata) KL se

[R] Packages built before R 2.10.0

2010-07-16 Thread Philip Whittall
Dear list, I am running R2.11.1 on 32 bit windows. I am receiving messages as follows ... > require(car) Loading required package: car Error: package 'car' was built before R 2.10.0: please re-install it The package kohonen was another example. This failure appears to be fatal and not only affec

Re: [R] Standard Error for individual patient survival with survfit and summary.survfit

2010-07-16 Thread Terry Therneau
> Can anyone tell me what is the difference between these two standard > errors and how should I interpret the confidence intervals and std.err > given these differences? help(survfit.object) will give you the answer. The std in the object is for the cumulative hazard, the printout uses a Taylor

[R] threshold in plot

2010-07-16 Thread azam jaafari
Hi   I want to draw a plot from observed and predicted data and also shows threshold and data before threshold are identified with different color from data after threshold.   Suppose: abserved data are 0 or 1 predicted data= 0 to 1 threshold=0.5   Thanks alot     [[alternative

Re: [R] CART with a circular response

2010-07-16 Thread Terry Therneau
> Could anyone advise me how can I implement classification and > regression tree analyses for a circular response (angles)? Rpart allows for user-defined splitting rules. You need to define a function which is given y and an ordered x, and returns the 'goodness of split' for each split point. Y

Re: [R] Creating Enumerated Variables

2010-07-16 Thread Hadley Wickham
On Thu, Jul 15, 2010 at 11:08 PM, Dennis Murphy wrote: > Hi: > > I sincerely hope there's an easier way, but one method to get this is as > follows, > with d as the data frame name of your test data: > > d <- d[order(with(d, Age, School, rev(Grade))), ] > d$Count <- do.call(c, mapply(seq, 1, as.ve

Re: [R] send out put to file in R

2010-07-16 Thread Gábor Csárdi
On Thu, Jul 15, 2010 at 6:38 PM, chakri_amateur wrote: [...] > I want to extract the largest connected component (alias sub-graph) of the > network. My input network is a large network of >1000 vertices and >15000 > arcs. From this, I want to take out only the largest cluster. > >> If you decompos

Re: [R] Creating Enumerated Variables

2010-07-16 Thread John Kane
I think this is simpler but still not all that clean. === xx <- structure(list(ID = 1:9, Age = c(10L, 10L, 10L, 11L, 11L, 11L, 10L, 10L, 11L), School = c(1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L ), Grade = c(98L, 97L, 92L, 90L, 80L, 70L, 80L, 7

Re: [R] How to transform: 4 columns into two columns stacked

2010-07-16 Thread Eik Vettorazzi
its maybe not as simple as Teds solution but points to a more general approach reshape(mydata,direction="long",varying=names(mydata),v.names=c("id","x","y")) Am 16.07.2010 13:27, schrieb Ralf B: > I have the following data structure: > > n=5 > mydata <- data.frame(id=1:n, x=rnorm(n), y=rnorm(n),

  1   2   >