[R] interaction between categorical variables

2011-06-20 Thread taby gathoni
Dear R-users, I need some  assistance. I am running some interactive variables for categorical variables. I have dgen(2 levels converted to dummy variables)  and dtoe(4-levels also converted to  dummy variables). So I have worked with them in two ways: i created a variable X1 = dgen*dtoe 

[R] (no subject)

2011-06-20 Thread Ungku Akashah
hello, i already include the error in blue color word. i hope it can help you to understand my question. if not burden you, please give me a guide how to correct the error or maybe you can correct the coding cause error. thank you. > #lda.r > # > #Author:Amsha Nahid, Jairus Bowne, G

[R] Plot error bars on skyline plot

2011-06-20 Thread Andra-Lia Tolbus
Hi, I have generated a skyline plot of a tree in newick format using "ape". How can I plot the error bars for this graph? I only have the the tree data. un<-"8.1:0, 20.1:0):0, 6.1:3):123, (35.1:0, (22.1:0, (43.1:1, 29.1:0):0):0):4, 25.1:6):0, ((42.1:0, 21.1:0):3, (39.1:0, 2.1:

[R] (no subject)

2011-06-20 Thread Runlong Tang
Hi Everyone, When generating help files for a R package, can I specify the order of the R functions? Now I can see that the functions are sorted according to their names. However, for my case, there are two functions are closely related, but they are separated by some other functions. I think it w

Re: [R] Vi mode in Linux console - how to stop it ?

2011-06-20 Thread Prof Brian Ripley
On Mon, 20 Jun 2011, rivercode wrote: Hi, When I am editing a command using default R console in Linux, sometimes it is going into "vi mode"...not too sure how/why this happening. It then requires me to use vi commands to edit the line, which is very frustrating when I just want to use the del

Re: [R] giving factor names

2011-06-20 Thread Deepayan Sarkar
On Fri, Jun 10, 2011 at 10:27 PM, Ethan Brown wrote: > Hi Kieran, > > I'm not very familiar with lattice, but here's a workaround that works for > me. Basically, I just created a new data.frame column that was a factor > (combo$zf), and forced its levels to be what you're looking for here. This w

Re: [R] xyplot Legend Title and Position

2011-06-20 Thread Deepayan Sarkar
On Wed, Jun 15, 2011 at 6:32 PM, Justin McBride wrote: > Dennis, > > Thanks for your suggestion, but that is not exactly what I was after. > I was trying to get the legend in the margin on the top right of the > page and not in the plot frame.  Is there a way to do this? One option is: xyplot(Yi

Re: [R] function to undo the DIFF command in ARIMA command

2011-06-20 Thread Jeff Newmiller
cumsum, but you have to add back the information lost in the diff operation by generating an extra zero at the beginning or end of the sequence and adding the appropriate offset to the resulting vector. --- Jeff Newmiller The

[R] optimize weights for a weighted average?

2011-06-20 Thread Seth
Hi, I have a simple problem where I have two or more predictor variables that range from 0 to 1 and binary response variable (0 or 1). In the two variable case, the model to fit with maximum likelihood would simply be: P(Y=1) = (B1*X1 + B2*X2)/(B1+B2) or if least squares is to be minimized

Re: [R] omitting columns from a data frame

2011-06-20 Thread Joshua Wiley
On Mon, Jun 20, 2011 at 8:55 PM, Erin Hodgess wrote: > Too funny! > > how about subset? Sure, that is one option. Each of the following will also work. The ones wrapped with c() can easily omit more than one at a time. mtcars[, -which(names(mtcars) == "drat")] mtcars[, names(mtcars) != "drat"]

[R] function to undo the DIFF command in ARIMA command

2011-06-20 Thread Flávio Fagundes
Hi users. I'm new user in R. I'm workiing with Time series and I would like to know how can I do to undo the command DIFF(X), for exemple: If I have the model: m=arima(X, order=c(0,1,1), seasonal=list(order=c(0,0,1))) (note that have d=1 one difference), to find, in the same scale, the original num

Re: [R] omitting columns from a data frame

2011-06-20 Thread Ista Zahn
Hi Erin, As you've seen from the responses so far there are many ways to do it. I like to do xm1[setdiff(names(xm1), c("x1", "x2", ...))] where xm1 is the data.frame, and "x1", "x2", ... are the columns you wish to exclude. Just another option. Best, Ista On Mon, Jun 20, 2011 at 11:52 PM, Joshua

Re: [R] (no subject)

2011-06-20 Thread Ethan Brown
Hi Ungku, your error is in your call to lda.default; the object that you want to plot, lda_result, is thus not created and cannot be plotted. The error you're getting with LDA doesn't look to be a coding error, but a statistical one. I don't know anything about LDA, but simply googling "variablest

Re: [R] omitting columns from a data frame

2011-06-20 Thread Joshua Wiley
Hi Erin, See inline. On Mon, Jun 20, 2011 at 8:45 PM, Erin Hodgess wrote: > Dear R People: > > I have a data frame, xm1, which has 12 rows and 4 columns. > > If I put is xm1[,-4], I get all rows, and columns 1 - 3, which is as > it should be. Okay, so you know how to use the column number to om

Re: [R] omitting columns from a data frame

2011-06-20 Thread Jorge Ivan Velez
Hi Erin, One option woild be subset(), especially the "select" parameter. HTH, Jorge On Mon, Jun 20, 2011 at 11:45 PM, Erin Hodgess <> wrote: > Dear R People: > > I have a data frame, xm1, which has 12 rows and 4 columns. > > If I put is xm1[,-4], I get all rows, and columns 1 - 3, which is as

[R] omitting columns from a data frame

2011-06-20 Thread Erin Hodgess
Dear R People: I have a data frame, xm1, which has 12 rows and 4 columns. If I put is xm1[,-4], I get all rows, and columns 1 - 3, which is as it should be. Now, is there a way to use the names of the columns to omit them, please? Thanks so much in advance! Sincerely, Erin -- Erin Hodgess A

[R] Re; Getting SNPS from PLINK to R

2011-06-20 Thread Jim Silverton
I a using plink on a large SNP dataset with a .map and .ped file. I want to get some sort of file say a list of all the SNPs that plink is saying that I have. ANyideas on how to do this? -- Thanks, Jim. [[alternative HTML version deleted]] __

[R] Regression evaluation

2011-06-20 Thread Yang Zhang
Are there any utilities/packages for showing various performance metrics of a regression model on some labeled test data? Basic stuff I can easily write like RMSE, R-squared, etc., but maybe with some extra utilities for visualization, or reporting the distribution of prediction confidence/varianc

[R] plot error bars on skyline plot

2011-06-20 Thread Andra Tolbus
Hi, I have generated a skyline plot of a tree in newick format using "ape". How can I plot the error bars for this graph? I only have the the tree data. un<-"8.1:0, 20.1:0):0, 6.1:3):123, (35.1:0, (22.1:0, (43.1:1, 29.1:0):0):0):4, 25.1:6):0, ((42.1:0, 21.1:0):3, (39.1:0, 2.1:0):

Re: [R] Stepwise model comparisons for mlogit

2011-06-20 Thread Joshua Wiley
Hi Louis, It seems to me that the easiest way to accomplish what you want is to just define an extractAIC method for objects of class "mlogit". I am not familiar with multinomial logistic models, so this may not be correct (I am especially uncertain about the degrees of freedom I used), but it sh

Re: [R] and now a "cut" question

2011-06-20 Thread Joshua Wiley
Look at the documentation for ?cut, specifically the dig.lab argument: cut(xm1, 4, dig.lab = 5) Cheers, Josh On Mon, Jun 20, 2011 at 5:46 PM, Erin Hodgess wrote: > Hello again R People: > > I have the following: > >> xm1[,1] >  [1] 13053 13068 13068 13053 14853 14853 14850 14850 13053 13053 13

[R] and now a "cut" question

2011-06-20 Thread Erin Hodgess
Hello again R People: I have the following: > xm1[,1] [1] 13053 13068 13068 13053 14853 14853 14850 14850 13053 13053 13068 13068 > cut(xm1[,1],4) [1] (1.31e+04,1.35e+04] (1.31e+04,1.35e+04] (1.31e+04,1.35e+04] [4] (1.31e+04,1.35e+04] (1.44e+04,1.49e+04] (1.44e+04,1.49e+04] [7] (1.44e+04,1.49

Re: [R] setting breaks in hist

2011-06-20 Thread Bill.Venables
The way to guarantee a specific number of panels in the histogram, say n, is to specify n+1 breaks which cover the range of the data. As far as I know this is the only way. Bill Venables. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Be

[R] setting breaks in hist

2011-06-20 Thread Erin Hodgess
Dear R People: Is there a way to "guarantee" that breaks=n will give you exactly n breaks, please? I'm fairly certain that the answer is "no", but thought I'd check. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downt

[R] Mixed model for count data?

2011-06-20 Thread Chun (Jimmie) Ye
Hi all, I have a rather peculiar dataset that I'm not sure how to model properly. This is data from an instrument that measures the size of particles but instead of giving a continuous value, it generates a "histogram" of the counts for a particular bin size. So the data looks like this:

Re: [R] access objects by name

2011-06-20 Thread jim holtman
for (thisOne in structs){ print(get(thisOne)$colA) } you need to 'get' (retrieve) the object first. On Mon, Jun 20, 2011 at 5:18 PM, Noah Silverman wrote: > Hi, > > I have several data structures (xts structures).  I then have a list of the > names of those objects. > > I'd like to access t

Re: [R] Unreasonable syntax error

2011-06-20 Thread Bill.Venables
The advice is always NOT to use Microsoft Word to edit an R file. That stuff is poisonous. Microsoft word, typical of all Microsoft software, does not do what you tell it to do but helpfully does what it thinks you meant to ask it to do but were too dumb to do so. Even notepad, gawdelpus, wou

Re: [R] Unreasonable syntax error

2011-06-20 Thread Ray Brownrigg
On Tue, 21 Jun 2011, james198877 wrote: > http://r.789695.n4.nabble.com/file/n3612530/PSC.r PSC.r > > Hi all, > > I just wrote a program in R by editing it in Microsoft Word and then > pasting into the text editor of R. The above is the file. > > And below is what the console complains Why d

[R] Unreasonable syntax error

2011-06-20 Thread james198877
http://r.789695.n4.nabble.com/file/n3612530/PSC.r PSC.r Hi all, I just wrote a program in R by editing it in Microsoft Word and then pasting into the text editor of R. The above is the file. And below is what the console complains Why doesn't it recognise 'r'?? I have to mention that at le

[R] access objects by name

2011-06-20 Thread Noah Silverman
Hi, I have several data structures (xts structures). I then have a list of the names of those objects. I'd like to access the object by name. For example: foo1 <- as.xts() foo2 <- as.xts(...) foo3 <- as.xts(...) structs <- c("foo1", "foo2", "foo3") for (thisOne in structs){ prin

Re: [R] Trouble with Optimization in "Alabama" Package

2011-06-20 Thread mcgrete
Hello all, I was in direct email contact with Ravi, who was very kind to offer his assistance. Inbetween correspondence with Ravi, I arrived at a solution. In case others have the same issue, I am sharing the solution. Thanks Ravi for your willingness to help. Regards, Tim **

Re: [R] profile plot in R

2011-06-20 Thread Vickie S
Hi Dennis and all friends, After upgrading to R 2.11.1, I managed to work this out perfectly. I also added group information here, since I wanted to color code the profiles according to the groups they were assigned to. library("reshape") library("ggplot2") sampledata <- matrix(c(1.002, 1.76,

Re: [R] for loop and linear models

2011-06-20 Thread Dennis Murphy
Hi: (a) What Brian said... (b) Here's one way to generate a list of model objects from which you can extract the pieces you may want. # Generate a fairly minimal, reproducible data set set.seed(345) # makes results below reproducible dd <- data.frame(X = rnorm(100), Y = rnorm(100),

Re: [R] (no subject)

2011-06-20 Thread Ethan Brown
Hi Ungku, it's really difficult for us to take a huge block of code and understand where an error happened. There's several things that can help us help you: 1) First and foremost, what is the error message or undesired behavior you're experiencing? 2) Second, please pare down the code to the plac

Re: [R] Can mathematical formula be used in the help file of a R function or package?

2011-06-20 Thread Rolf Turner
On 21/06/11 06:52, Runlong Tang wrote: Hi everyone, I am writing help files for some R functions in an R package. I am wondering if we can use the Latex mathematical formula when editing those *.Rd files and then obtain a pdf manual with beautiful mathematical formula. I tried it with the defa

Re: [R] importing a file

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 5:16 PM, Alina Sheyman wrote: I haven't used R in a couple of years, and now am trying something as simple as importing a csv file and am running into problems right away. * mydata <- read.csv (Wordata1.csv, sep="") Error in read.table(file = file, header = header, sep =

Re: [R] General Plotting Commands Help

2011-06-20 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Monday, June 20, 2011 2:07 PM > To: Deepfish > Cc: r-help@r-project.org > Subject: Re: [R] General Plotting Commands Help > > ... much elided ... > > Most

Re: [R] matrix problem

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 3:54 PM, Costis Ghionnis wrote: Hallo everyone! I have a problem about creating a matrix... Suppose we have a vector y<-c(1,1,1,3,2) and a zero matrix, m ,with nrows=length(y) and ncol=4. The matrix would look like this: 0 0 0 0 0 0 0 0

Re: [R] importing a file

2011-06-20 Thread Alina Sheyman
that was it, thank you!!! On Mon, Jun 20, 2011 at 5:23 PM, Sarah Goslee wrote: > R is looking for an R object named Wordata1.csv that contains your file > name. > > Instead you want: > mydata <- read.csv ("Wordata1.csv", sep="") > > Sarah > > On Mon, Jun 20, 2011 at 5:16 PM, Alina Sheyman wrote:

Re: [R] importing a file

2011-06-20 Thread Sarah Goslee
R is looking for an R object named Wordata1.csv that contains your file name. Instead you want: mydata <- read.csv ("Wordata1.csv", sep="") Sarah On Mon, Jun 20, 2011 at 5:16 PM, Alina Sheyman wrote: > I haven't used R in a couple of years, and now  am trying something as > simple as importing

Re: [R] importing a file

2011-06-20 Thread Richard M. Heiberger
You probably left off the quotes for the file name mydata <- read.csv ("Wordata1.csv", sep="") it is looking for an R variable named Wordata1.csv which contains the name of the file. Since you are giving it the name of the file, it must be in a character-valued constant. On Mon, Jun 20, 2011 at 5

Re: [R] matrix problem

2011-06-20 Thread Sarah Goslee
How about: y <- c(1,1,1,3,2) m <- matrix(0, nrow=length(y), ncol=4) m[y==1, ] <- matrix(1:4, nrow=sum(y == 1), ncol=4, byrow=TRUE) or, depending on your actual problem y <- c(1,1,1,3,2) m <- matrix(0, nrow=length(y), ncol=4) m[y == 1,] <- col(m[y == 1,]) Sarah On Mon, Jun 20, 2011 at 3:54 PM,

[R] importing a file

2011-06-20 Thread Alina Sheyman
I haven't used R in a couple of years, and now am trying something as simple as importing a csv file and am running into problems right away. * mydata <- read.csv (Wordata1.csv, sep="") Error in read.table(file = file, header = header, sep = sep, quote = quote, : object 'Wordata1.csv' not found

[R] AUC calculated from Epi package

2011-06-20 Thread array chip
Hi, I have a dataset (see attached) with 2 variables "Y" is binary, "x" is a continuous variable. I want to calculate area under the curve (AUC) for the ROC curve, but I got different AUC values using ROC() from Epi package vs. rcorr.cens() from rms package: test<-read.table("test.txt",sep='\t'

Re: [R] General Plotting Commands Help

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 4:52 PM, Deepfish wrote: I am rather new to R and struggling with the syntax. I am trying to do simple plots and I can't get anything but errors. Specifically, I would like to know how to plot 3D scatterplots and using polar coordinates. So far I've tried installing the

[R] RES: for loop and linear models

2011-06-20 Thread Filipe Leme Botelho
--- Begin Message --- Ivan, try this d1 <- matrix(rnorm(10),50,50) d2 <- matrix(rnorm(10),50,50) regs <- lapply(1:ncol(d1), function(i) lm(d1[,i] ~ d2[,i]) HTH, Filipe -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de ivan Enviada

[R] matrix problem

2011-06-20 Thread Costis Ghionnis
Hallo everyone! I have a problem about creating a matrix... Suppose we have a vector y<-c(1,1,1,3,2) and a zero matrix, m ,with nrows=length(y) and ncol=4. The matrix would look like this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

[R] Stepwise model comparisons for mlogit

2011-06-20 Thread Merlin, Louis
I am trying to perform a backwards stepwise variable selection with an mlogit model. The usual functions, step(), drop1(), and dropterm() do not work for mlogit models. Update() works but I am only able to use it manually, i.e. I have to type in each variable I wish to remove by hand on a se

[R] Can mathematical formula be used in the help file of a R function or package?

2011-06-20 Thread Runlong Tang
Hi everyone, I am writing help files for some R functions in an R package. I am wondering if we can use the Latex mathematical formula when editing those *.Rd files and then obtain a pdf manual with beautiful mathematical formula. I tried it with the default R CMD check command but could not ge

[R] General Plotting Commands Help

2011-06-20 Thread Deepfish
I am rather new to R and struggling with the syntax. I am trying to do simple plots and I can't get anything but errors. Specifically, I would like to know how to plot 3D scatterplots and using polar coordinates. So far I've tried installing the scatterplot3D package and have copied and pasted exa

[R] Vi mode in Linux console - how to stop it ?

2011-06-20 Thread rivercode
Hi, When I am editing a command using default R console in Linux, sometimes it is going into "vi mode"...not too sure how/why this happening. It then requires me to use vi commands to edit the line, which is very frustrating when I just want to use the delete key instead of "x" to delete a charac

Re: [R] for loop and linear models

2011-06-20 Thread Brian Diggs
On 6/20/2011 12:23 PM, ivan wrote: Hi, I have two datasets, x and y. Simplified x and y denote: X Y A B C A B C . . . . . . . . . . . . . . . . . . I want to implement all possible models such as lm(X$A~Y$A), lm(X$B~Y$B), lm(X$C~Y$C)... I have tried the following: fun<- function(x,y){

Re: [R] for loop and linear models

2011-06-20 Thread William Dunlap
Your suggestion would have it return after fitting the first model, which is not what the OP wants. The basic problem is that models <- list(lm(...)) replaces the old value of models with a new length-1 list. You want to add the new fitted model to the list of fitted models. E.g., models

Re: [R] searching through two different texts files to find a common variable

2011-06-20 Thread Daniel Malter
You probably want to use the merge() function. imaginary example for data frames named "KS" and "US," where the common identifier variable is named "ID" merged.data<-merge(KS,US,by.x="ID",by.y="ID",all.x=F,all.y=F) Note that this will retain only observations for which there is a common ID in b

Re: [R] for loop and linear models

2011-06-20 Thread Daniel Malter
To be more accurate and helpful, try this: fun<- function(x,y){ for(i in 1:length(colnames(x))){ for(j in 1:length(colnames(y))){ if(colnames(x)[i]==colnames(y)[j]){ models=list(lm(ts(x[i])~ts(y[j]))) return(models)

Re: [R] for loop and linear models

2011-06-20 Thread Daniel Malter
Hi, can you put "return(models)" within the inner braces and report what it does. That might do the trick, since it should return the 'models' for every combination of i and j. HTH, Daniel hazzard wrote: > > Hi, > > I have two datasets, x and y. Simplified x and y denote: > > X > > Y > >

Re: [R] profile plot in R

2011-06-20 Thread Brian Diggs
On 6/20/2011 11:25 AM, Vickie S wrote: Hi Dennis, It looks like something is wrong about configuration of ggplot dependency with plyr.Since i saw some threads about this particular error message. I tried several times by installing different versions of plyr but it did not work. sa

[R] for loop and linear models

2011-06-20 Thread ivan
Hi, I have two datasets, x and y. Simplified x and y denote: X Y A B C A B C . . . . . . . . . . . . . . . . . . I want to implement all possible models such as lm(X$A~Y$A), lm(X$B~Y$B), lm(X$C~Y$C)... I have tried the following: fun<- function(x,y){ for(i in 1:length(colnames

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 1:31 PM, albeam wrote: > Hi everyone, > > Thank you for the help, I apologize for not "providing commented, minimal, > self-contained, reproducible code." I was looking for some pointers about > how to do this in general, but it would have been helpful for me to post a > sp

Re: [R] Tell R where to look locally for library?

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 2:38 PM, Idris Raja wrote: I have R library's installed in several places on my windows machine. They are in: 1) C:\Program Files\R\R-2.12.2\library 2) C:\Users\MyUser\Documents\R\win-library\2.12 I can access a library from either location with RStudio, but I can't acc

[R] dynlm question

2011-06-20 Thread Dave Evens
Dear All, I'm trying to use dynlm to fit a time series. I have 3 seasonal terms. Here is an example of the problem. This is my time variable, hourly data: timeSeries <- seq(as.POSIXct("2011-01-01 00:00:00"), as.POSIXct("2011-12-31 23:00:00"), by="hour") My response is: y <- rnorm(length(

Re: [R] Model Formulae Evaluation

2011-06-20 Thread albeam
Hi everyone, Thank you for the help, I apologize for not "providing commented, minimal, self-contained, reproducible code." I was looking for some pointers about how to do this in general, but it would have been helpful for me to post a specific example. Anyway, after the feedback this is the solu

[R] Tell R where to look locally for library?

2011-06-20 Thread Idris Raja
I have R library's installed in several places on my windows machine. They are in: 1) C:\Program Files\R\R-2.12.2\library 2) C:\Users\MyUser\Documents\R\win-library\2.12 I can access a library from either location with RStudio, but I can't access a library from 2) when using R from the command l

Re: [R] Vim-R-Plugin issue : Python interface must be enabled to run Vim-R-Plugin

2011-06-20 Thread Idris Raja
As a follow up to my own question, the problem was with my version of vim. I needed vim 7.3, was using 7.2. I updated and it works as expected. Just make sure your version of python matches the version of pywin you install if on windows. On Fri, Jun 17, 2011 at 6:51 PM, Idris Raja wrote: > I am

Re: [R] Accessor functions in lattice graphics

2011-06-20 Thread Deepayan Sarkar
On Mon, Jun 20, 2011 at 9:22 PM, David Winsemius wrote: > > On Jun 20, 2011, at 10:49 AM, Bert Gunter wrote: > >> Hi all: >> >> Thanks, David. This is a good example of knowledgeable "R forensic >> investigation." I leave it to Frank whether it meets his criteria. >> >> However, I would argue that

Re: [R] profile plot in R

2011-06-20 Thread Vickie S
Hi Dennis, It looks like something is wrong about configuration of ggplot dependency with plyr.Since i saw some threads about this particular error message. I tried several times by installing different versions of plyr but it did not work.  sampledata= matrix(c(1.002, 1.76, 0.67, 0.99

Re: [R] Quick R syntax question

2011-06-20 Thread Ben Ganzfried
Thanks for the clarifications. On Mon, Jun 20, 2011 at 12:40 PM, Bert Gunter wrote: > Sorry, I was unclear. The comment after the second should be: > > z[ ,a] # the column of z whose name is the value of the object a > > -- Bert > > On Mon, Jun 20, 2011 at 9:38 AM, Bert Gunter wrote: > > Ben:

[R] Quick Question on RPut

2011-06-20 Thread Filipe Leme Botelho
Hi all, I need to know two quick things regarding RPut function from RExcel. 1/ How to assign colnames and rownames in the command, i.e., something like '=RPut("example"; A10:F50; rownames=TRUE; colnames=TRUE)'. 2/ When I use RPut and I have NAs in Excel selection, the entire matrix is coerced

Re: [R] different results from nls in 2.10.1 and 2.11.1

2011-06-20 Thread Prof. John C Nash
Interesting! I get nice convergence in both 32 and 64 bit systems on 2.13.0. I agree the older versions are a bit of a distraction. The inconsistent behaviour on current R is a concern. Maybe Philip, Uwe, and I (and others who might be interested) should take this off line and see what is going

Re: [R] Quick R syntax question

2011-06-20 Thread Bert Gunter
Sorry, I was unclear. The comment after the second should be: z[ ,a] # the column of z whose name is the value of the object a -- Bert On Mon, Jun 20, 2011 at 9:38 AM, Bert Gunter wrote: > Ben: > > 1. One doesn't ask questions like this. Syntax is syntax. > > 2. This has nothing to do with p

Re: [R] Quick R syntax question

2011-06-20 Thread Luke Miller
The quotes around 'Major.Gleason' and 'Minor.Gleason' are required for accessing data frame columns by name. You could alternately refer to the columns by number if you're sure you know which column is which: > output = paste(df[ ,1], df[ ,2], sep = '+') It's just a requirement for accessing thin

Re: [R] Quick R syntax question

2011-06-20 Thread Bert Gunter
Ben: 1. One doesn't ask questions like this. Syntax is syntax. 2. This has nothing to do with paste; it's the syntax of "[" , subscripting/extraction 3. But it does make sense: a <- "b" z <- data.frame(a=1:3, b=4:6) z[ ,"a"] # the "a" column of z z[ ,a] # the column of z with the value of th

Re: [R] Quick R syntax question

2011-06-20 Thread Ben Ganzfried
Thanks! Very glad you pointed me to the paste function, it looks very helpful. I have a quick follow-up after reading through the online tutorial on the "paste" function: Why do we need quotation marks around "Major Gleason" and "Minor Gleason" in: output = paste(df [,'Major.Gleason'], df[ ,'Mi

Re: [R] About GAM in R, Need YOUR HELP!

2011-06-20 Thread pigpigmeow
Actually, I 'm using "mgcv" package. But I learnt basic linear regression in my school, it is really hard for me to handle these problem! by the way, i need to work harder! -- View this message in context: http://r.789695.n4.nabble.com/About-GAM-in-R-Need-YOUR-HELP-tp3610522p3611796.html Sent f

Re: [R] Quick R syntax question

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 11:47 AM, Luke Miller wrote: If we assume that your data are in a data frame (which doesn't allow spaces in column names, hence the periods in the call below): df = data.frame(Major.Gleason = c(4,5,2,3), Minor.Gleason = c(3,2,4,3)) You can paste together the contents of

Re: [R] Accessor functions in lattice graphics

2011-06-20 Thread David Winsemius
On Jun 20, 2011, at 10:49 AM, Bert Gunter wrote: Hi all: Thanks, David. This is a good example of knowledgeable "R forensic investigation." I leave it to Frank whether it meets his criteria. However, I would argue that that this is bad practice and quite unwise. In general, these details are

Re: [R] Quick R syntax question

2011-06-20 Thread Luke Miller
If we assume that your data are in a data frame (which doesn't allow spaces in column names, hence the periods in the call below): >df = data.frame(Major.Gleason = c(4,5,2,3), Minor.Gleason = c(3,2,4,3)) You can paste together the contents of the two columns with a plus sign in between using the

Re: [R] Accessor functions in lattice graphics

2011-06-20 Thread Frank Harrell
Thanks very much Bert and David. I was looking for an approach that would use objects that are active while the panel function was being executed. Perhaps which.packet is the best way to go, e.g. if using y ~ x | a*b, fetch levels(b)[which.packet()[2]] from the environment in which b is defined.

[R] Quick R syntax question

2011-06-20 Thread Ben Ganzfried
Hi -- I had a pretty quick R question since unfortunately I have not been able to find an answer on Google. It shouldn't take much more than a minute to answer. I'm trying to add up the major gleason grade and minor gleason grade for an analysis of patients with prostate cancer. One column has

[R] ade4 package

2011-06-20 Thread Oana Tomescu
Dear list, I am using the plot.coinertia function from the ade4 package. Can someone tell me if it is possible to change the label size in the upper, right plot? My RV value is so high that the arrows become shorter than the labels. Thank you for your help. Oana Tomescu -- Dipl.-Ing. Oana T

Re: [R] Accessor functions in lattice graphics

2011-06-20 Thread Bert Gunter
Hi all: Thanks, David. This is a good example of knowledgeable "R forensic investigation." I leave it to Frank whether it meets his criteria. However, I would argue that that this is bad practice and quite unwise. In general, these details are implementation dependent and could change. Yes, they

Re: [R] fonts and locale complaints from plot

2011-06-20 Thread Jeff Newmiller
This does not seem like a core R issue... at best it would be relevant on the R Debian special interest group mailing list (https://stat.ethz.ch/mailman/listinfo/r-sig-debian). However, using your system software installation tools to make sure you have installed relevant font packages for X se

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 9:46 AM, Gabor Grothendieck wrote: > On Mon, Jun 20, 2011 at 9:08 AM, albeam wrote: >> Please allow me to clarify my original question. What I really need to be >> able to do it is to take arbitrary functions and evaluate them for arbitrary >> parameter values. I'm doing t

Re: [R] profile plot in R

2011-06-20 Thread Dennis Murphy
Hi: Typically a profile plot is a plot over time for each of n subjects (aka a 'spaghetti plot'). Here's a revision of your code to yield a profile plot in ggplot2, although it's not clear for what the grouping variable is meant. sampledata= matrix(c(1.002, 1.76, 0.67, 0.99, 1.38, 1.0, 0.5, 0.78,

[R] Activity budgets with multiple proportions as response

2011-06-20 Thread Asa Johannesen
Hi everyone, I've searched the internet and lots of stats books high and low for this one, but nothing seems to be quite what I want. I've got continuous data on four different state activities recorded in seconds, however each continuous session is not equally long, so the data are best expres

Re: [R] Using MCMC sampling to estimate p values with a mixed model

2011-06-20 Thread ps0u5145
Hi, Thank you for the replies. Yes I would say it does resemble a randomized block design in that each person completed 4 out of a possible 16 versions/conditions of the vignette. There was approximately 20 responses in each condition. The commands I have been using are; modela <-lmer(DV ~ IV*I

Re: [R] Accessor functions in lattice graphics

2011-06-20 Thread David Winsemius
Frank Harrell wrote: > > I know about the current.row, current.column, and panel.number functions > that are useful within panel functions written for lattice. Are there > easy ways to obtain the names of the conditioning variables (those > appearing after |) and their values for the current pan

Re: [R] For loop by factor.

2011-06-20 Thread Sarah Goslee
Chris, This doesn't cover all possible cases, but does work for your example. It should be enough for you to tweak for your actual data. diffsum <- function(x) { # first identify the decreasing values # and the difference between increasing values xdif <- x[2:length(x)] -

Re: [R] Elbow criterion

2011-06-20 Thread Matt Shotwell
On Mon, 2011-06-20 at 13:38 +0200, Dominik P.H. Kalisch wrote: > Hi, > > I would like to cluster a dataset with the ward algorithm. I'm assuming that this refers to the agglomerative partitioning method [1]. That is, the number of clusters is selected according to the data partition that is seque

Re: [R] Model Formulae Evaluation

2011-06-20 Thread peter dalgaard
On Jun 20, 2011, at 15:08 , albeam wrote: > Please allow me to clarify my original question. What I really need to be > able to do it is to take arbitrary functions and evaluate them for arbitrary > parameter values. I'm doing the optimization myself, so I need to be able to > take a user's funct

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 9:08 AM, albeam wrote: > Please allow me to clarify my original question. What I really need to be > able to do it is to take arbitrary functions and evaluate them for arbitrary > parameter values. I'm doing the optimization myself, so I need to be able to > take a user's f

[R] Possible amendment to 'Writing R extensions' [was 'Porting "unmaintained" packages to post R 2.10.0 era']

2011-06-20 Thread Stephen Ellison
Dear Uwe, > If you think the relevant section is not sufficient, it's > your turn to provide a short and precise suggestion for a > change, preferable a diff against the R-devel sources. That > way you may be able to convince an R Core member to work on it. I would be more than happy to rearra

Re: [R] Error of Cross Validation

2011-06-20 Thread Dennis Murphy
Hi: I was curious to see how to do this. I generated two versions of the same function - one for 10-fold predictions when the number of observations is an exact multiple of 10, returning a matrix, and another that lets the user define the number of folds and works with lists. The function also ret

Re: [R] Can I disable Cairo?

2011-06-20 Thread Prof Brian Ripley
See the help page! type: character string, one of ‘"Xlib"’ or ‘"quartz"’ (some Mac OS X builds) or ‘"cairo"’. The latter will only be available if the system was compiled with support for cairo - otherwise ‘"Xlib"’ will be used. The default is set by

[R] fonts and locale complaints from plot

2011-06-20 Thread Hong Yu
I wish for help for the following issue with GNU R. I have on my Ubuntu-Linux-10.04-LTS built R-2.13.0 from source these days. After I launched the R interactive console, the plot() etc. graphics functions reported the following errors: -- could not find any X11 fonts -- locale not supported

[R] X11-fonts and X-locale related complaints from plot() function

2011-06-20 Thread Hong Yu
I wish for help for the following issue with GNU R. I have on my Ubuntu-Linux-10.04-LTS built R-2.13.0 from source these days. After I launched the R interactive console, the plot() etc. graphics functions reported the following errors: -- could not find any X11 fonts -- locale not supported

Re: [R] Model Formulae Evaluation

2011-06-20 Thread albeam
Please allow me to clarify my original question. What I really need to be able to do it is to take arbitrary functions and evaluate them for arbitrary parameter values. I'm doing the optimization myself, so I need to be able to take a user's function and evaluate them at the current parameter value

Re: [R] different results from nls in 2.10.1 and 2.11.1

2011-06-20 Thread Mike Marchywka
> Date: Mon, 20 Jun 2011 11:25:54 +0200 > From: lig...@statistik.tu-dortmund.de > To: p.e.b...@dunelm.org.uk > CC: r-help@r-project.org; pb...@astro.uni-bonn.de > Subject: Re: [R] different results from nls in 2.10.1 and 2.11.1 > > Since one is a 32-bit and the other one a 64-bit, and therefore t

[R] help: X11-fonts and X-locale related complaints from plot() function

2011-06-20 Thread Hong Yu
I wish for help for the following issue with GNU R. I have on my Ubuntu-Linux-10.04-LTS built R-2.13.0 from source these days. After I launched the R interactive console, the plot() etc. graphics functions reported the following errors: -- could not find any X11 fonts -- locale not supported

Re: [R] profile plot in R

2011-06-20 Thread Vickie S
Hi thanks for the help. Here is the error message i got. I could not figure out what goes wrong here. == require(ggplots2) sampledata=data.frame(c(1.002, 1.76, 0.67, 0.99), c(1.38,1.0,0.5, 0.78), c(1.003,0.57,0.99, 0.58),c(0.76,1.23, 1.45, .78), c(1.43, 1.34, 1.0, 0.9)) rownames(sampledat

  1   2   >