Re: [R] Simple question, name of the variable as string.

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 2:54 AM, C.H. wrote: Dear R users, I have a very simple question and I've tried to search for the answer. (But failed.) there should be a function (func) that work like abc <- c(1,2,3,4) func(abc) "abc" > func <- function(xyz) deparse(substitute(xyz)) > func(abc) [1]

Re: [R] R Founding

2010-09-17 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/09/10 08:38, Peter Dalgaard wrote: > On 09/17/2010 12:14 AM, Jeremy Miles wrote: >>> I know from organizing a conference in Germany that the only really good way >>> was and is ordinary money transfer via BIC and IBAN numbers. Unfortunately, >>>

Re: [R] Simple question, name of the variable as string.

2010-09-17 Thread Barry Rowlingson
On Fri, Sep 17, 2010 at 7:54 AM, C.H. wrote: > Dear R users, > > I have a very simple question and I've tried to search for the answer. > (But failed.) > > there should be a function (func) that work like > >> abc <- c(1,2,3,4) >> func(abc) > "abc" > > I would like to know the name of that functio

[R] R Founding

2010-09-17 Thread R P Herrold
On Fri, 17 Sep 2010, Peter Dalgaard wrote: On 09/17/2010 12:14 AM, Jeremy Miles wrote: As far as I remember, this requires that a real person opens the account, and takes on the associated tax issues. It may be different for US-based projects. Nope -- all around the world, the governments

[R] Markov Model problem

2010-09-17 Thread Stefan Petersson
First, I don't have the correct lingo for this topic, so I can't really find a solution for my problem. And maybe I formulate it incorrectly, so bear with me. How would I calculate a 'constant transition matrix' if I know a given value at a given time? Let's say I know that my value is 54,0

Re: [R] Help with customizing a histogram figure

2010-09-17 Thread Jim Lemon
On 09/16/2010 11:40 PM, Josh B wrote: Hi all, Please consider the following code: require(plotrix) l<- list(rnorm(50),rnorm(50,sd=2),rnorm(50,mean=3)) multhist(l) I have two things I need help with: (1) In the output, there are empty spaces on the x-axis. How would I eliminate these spaces?

Re: [R] Markov Model problem

2010-09-17 Thread Ted Harding
On 17-Sep-10 08:19:20, Stefan Petersson wrote: > First, I don't have the correct lingo for this topic, so I can't > really find a solution for my problem. And maybe I formulate it > incorrectly, so bear with me. > > How would I calculate a 'constant transition matrix' if I know a > given value at

Re: [R] R Founding

2010-09-17 Thread Marianne Promberger
Hi, > I would GLADLY donate 30-50$ each year just to see R develop, but there > needs to be a way for me to do it in a civilized manner. If the userbase of > R is over 2 million there will surely be 100,000 users who, like myself, > will happily fork out 40$ a year - would that help? you can d

Re: [R] Interpolate? a line

2010-09-17 Thread Alaios
I would like to thank you again for your help. But it seems that the floor function (ceiling, round too) create more dots in the matrix that line really "touches". unique( floor( cbind( seq(2,62, by=0.1), linefn(seq(2,62, by=0.1)) ) ) ) You can see that in the picture below http://yfrog.com/5

Re: [R] using variable from for loop in naming new variables

2010-09-17 Thread Ivan Calandra
Hi Jim, First, I think it's better if you reply to the list, other users might be interested and have better answers. Second, as other replies showed you, using a list is actually way easier than creating new objects every time. Check especially the reply from Joshua Wiley, which gives you g

Re: [R] Interpolate? a line

2010-09-17 Thread Michael Bedward
I think that's because of your definition for "touches". If I read it correctly, David's code assumes that a "cell" is a square 1 unit wide and then followed the normal geometric definition of "touches", ie. the line intersects with at least one point on the cell's boundary. You seem to have a di

Re: [R] Odp: Programming: loop versus vector oriented

2010-09-17 Thread Petr PIKAL
Hi Jan Jan private napsal dne 17.09.2010 12:43:40: > Hello Petr, > > > but I think this is how your code really works. Did you try it? > > it does, but the R documentation says somewhere: > "Warning: for() loops are used in R code much less often than in > compiled languages. Code that takes a

[R] count frequency

2010-09-17 Thread Alaios
Hello everyone, please consider the following lines of a matrix [574,] 59 32 [575,] 59 32 [576,] 59 32 [577,] 59 32 [578,] 59 32 [579,] 59 32 [580,] 59 32 [581,] 60 32 [582,] 60 33 [583,] 60 33 [584,] 60 33 [585,] 60 33 [586,] 60 33 [587,] 60

Re: [R] count frequency

2010-09-17 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/09/10 14:19, Alaios wrote: > Hello everyone, > please consider the following lines of a matrix > > > [574,] 59 32 > [575,] 59 32 > [576,] 59 32 > [577,] 59 32 > [578,] 59 32 > [579,] 59 32 > [580,] 59 32 > [581,] 6

Re: [R] Odp: Programming: loop versus vector oriented

2010-09-17 Thread Jan private
Hello Petr, > but I think this is how your code really works. Did you try it? it does, but the R documentation says somewhere: "Warning: for() loops are used in R code much less often than in compiled languages. Code that takes a `whole object' view is likely to be both clearer and faster in R."

Re: [R] count frequency

2010-09-17 Thread Henrique Dallazuanna
Try this: aggregate(rep(1, nrow(x)), x, sum) On Fri, Sep 17, 2010 at 9:19 AM, Alaios wrote: > Hello everyone, > please consider the following lines of a matrix > > > [574,] 59 32 > [575,] 59 32 > [576,] 59 32 > [577,] 59 32 > [578,] 59 32 > [579,] 59 32 > [580,] 59 3

Re: [R] count frequency

2010-09-17 Thread Ted Harding
On 17-Sep-10 12:19:10, Alaios wrote: > Hello everyone, > please consider the following lines of a matrix > > [574,] 59 32 > [575,] 59 32 > [576,] 59 32 > [577,] 59 32 > [578,] 59 32 > [579,] 59 32 > [580,] 59 32 > [581,] 60 32 > [582,] 60 33 > [583,] 60 33 >

[R] ifelse statement

2010-09-17 Thread n.via...@libero.it
Dear list, I have a question I'm trying to use the following command in R, but it gives me an error message.The command is: data<-ddply(data,c("year","name"), transform, check1=ifelse(check1==1 & check2==1, 1,NULL)) so in my data frame I already have the check1 variable, if the conditions (che

Re: [R] Survival Analysis Daily Time-Varying Covariate....

2010-09-17 Thread Terry Therneau
Help! I am unsure if I can analyze data from the following experiment. Fish were placed in a tank at (t=0) Measurements of Carbon Dioxide were taken each day for 120 days (t=0,...120) A few fish were then randomly pulled out of the tank at different days, killed and examined for the presence of a

Re: [R] ifelse statement

2010-09-17 Thread Ivan Calandra
Hi, Not sure since I've never done it, but shouldn't it be NA instead of NULL? Ivan Le 9/17/2010 15:23, n.via...@libero.it a écrit : > Dear list, > I have a question I'm trying to use the following command in R, but it gives > me an error message.The command is: > > data<-ddply(data,c("year","

Re: [R] test to see if a s4 property is assigned?

2010-09-17 Thread darckeen
> setClass("person",representation(name="character",age="numeric",kids="list")) [1] "person" > bob <- new("person") > length(b...@name) [1] 0 > length(b...@age) [1] 0 > length(b...@kids) [1] 0 > is.na(b...@kids) logical(0) > is.na(b...@age) logical(0) > is.na(b...@name) logical(0) > b...@kids <- l

Re: [R] count frequency

2010-09-17 Thread Jorge Ivan Velez
Alaios, Try as.data.frame(table(x[,1], x[,2)) where x is your matrix. HTH, Jorge On Fri, Sep 17, 2010 at 8:19 AM, Alaios <> wrote: > Hello everyone, > please consider the following lines of a matrix > > > [574,] 59 32 > [575,] 59 32 > [576,] 59 32 > [577,] 59 32 > [578,] 5

[R] Problems creating a Panel

2010-09-17 Thread Millo Giovanni
Dear Felipe, maybe the data (which I can't see through the digest) do not have variability, maybe something else. Try sending me the data.frame, I'll see what happens. Giovanni -- Message: 72 Date: Thu, 16 Sep 2010 11:49:19 -0500 From: Luis Felipe Parra To: r-help@r-

Re: [R] count frequency

2010-09-17 Thread Alaios
Just to confirm, this one worked for me as.data.frame(table(temp[])) Var1 Freq 1 1 11 2 2 29 3 3 29 4 4 29 5 5 29 6 6 29 7 7 29 8 8 29 9 9 29 10 10 29 11 11 29 12 12 29 13 13 29 14 14 29 15 15 29 16 16 29 17 17

Re: [R] Can I save my console contents automatically?

2010-09-17 Thread Nobuaki Michihata
Hello Greg, Thank you for your comment. I had a chance to use Windows GUI R and I found several interesting differences between Mac and Windows GUI R. 1. txtStart() command - Windows GUI R - worked perfectly - Mac GUI R version.string R version 2.11.1 (2010-05-31) (both 32bit and 64bit) - o

[R] removing specific rows from array

2010-09-17 Thread Maas James Dr (MED)
I'm attempting to create an array of treatment comparisons for modelling data generation. This involves comparison of one treatment (c2) with another (c3), relative to a common comparator (c1). Attached code gives me the correct array but need to remove duplicates. Duplicates relate only to c

Re: [R] using variable from for loop in naming new variables

2010-09-17 Thread Joshua Wiley
On Fri, Sep 17, 2010 at 4:46 AM, Ivan Calandra wrote: >  Hi Jim, > > First, I think it's better if you reply to the list, other users might > be interested and have better answers. > > Second, as other replies showed you, using a list is actually way easier > than creating new objects every time.

Re: [R] count frequency

2010-09-17 Thread Alaios
My bad :( unfortunately does not work correct. This is some of the output of the table .. [494,] 50 27 [495,] 50 27 [496,] 50 27 [497,] 50 28 [498,] 50 28 [499,] 50 28 [500,] 50 28 [501,] 51 28 [502,] 51 28 [503,] 51 28 [504,] 51 28 [505,]

Re: [R] count frequency

2010-09-17 Thread Henrique Dallazuanna
So try this : aggregate(rep(1, nrow(x)), as.data.frame(x), sum) On Fri, Sep 17, 2010 at 11:54 AM, Alaios wrote: > My bad :( > unfortunately does not work correct. > > This is some of the output of the table > .. > [494,] 50 27 > [495,] 50 27 > [496,] 50 27 > [497,] 50

Re: [R] function help?

2010-09-17 Thread Duke
On 9/16/10 5:00 PM, Rolf Turner wrote: On 17/09/2010, at 8:51 AM, Duke wrote: Hi Duncan, On 9/16/10 3:47 PM, Duncan Murdoch wrote: On 16/09/2010 3:40 PM, Duke wrote: Hi all, I am writing a function (fun.R), but I dont know how to code the function so that the Help Text will be shown u

[R] question on OPTIMX with installing and using

2010-09-17 Thread Hey Sky
Dear R users I have tried to install the optimx but met problems. I have gone to the website you suggested: https://r-forge.r-project.org/R/?group_id=395 and tried to install it with the following method: install.packages("optimx", repos="http://R-Forge.R-project.org";) I have received the

Re: [R] count frequency

2010-09-17 Thread Alaios
You are pretty good. Worked nicely :) Thanks! Alex From: Henrique Dallazuanna Cc: Rhelp Sent: Fri, September 17, 2010 4:58:50 PM Subject: Re: [R] count frequency So try this : aggregate(rep(1, nrow(x)), as.data.frame(x), sum) My bad :( >unfortunately

[R] Voting power indices

2010-09-17 Thread Thomas Jensen
Dear R-experts, I was wondering if anyone know of a library in R that has functions for calculating the Banzhaf and Shaply-Shubik indeces? Best, Thomas __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Combining Data Sets w/ Weights

2010-09-17 Thread btpagano
Here it is... > str(Males$BMXHT) num [1:2801] 168 161 180 182 169 ... > str(Females$BMXHT) num [1:3440] 162 159 164 165 159 ... > str(Males$yourWeight) num [1:2801] 1148 788 10298 25115 8691 ... > str(Females$myWeight) num [1:3440] 9169 4964 2608 2806 907 ... I want to combine Males$BMXHT wi

[R] How to find STRESS criteria in MDS when there are negative eigenvalues....

2010-09-17 Thread Na.Ebrahimi
Hi, I want to know whether there is any function in R to find STRESS after using cmdscale and estimating the coordinates, I have written these functions to find stress (for p =1,2,3,4,5) stress<-rep(0,5) for(p in 1:5) { datahat<-cmdscale(d,p) deltahat<-as.matrix(dist(datahat)) a<-0 b<-0 for(i i

Re: [R] Combining Data Sets w/ Weights

2010-09-17 Thread btpagano
Sorry, Rather, it should be: wtd.quantile(Everybody$BMXHT, weights=Everybody$ourWeight, 0.05) Thanks again, Brian. -- View this message in context: http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2543998.html Sent from the R help mailing list archive at Nabble.com. _

[R] Unresolves symbol in libR.so

2010-09-17 Thread Buck, Kenneth
Hello, I am having a problem configuring a Redhat server to run R as a shared library called from Perl. The error message I get is: Can't find 'boot_R' symbol in libR.so Has anyone run across something similar? Any help would be greatly appreciated. Thank you, Kenneth Buck Emory Winship Cance

[R] Is there a project to compile R scripts into stand-alone executable file?

2010-09-17 Thread yehengxin
I know Matlab's M file can be converted to a stand-alone executable file. I wonder if there is a project aimed at compiling R scripts into stand-alone executable file. I think it will be very promising for R to be more widely used in different fields. -- View this message in context: http://

Re: [R] convert to csv file

2010-09-17 Thread lord12
I get an error message: Error in file(file, ifelse(append, "a", "w")) : invalid 'open' argument How do I resolve this? -- View this message in context: http://r.789695.n4.nabble.com/convert-to-csv-file-tp2543232p2544070.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] a reliable way to check the latest version of R on CRAN?

2010-09-17 Thread Barry Rowlingson
On Thu, Sep 16, 2010 at 5:29 PM, Yihui Xie wrote: > Hi all, > > We know old.packages() can check for updates of add-on packages, but > is there a way to check updates of R itself? "go to R homepage" is a > way, of course, but I hope this can be done by R. > > I'm not sure about the "reliable" plac

[R] Matrix- create mean/min/max/stdev on column of matrix or rows?

2010-09-17 Thread Halabi, Anan
I made simulation with Weibull and create Matrix, How can I create mean/min/max/stdev on column or rows of matrix?, Thanks, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

Re: [R] convert to csv file

2010-09-17 Thread Sarah Goslee
More context would be useful, but my first guess is that you are running into problems because both file and append are functions. If you didn't explicitly set them to something else, R is using the function. What happens if you instead use: filename <- "myfile.csv" toappend <- FALSE file(filename

Re: [R] convert to csv file

2010-09-17 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of lord12 > Sent: Friday, September 17, 2010 9:02 AM > To: r-help@r-project.org > Subject: Re: [R] convert to csv file > > > I get an error message: > > Error in file(file, ifelse

Re: [R] Interpolate? a line

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 7:22 AM, Alaios wrote: I would like to thank you again for your help. But it seems that the floor function (ceiling, round too) create more dots in the matrix that line really "touches". You said "cells" not "dots". Are you trying to change the problem now? My concern

[R] How to include rows with zeros in all columns when clustering data for heatmap?

2010-09-17 Thread BD
I am making a heatmap. In the dataset, I have couple of rows with zero value in all the columns. When I cluster data using hierarchical clustering, R gives an error message. When I get rid of those particular rows, the script runs smoothly with no problem. I have to include those rows somehow

Re: [R] Combining Data Sets w/ Weights

2010-09-17 Thread btpagano
Good News! I think I figured out my problem. The command I was looking for was append(). Thank you for your help, Brian -- View this message in context: http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2544125.html Sent from the R help mailing list archive at Nabble.com

Re: [R] function help?

2010-09-17 Thread Jeff Newmiller
If having the definition of the function appear when you enter the name of the function elicits a "hate" response, then perhaps you should not be using R. That characteristic of R is fundamental and unlikely to change: in R everything is an object, and the result of evaluating an expression is d

Re: [R] Combining Data Sets w/ Weights

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 11:15 AM, btpagano wrote: Here it is... str(Males$BMXHT) num [1:2801] 168 161 180 182 169 ... str(Females$BMXHT) num [1:3440] 162 159 164 165 159 ... str(Males$yourWeight) num [1:2801] 1148 788 10298 25115 8691 ... str(Females$myWeight) num [1:3440] 9169 4964 2608

[R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Bastien Ferland-Raymond
DearR Users, I have a problem which I think you might be able to help. I have a dataframe which I'm trying to "filter" following different groups I specified. It's a little hard to explain, so here is an example: My dataframe: ESS DHP 1 EPB 22 2 SAB 10 3 SAB 20 4 BOJ 14 5 ERS 2

Re: [R] Matrix- create mean/min/max/stdev on column of matrix or rows?

2010-09-17 Thread Dennis Murphy
Hi: Here's a simple example that you can tune to your needs: m <- matrix(rpois(100, 10), nrow = 10) # Function to compute summary statistics: f <- function(x) c(min = min(x), med = median(x), mean = mean(x), max = max(x)) # Apply to rows (index 1) apply(m, 1, f) [,1] [,2] [,3] [,4] [,5] [,

Re: [R] convert to csv file

2010-09-17 Thread Dennis Murphy
Hi: The first argument of ifelse is a logical statement that must evaluate to either TRUE or FALSE. I'm guessing that you're using the append function here, which is not a logical statement. Perhaps it would help if you described what you wanted to do with a reproducible example to illustrate the

Re: [R] convert to csv file

2010-09-17 Thread Dennis Murphy
I might add that ifelse() is a vectorized function - is the operation you're trying to perform vectorized? D. On Fri, Sep 17, 2010 at 10:21 AM, Dennis Murphy wrote: > Hi: > > The first argument of ifelse is a logical statement that must evaluate to > either TRUE or FALSE. I'm guessing that you'

Re: [R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Ista Zahn
Hi Bastien, You can use match(), or the convenience function %in%, like this (assuming your data.frame is named "dat"): subset(dat, ESS %in% c("EPB","SAB")) dat[dat$ESS %in% c("EPB","SAB"), ] best, Ista On Fri, Sep 17, 2010 at 1:02 PM, Bastien Ferland-Raymond wrote: >  DearR Users, > > I have

Re: [R] Combining Data Sets w/ Weights

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 12:42 PM, btpagano wrote: Good News! I think I figured out my problem. The command I was looking for was append(). Er, maybe. It does appear that you could use append() but c() is much more the typical R way of concatenating objects like vectors and lists. The only

Re: [R] grouping dataframe entries using a categorical variable

2010-09-17 Thread Phil Spector
Bastien - In what way did subset(yourdataframe,ESS %in% softwood) not work? - Phil Spector Statistical Computing Facility Department of Statistics

[R] Preparing data frame for Plotrix kiteChart

2010-09-17 Thread Graham Smith
Although, I can fix this, I am trying to sort out something as straighforward as possible for my students, and I have some questions that hopefully someone can help me with. My data is: Species DistanceCount A 5 0 A 10 5 A 15 5

Re: [R] keep par settings after device closes

2010-09-17 Thread Uwe Ligges
On 16.09.2010 22:40, Jack Siegrist wrote: I am saving several plots to different formats. I want to be able to change the font size for all of them at once. Is there a way to do this without having to have a call to par every time a new device is opened? No. At least you will need some wrap

Re: [R] Nonlinear programming problem

2010-09-17 Thread Ravi Varadhan
Hi, You have not provided a reproducible example, so I can only make an educated guess. This is likely a numerical problem with trying to solve a linear system of equations in the Lagrange-Newton method (sequential quadratic programming or SQP) for solving nonlinearly programming problems. I am

Re: [R] Can I save my console contents automatically?

2010-09-17 Thread Greg Snow
So it looks like the problem is with the mac GUI. Here are a couple more things to test. Try it with just sink and see if the output comes through. Also try with some other functions besides date (maybe summary(rnorm(100))). If there are other Mac users out there reading this, can some of you

Re: [R] How to find STRESS criteria in MDS when there are negative eigenvalues....

2010-09-17 Thread Ravi Varadhan
Perhaps, the "smacof" package on CRAN might be useful to you. Ravi. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Na.Ebrahimi Sent: Friday, September 17, 2010 11:08 AM To: r-help@r-project.org Subject: [R] How to find STRESS crite

Re: [R] Preparing data frame for Plotrix kiteChart

2010-09-17 Thread Ben Bolker
Graham Smith myotis.co.uk> writes: > > Although, I can fix this, I am trying to sort out something as > straighforward as possible for my students, and I have some questions > that hopefully someone can help me with. > > My data is: > > Species DistanceCount > A 5

Re: [R] Can I save my console contents automatically?

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 2:04 PM, Greg Snow wrote: So it looks like the problem is with the mac GUI. Here are a couple more things to test. Try it with just sink and see if the output comes through. Also try with some other functions besides date (maybe summary(rnorm(100))). If there are ot

Re: [R] Is there a project to compile R scripts into stand-alone executable file?

2010-09-17 Thread Ben Bolker
yehengxin hotmail.com> writes: > I know Matlab's M file can be converted to a stand-alone executable file. I > wonder if there is a project aimed at compiling R scripts into stand-alone > executable file. I think it will be very promising for R to be more widely > used in different fields.

Re: [R] troubles with R

2010-09-17 Thread Liina Pilv
Dear friends, thank you Liina Pilv On Jan 24, 2010, at 6:56 PM, Jim Holtman wrote: where did you save it to; what directory? did you restart in the same directory? most likely a procedural error. What is the problem you are trying to solve? Sent from my iPhone. On Jan 24, 2010, at 9:46,

[R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread array chip
Hi, I asked this on mixed model mailing list, but that list is not very active, so I'd like to try the general R mailing list. Sorry if anyone receives the double post. Hi, I have a dataset of animals receiving some eye treatments. There are 8 treatments, each animal's right and left eye was

[R] how to work with Year-Month dates

2010-09-17 Thread Joshua Wiley
Hi all, Is there a built in or easier way to work with dates that are *just* Year-Month? Right now I paste() on a day as a work around, but it ultimately needs to be in Year-Month form, so then I use format() to get rid of the day. x <- c("2006-December", "2006-July") x <- paste(x, "-01", sep='')

Re: [R] how to work with Year-Month dates

2010-09-17 Thread Henrique Dallazuanna
Try this: library(zoo) as.yearmon(x, "%Y-%B") On Fri, Sep 17, 2010 at 4:23 PM, Joshua Wiley wrote: > Hi all, > > Is there a built in or easier way to work with dates that are *just* > Year-Month? > Right now I paste() on a day as a work around, but it ultimately needs to > be > in Year-Month fo

[R] odfWeave UTF-8 error and latin characters

2010-09-17 Thread Pedro Emmanuel Alvarenga Americano do Brasil
Hello R masters, I have sent this same message to other lists and none so far could give some light. I was trying to use odfWeave to generate a report from R and Im getting an error that I think is related to latin characters. I looked around and did find some stuff related to this problem about S

Re: [R] Is there a bisection method in R?

2010-09-17 Thread Gregory Gentlemen
If uniroot is not a bisection method, then what function in R does use bisection? Thanks. --- On Fri, 9/10/10, David Winsemius wrote: From: David Winsemius Subject: Re: [R] Is there a bisection method in R? To: "huang min" Cc: "Gregory Gentlemen" , r-help@r-project.org Received: Friday, Sept

Re: [R] how to work with Year-Month dates

2010-09-17 Thread Joshua Wiley
I had started thinking of writing my own class...this is much nicer. Thanks! Josh On Fri, Sep 17, 2010 at 12:27 PM, Henrique Dallazuanna wrote: > > Try this: > > library(zoo) > as.yearmon(x, "%Y-%B") > > > On Fri, Sep 17, 2010 at 4:23 PM, Joshua Wiley > wrote: >> >> Hi all, >> >> Is there a bu

Re: [R] function help?

2010-09-17 Thread Duke
On 9/17/10 12:46 PM, Jeff Newmiller wrote: If having the definition of the function appear when you enter the name of the function elicits a "hate" response, then perhaps you should not be using R. That characteristic of R is fundamental and unlikely to change: in R everything is an object, a

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread Peter Dalgaard
On 09/17/2010 09:14 PM, array chip wrote: > Hi, I asked this on mixed model mailing list, but that list is not very > active, > so I'd like to try the general R mailing list. Sorry if anyone receives the > double post. > > > Hi, I have a dataset of animals receiving some eye treatments. There

Re: [R] Is there a bisection method in R?

2010-09-17 Thread Greg Snow
Why does it matter what method is used? The uniroot function used a quicker method than bisection, but solves the same problem, so why do you need bisection? The only reason I can think is this is a homework problem, in which case we don't do homework. In fact I have assigned this as homework

Re: [R] Is there a bisection method in R?

2010-09-17 Thread Peter Dalgaard
On 09/17/2010 09:28 PM, Gregory Gentlemen wrote: > If uniroot is not a bisection method, then what function in R does use > bisection? > Why do you assume that there is one? uniroot contains a better algorithm for finding bracketed roots. It shouldn't be too hard to roll your own if you need on

Re: [R] glm: formula vs character

2010-09-17 Thread Greg Snow
I think what is going on (and someone is likely to correct me otherwise) is that formulas have an associated environment that gets passed along with them while character strings do not. This means that when you pass the object to another function which passes it to another function, etc. that e

Re: [R] Help with graphic margin

2010-09-17 Thread Greg Snow
I can't see the graphs (my work has a rather strict policy about "file sharing" websites and apparently imageshack is redlisted). But try adding outer=TRUE to the axis function calls and see if that fixes the problem. If not, play with the par(xpd= ) setting. -- Gregory (Greg) L. Snow Ph.D. S

[R] Data Cube in R from CSV

2010-09-17 Thread clangkamp
Hello I am at the moment trying to get to grips with a data cube in R, and I am increasingly wondering whether I am actually making things unnecessarily difficult for myself. The idea is that I have a data cube with three dimensions (so a 3D matrix): companies, figures, and years. So along the z a

Re: [R] Preparing data frame for Plotrix kiteChart

2010-09-17 Thread Graham Smith
Ben, Thanks for your help on this. Obviously a bit of a mental block on my part, as it seems painfully obvious now. Graham __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

[R] Merging data frames on a variety of columns

2010-09-17 Thread Chris Poliquin
Hello, This is a semi-complicated question about comparing two datasets, probably using merge, but I am open to other ideas. I have a large frame of information about companies.  It's over 30,000 rows and looks something like... df1 <- identifier1 identifier2nameother_name

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread array chip
Thank you Peter. Actually 3 people from mixed model mailing list tried my code using lmer(). They got the same results as what I got from lme4(). So they couldn't replicate my lmer() results: Random effects: Groups NameVariance Std.Dev. eye:id (Intercept) 3.59531 1.89613 id

Re: [R] navel-gazing

2010-09-17 Thread Joshua Wiley
I have been tinkering around with this for a bit, and I am proud to share navel gazer 1.0. If no arguments are passed, it will look up the top 50 authors on the r-help list, for the given month in the given year. You can also specify one or more months as a character vector (e.g., "August" or c("A

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-17 Thread Kevin Wright
I confirm John's problems with lmer. I'm using R 2.11.1. on Windows XP. R> m4 <- lmer(score~trt+(1|id/eye),dat) R> m4 Linear mixed model fit by REML Formula: score ~ trt + (1 | id/eye) Data: dat AIC BIC logLik deviance REMLdev 446.7 495.8 -212.4430.9 424.7 Random effects: Groups

Re: [R] Data Cube in R from CSV

2010-09-17 Thread dajohnst
(This is my first post -- I hope I am doing this right) Why not use an array? An array can be indexed in as many dimensions as you would like, and do not require any extra packages. x = array(1:27, dim = c(3, 3, 3)) x x[1, , ] x[ , 1, ] x[ , , 1] -David A. Johnston -- View this message in c

Re: [R] Is there a bisection method in R?

2010-09-17 Thread Ravi Varadhan
Here is something simple (does not have any checks for bad input), yet should be adequate: bisect <- function(fn, lower, upper, tol=1.e-07, ...) { f.lo <- fn(lower, ...) f.hi <- fn(upper, ...) feval <- 2 if (f.lo * f.hi > 0) stop("Root is not bracketed in the specified interval \n") chg <- uppe

Re: [R] Matrix- create mean/min/max/stdev on column of matrix or rows?

2010-09-17 Thread Henrik Bengtsson
See also the matrixStats package on CRAN. /Henrik On Fri, Sep 17, 2010 at 10:17 AM, Dennis Murphy wrote: > Hi: > > Here's a simple example that you can tune to your needs: > > m <- matrix(rpois(100, 10), nrow = 10) > > # Function to compute summary statistics: > f <- function(x) c(min = min(x),

[R] R Console - pasting into

2010-09-17 Thread Troy Lynch
For some reason, I have trouble pasting commands into the R Console (XP Pro and R v 2.11.1). This occurs mainly when copying from a PDF document and then pasting into the R Console. It will work for a while and then stop. It is difficult to identify what the sequence is prior to it not allowing

[R] how to import this kind of data?

2010-09-17 Thread Soyeon Kim
Dear All, I am in a trouble with reading data. It is in txt file looking like this. 0.00632 18.00 2.310 0 0.5380 6.5750 65.20 4.0900 1 296.0 15.30 396.90 4.98 24.00 0.02731 0.00 7.070 0 0.4690 6.4210 78.90 4.9671 2 242.0 17.80 396.90 9.14 21.60 0.02729 0.0

[R] How to compare, match two columns from diferent dataframe and assign values from one datafram to the other

2010-09-17 Thread Wang, Ying
Dear R experts, I'm new to R. It seems to be a simple question but I just can't find a way to do it. Please help me. I have two data sets x and y as shown in the following. I want to compare the first two columns in x and y, find the matched ones and assign the relative value from column 2 of

Re: [R] R Console - pasting into

2010-09-17 Thread Joshua Wiley
Hi Troy, If you are using the R GUI for Windows, I highly recommend just copying and pasting everything into the accompanying script editor, and then you can run the commands you want directly from there. The Windows clipboard can be finicky sometimes, so I would not be too hasty to think the pro

Re: [R] how to import this kind of data?

2010-09-17 Thread Phil Spector
Soyeon - I think scan() (combined with matrix and data.frame) is the easiest way. Suppose your text file is called "data.txt". Then data.frame(matrix(scan('data.txt'),byrow=TRUE,ncol=14)) should give you what you want. - Phil Spector

Re: [R] Is there a project to compile R scripts into stand-alone executable file?

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 11:47 AM, yehengxin wrote: I know Matlab's M file can be converted to a stand-alone executable file. I wonder if there is a project aimed at compiling R scripts into stand- alone executable file. I think it will be very promising for R to be more widely used in diff

Re: [R] How to compare, match two columns from diferent dataframe and assign values from one datafram to the other

2010-09-17 Thread Dennis Murphy
Hi: df <- data.frame(x = 1:10, y = rep(0, 10)) dg <- data.frame(x = c(7, 4, 2, 8, 12, 15), y = letters[1:6]) merge(df, dg, by = 'x', all.x = TRUE) x y.x y.y 1 1 0 2 2 0c 3 3 0 4 4 0b 5 5 0 6 6 0 7 7 0a 8 8 0d 9 9 0 10 10 0 HTH, Denn

[R] modeling variance heterogeneity in lme4

2010-09-17 Thread Johan Jackson
Hi all, I have major heterogeneity in variances across labs (100-fold). There is no apparent variance heterogeneity across y-hat. By using lme4 in the following way, am I accounting for the variance differences in labs?: lmer(y ~ fixed1 + covariates + (fixed1|labs)) I'm not sure that it is - I t

Re: [R] modeling variance heterogeneity in lme4

2010-09-17 Thread Johan Jackson
I should have been more careful in my description. When I say there is a 100-fold difference in variance across labs, I mean that variance in fixed1 (the predictor) varies 100-fold across labs, not the variance in y is 100-fold difference across labs. Can lme4 account for such variance differences

[R] Vim-R-plugin now works on Windows too

2010-09-17 Thread Jakson A. Aquino
Dear R users, Some of you may be interested in the following announcement: The Vim-R-plugin now works on Windows too. With the Vim-R-plugin we can send commands to R from the text editor Vim: http://www.vim.org/scripts/script.php?script_id=2628 Notes: On Windows, the plugin copies the command

[R] How to denote a line on the graph

2010-09-17 Thread aegea
Please give me some help, many thanks. I graphed a expected CDF line of a binomial distribution on a graph, And I have some observed points (observed CDF) from 4 groups fall on the smooth CDF line. I cannot really get the legend I want legend ('topleft', c('a, 'b', 'c', 'd', 'expected CDF'), c

Re: [R] Matrix- create mean/min/max/stdev on column of matrix or rows?

2010-09-17 Thread Henrique Dallazuanna
Try this: apply(m, 1, summary) # 1 or 2 On Fri, Sep 17, 2010 at 1:08 PM, Halabi, Anan wrote: > I made simulation with Weibull and create Matrix, > How can I create mean/min/max/stdev on column or rows of matrix?, > Thanks, > > __ > R-help@r-project.or

Re: [R] How to denote a line on the graph

2010-09-17 Thread David Winsemius
On Sep 17, 2010, at 7:57 PM, aegea wrote: Please give me some help, many thanks. I graphed a expected CDF line of a binomial distribution on a graph, And I have some observed points (observed CDF) from 4 groups fall on the smooth CDF line. I cannot really get the legend I want legend ('

[R] R on ESS

2010-09-17 Thread Stephen Liu
Hi folks, Debian 504 64-bit Emacs Version 22.1.1 I have Emacs+ESS running on the box. R can work on ESS. But the fonts on the menu bar (top) of Emacs are NOT clear, difficult to read, grey foreground. I have been googling around for solution without result. Please help. TIA B.R. Stephen

Re: [R] R on ESS

2010-09-17 Thread Simon Blomberg
Try emacs 23 Cheers, Simon. Simon Blomberg, BSc (Hons), PhD, MAppStat, AStat Lecturer and Consultant Statistician School of Biological Sciences The University of Queensland St. Lucia Queensland 4072 Australia T: +61 7 3365 2506 email: S.Blomberg1_at_uq.edu.au http://www.uq.edu.au/~uqsblomb/

  1   2   >