[R] more floating point sensitivity in 3.5.0?

2018-05-18 Thread Anthony Damico
hi all, in the past two days, i've found two places in unrelated code where i needed to substitute something like `x == y` with `isTRUE(all.equal(x,y))` to fix problems that started occurring in 3.5.0 on windows. the release news[1] makes one mention of floating points, but i'm not sur

Re: [R] More tube-like lines3D?

2016-09-13 Thread Atte Tenkanen
Thanks, time is no problem! Atte 13.9.2016, 15.12, Duncan Murdoch kirjoitti: On 13/09/2016 5:58 AM, Atte Tenkanen wrote: Hi, Is it possible to give 3d-like form for rgl lines3d-lines? Although I increase lwd, lines still look like lines, not like tubes. cylinder3d() should do that. It puts

Re: [R] More tube-like lines3D?

2016-09-13 Thread Duncan Murdoch
On 13/09/2016 5:58 AM, Atte Tenkanen wrote: Hi, Is it possible to give 3d-like form for rgl lines3d-lines? Although I increase lwd, lines still look like lines, not like tubes. cylinder3d() should do that. It puts a substantially larger burden on the graphics system, so if you draw too many o

[R] More tube-like lines3D?

2016-09-13 Thread Atte Tenkanen
Hi, Is it possible to give 3d-like form for rgl lines3d-lines? Although I increase lwd, lines still look like lines, not like tubes. -- Atte Tenkanen, FT MuM Turun Martinseurakunnan kanttori p. 040-3417125 __ R-help@r-project.org mailing list -- To

Re: [R] more complex by with data.table???

2015-06-21 Thread Arunkumar Srinivasan
Ramiro, `dt[, lapply(.SD, mean), by=name]` is the idiomatic way. I suggest reading through the new HTML vignettes at https://github.com/Rdatatable/data.table/wiki/Getting-started Ista, thanks for linking to the new vignette. On Wed, Jun 10, 2015 at 2:17 AM, Ista Zahn wrote: > Hi Ramiro, > > T

Re: [R] more complex by with data.table???

2015-06-09 Thread Ista Zahn
Hi Ramiro, There is a demonstration of this on the data.table wiki at https://rawgit.com/wiki/Rdatatable/data.table/vignettes/datatable-intro-vignette.html. You can do dt[, lapply(.SD, mean), by=name] or dt[, as.list(colMeans(.SD)), by=name] BTW, there are pretty straightforward ways to do thi

Re: [R] more complex by with data.table???

2015-06-09 Thread jim holtman
try this: > dt[ + , { + result <- list() + for (i in names(.SD)){ + result[[i]] <- myFunction(unlist(.SD[, i, with = FALSE])) + } + result + } + , by = name + ] name var1 var2 var3 1:a 2.0 22 42 2:b 7.5 28 48 > J

[R] more complex by with data.table???

2015-06-09 Thread Ramiro Barrantes
Hello, I am trying to do something that I am able to do with the "by" function within data.frame but can't figure out how to achieve with data.table. Consider dt<-data.table(name=c(rep("a",5),rep("b",6)),var1=0:10,var2=20:30,var3=40:50) myFunction <- function(x) { mean(x) } I am aware that I c

Re: [R] More elegant way of stacking the data

2014-11-25 Thread Lee, Chel Hee
If you do not want to use the loop, a function called 'reshape' may be useful: > df <- data.frame(a=1:5,b=letters[1:5],c1=1:5,c2=2:6,c3=3:7,c4=4:8) > out2 <- reshape(data=df, direction="long", varying=list(3:6), times=paste("c",1:4,sep="")) > out2 a b time c1 id 1.c1 1 a c1 1 1 2.c1 2

Re: [R] More elegant way of stacking the data

2014-11-25 Thread Dimitri Liakhovitski
Thanks a lot, guys! On Tue, Nov 25, 2014 at 9:42 AM, Lee, Chel Hee wrote: > If you do not want to use the loop, a function called 'reshape' may be > useful: > >> df <- data.frame(a=1:5,b=letters[1:5],c1=1:5,c2=2:6,c3=3:7,c4=4:8) >> out2 <- reshape(data=df, direction="long", varying=list(3:6), >>

Re: [R] More RGoogleDocs - R1C1 reference style

2014-11-25 Thread Jeff Newmiller
You appear to be using a package that are not even on CRAN, much less base R, so you need to tell us that in your (missing) reproducible example. It is self-described as "primitive", so don't be surprised when it acts odd. Note that your creation of an exposed Google account in your previous thr

Re: [R] More elegant way of stacking the data

2014-11-24 Thread David Winsemius
On Nov 24, 2014, at 3:12 PM, Dimitri Liakhovitski wrote: > I have the data frame 'df' and my desired solution 'out'. > I am sure there is a more elegant R-way to do it - without a loop. > > df = data.frame(a=1:5,b=letters[1:5],c1=1:5,c2=2:6,c3=3:7,c4=4:8) > mylist=NULL > for(i in 1:4){ > myname

[R] More elegant way of stacking the data

2014-11-24 Thread Dimitri Liakhovitski
I have the data frame 'df' and my desired solution 'out'. I am sure there is a more elegant R-way to do it - without a loop. df = data.frame(a=1:5,b=letters[1:5],c1=1:5,c2=2:6,c3=3:7,c4=4:8) mylist=NULL for(i in 1:4){ myname<-paste("c",i,sep="") mylist[[i]]<-df[c("a","b",myname)] names(mylis

[R] More RGoogleDocs - R1C1 reference style

2014-11-24 Thread Jennifer Sabatier
Thank you all for helping grab data off Google Docs. Now I have another problem. When I pull the data all the formulas come into R as R1C1 reference style, while in Google Docs they're A1 reference style. As a result, the formulas are strings in the cells, rather than values: =AND((R[0]C[34]=1

Re: [R] More efficient data-block processing

2014-03-06 Thread arun
HI Craig, Assuming that this is similar to what you tried: dat <- read.table(text="member code 1 A 1 C 1 F 2 B 2 E 3 D 3 A 3 B 3 D 4 G 4 A",sep="",header=TRUE,stringsAsFactors=FALSE)  code.list <- LETTERS[1:5] n.mbr <- 4  mbr.list <- 1:4 matrix.mat <- matrix(0,ncol=length(code.list),nrow=length(u

[R] More efficient data-block processing -revised

2014-03-06 Thread Mckinstry, Craig
I have a medical insurance claims datafile divided into blocks by member, with multiple lines per member. I am processing these into a one line per member binary model matrix. Member block sizes vary from 1 to 50+. I am matching attributes in claims data to columns in the model matrix and have b

Re: [R] more rpy2 questions...mostly R

2013-11-17 Thread Collin Lynch
Erin, at first glance I would say that this is an R error. When Rpy2 detects an error it will pass it through errors as library errors like this. At first glance it appears that your r code is not loading the requisite packages as it cannot find them. That I suspect is what is causing your coord

[R] more rpy2 questions...mostly R

2013-11-17 Thread Erin Hodgess
Hello again! I'm using python, rpy2, and R for a project. It's actually pretty interesting. Anyhow, I pass in an R file to the python program. However, I am getting the following errors, which seem more like R errors(?): Loading required package: gstat Loading required package: automap Error i

Re: [R] More Columns than column names Error

2013-10-22 Thread arun
Hi, The "Garbage.txt" file you showed in the original post is slighly different (in spacing) from the one you are showing now. lines1 <- readLines("Garbage.txt",warn=FALSE) lines2 <- readLines("GarbageNew.txt",warn=FALSE) #saved the new as "GarbageNew.txt" lines1  [1] "Material\tWeight(Millio

Re: [R] More Columns than column names Error

2013-10-22 Thread arun
Hi, Try:  lines1 <- readLines("Garbage.txt",warn=FALSE) dat1 <- read.table(text=gsub("\t+","\t",lines1),stringsAsFactors=FALSE,sep="\t",check.names=FALSE,header=TRUE)  str(dat1) #'data.frame':    10 obs. of  3 variables: # $ Material    : chr  "Food Scraps" "Glass" "Metals" "Paper" ... # $

Re: [R] More Columns than column names Error

2013-10-22 Thread Keith Jewell
Carl is right. Going to the nabble post and looking in the source data file I see the headings row has 'Material' tab 'Weight...' tab 'Percent'. Each of the data rows has 1 tab character between the 'Material' and 'Weight' columns and 3

Re: [R] More Columns than column names Error

2013-10-22 Thread Carl Witthoft
What is the exact code you are using to try to load this file? I strongly suspect the problem is a mixture of spaces and multiple tabs in your text file. -- View this message in context: http://r.789695.n4.nabble.com/More-Columns-than-column-names-Error-tp4678770p4678787.html Sent from the R he

Re: [R] More discussion on R usage statistics

2013-06-01 Thread Johnny Zhang
Dear Ista, Thanks for the suggestion. I've changed the comment function to feedback.  Best, Johnny From: Ista Zahn Cc: "r-help@r-project.org" Sent: Friday, May 31, 2013 5:56 PM Subject: Re: [R] More discussion on R usage statistics Hi

Re: [R] More discussion on R usage statistics

2013-05-31 Thread Ista Zahn
n, use > > ask('blabla..', package='rstats', email='xxx@xxx', name='xxx') > > Any comments and suggestions are welcome. > > > > > From: Liviu Andronic > > Cc: Michael Weylandt ; "r-help@r-

Re: [R] More discussion on R usage statistics

2013-05-31 Thread Johnny Zhang
#x27;, name='xxx') Any comments and suggestions are welcome. From: Liviu Andronic Cc: Michael Weylandt ; "r-help@r-project.org" Sent: Thursday, May 30, 2013 10:34 AM Subject: Re: [R] More discussion on R usage statistics > I'd be very happy to change its name

Re: [R] More discussion on R usage statistics

2013-05-30 Thread Liviu Andronic
___ > From: Michael Weylandt > > Cc: "r-help@r-project.org" > Sent: Wednesday, May 29, 2013 5:26 PM > Subject: Re: [R] More discussion on R usage statistics > > > > Interesting idea but would you be willing to change the name. Twitter, > Stackoverflow, and the

Re: [R] More discussion on R usage statistics

2013-05-30 Thread Johnny Zhang
I'd be very happy to change its name and welcome any input on another name. Zhiyong From: Michael Weylandt Cc: "r-help@r-project.org" Sent: Wednesday, May 29, 2013 5:26 PM Subject: Re: [R] More discussion on R usage statistics Interesting

Re: [R] More discussion on R usage statistics

2013-05-29 Thread Michael Weylandt
Interesting idea but would you be willing to change the name. Twitter, Stackoverflow, and the like use rstats to refer to R itself and confusion seems probable. https://mobile.twitter.com/search?q=%23rstats Michael On May 29, 2013, at 19:21, Johnny Zhang wrote: > Dear R users, > > There ha

[R] More discussion on R usage statistics

2013-05-29 Thread Johnny Zhang
Dear R users, There has been discussion on how to collect R usage statistics before and the discussion has led to some good results such as  http://neolab.stat.ucla.edu/cranstats/ and http://crantastic.org/. Recently, I tried to put together a package that allows R users to rate, comment, and as

Re: [R] More

2013-04-22 Thread arun
Hi Bruce, This could be also done by: dat1<- read.csv("Sample_all_3_locations.csv",header=TRUE,stringsAsFactors=FALSE,sep=",") library(plyr) res1<-ddply(unique(dat1[,c(1,3:4)]),.(Location_name),summarize,Survey_Time=sum(Survey_Time)) #changed here res1 #  Location_name Survey_Time #1 1_f3p1_

Re: [R] More

2013-04-22 Thread arun
Hi Bruce, >From your excel sheets, it looks like for the step1, you were just taking only >the "Survey Time" of the first rows of unique Start_Day for each >Location_name. Step2 results looks the same as "res2" If this is the case: dat1<- read.csv("Sample_all_3_locations.csv",header=TRUE,str

Re: [R] More efficient use of reshape?

2012-12-14 Thread Nathan Miller
plot2_0.9.3 > > loaded via a namespace (and not attached): > [1] colorspace_1.2-0 dichromat_1.2-4 digest_0.6.0 gtable_0.1.2 > labeling_0.1 > [6] MASS_7.3-22 munsell_0.4 proto_0.3-9.2tools_2.15.2 > > > > > > > John Kane > Kingston ON Canada

Re: [R] More efficient use of reshape?

2012-12-14 Thread John Kane
9.2tools_2.15.2 John Kane Kingston ON Canada > -Original Message- > From: natemille...@gmail.com > Sent: Thu, 13 Dec 2012 09:58:34 -0800 > To: dwinsem...@comcast.net > Subject: Re: [R] More efficient use of reshape? > > Sorry David, > > In my attempt to sim

Re: [R] More efficient use of reshape?

2012-12-13 Thread Nathan Miller
Sorry David, In my attempt to simplify example and just include the code I felt was necessary I left out the loading of ggplot2, which then imports reshape2, and which was actually used in the code I provided. Sorry to the mistake and my misunderstanding of where the reshape function was coming fr

Re: [R] More efficient use of reshape?

2012-12-13 Thread David Winsemius
On Dec 13, 2012, at 9:16 AM, Nathan Miller wrote: Hi all, I have played a bit with the "reshape" package and function along with "melt" and "cast", but I feel I still don't have a good handle on how to use them efficiently. Below I have included a application of "reshape" that is rather c

[R] More help need on Von Bertalanffy Growth Curves

2012-09-10 Thread April Lindeman
Howdy, Last week I got some great help on why I was getting an error code when trying to run this model, thanks everyone!  I was able to get the code up and running beautifully for several data sets.  Now I am getting different errors with this new data set.  I can't figure out why, I have more

Re: [R] more efficient way to parallel

2012-08-06 Thread Martin Morgan
On 08/06/2012 09:41 AM, Jie wrote: After searching online, I found that clusterCall or foreach might be the solution. Re-write your outer loop as an lapply, then on non-Windows use parallel::mclapply. Or on windows use makePSOCKcluster and parLapply. I ended with library(parallel) library(M

Re: [R] more efficient way to parallel

2012-08-06 Thread John Kerpel
Not that I've had a chance to really look at the problem, but I've removed outer loops using parLapply from the parallel package. Works great. On Mon, Aug 6, 2012 at 11:41 AM, Jie wrote: > After searching online, I found that clusterCall or foreach might be the > solution. > > Best wishes, > Ji

Re: [R] more efficient way to parallel

2012-08-06 Thread Jie
After searching online, I found that clusterCall or foreach might be the solution. Best wishes, Jie On Sun, Aug 5, 2012 at 10:23 PM, Jie wrote: > Dear All, > > Suppose I have a program as below: Outside is a loop for simulation (with > random generated data), inside there are several sapply()'s

[R] more efficient way to parallel

2012-08-05 Thread Jie
Dear All, Suppose I have a program as below: Outside is a loop for simulation (with random generated data), inside there are several sapply()'s (10~100) over the data and something else, but these sapply's have to be sequential. And each sapply do not involve very intensive calculation (a few seco

Re: [R] More simple implementation is slow.

2012-06-09 Thread peter dalgaard
On Jun 9, 2012, at 13:16 , wl2776 wrote: > > $sample.interval > [1] 0.02 > > $sampling.time > [1] 0.02 > > Apparently, it is about twise faster. Too fast to measure, I'd say. Try system.time, and/or multiple replications. -- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Busi

Re: [R] More simple implementation is slow.

2012-06-09 Thread wl2776
Sorry, here are the profiles: summaryRprof("get_tau") $by.self self.time self.pct total.time total.pct "cbind" 0.02 50 0.04 100 "unlist" 0.02 50 0.0250 $by.total total.time total.pct self.time self.pct "cbind" 0.04

Re: [R] More simple implementation is slow.

2012-06-09 Thread wl2776
I've created another get_tau implementation, using sapply and apply. http://pastebin.com/3FaHAL1i However, the second variant, with expand.grid still appeals me most. I don't undestand, why it is so slow. -- View this message in context: http://r.789695.n4.nabble.com/More-simple-implementation

Re: [R] More simple implementation is slow.

2012-06-09 Thread peter dalgaard
On Jun 9, 2012, at 11:08 , wl2776 wrote: > Hi all. > I'm developing a function, which must return a square matrix. > > Here is the code: > http://pastebin.com/THzEW9N7 > > These functions implement an analog of two embedded for cycles. > > The first variant creates the resulting matrix by colu

[R] More simple implementation is slow.

2012-06-09 Thread wl2776
Hi all. I'm developing a function, which must return a square matrix. Here is the code: http://pastebin.com/THzEW9N7 These functions implement an analog of two embedded for cycles. The first variant creates the resulting matrix by columns, cbind()-ing them one by one. The second variant creates

Re: [R] more boa plots questions

2012-04-22 Thread Chihuahuin
boa.plot('trace') -- View this message in context: http://r.789695.n4.nabble.com/more-boa-plots-questions-tp3330312p4579163.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] More issues with apply

2012-01-15 Thread LCOG1
Sorry I wasn't completely clear, I am not 100% sure I know all the terminology but what I want the array to store is both 'Taz' with the 'Bldgtype' count designations like the result from data set one returns. When there isn't more than one type of 'Bldgtype' like in data set 2 the 'Bldgtype' desi

Re: [R] More issues with apply

2012-01-13 Thread David Winsemius
On Jan 13, 2012, at 4:55 PM, LCOG1 wrote: Hi all, Please consider the following: DataSet1.. <- data .frame(Bldgtype=c("SFDM","SFDM","SFDM","SFDM","SFDM","SFDM","APT"), Taz=c("254","254","254","564","564","564","564"),stringsAsFactors = FALSE) PeriodResType_Zx <- tapply(as.character(Data

[R] More issues with apply

2012-01-13 Thread LCOG1
Hi all, Please consider the following: DataSet1.. <- data.frame(Bldgtype=c("SFDM","SFDM","SFDM","SFDM","SFDM","SFDM","APT"), Taz=c("254","254","254","564","564","564","564"),stringsAsFactors = FALSE) PeriodResType_Zx <- tapply(as.character(DataSet1..$Bldgtype), as.character(DataSet1..$Taz),

Re: [R] More efficient option to append()?

2011-08-19 Thread Uwe Ligges
On 19.08.2011 15:50, Paul Hiemstra wrote: On 08/17/2011 10:53 PM, Alex Ruiz Euler wrote: Dear R community, I have a 2 million by 2 matrix that looks like this: x<-sample(1:15,200, replace=T) y<-sample(1:10*1000, 200, replace=T) x y [1,] 10 4000 [2,] 3 1000 [3,] 3 40

Re: [R] More efficient option to append()?

2011-08-19 Thread Alex Ruiz Euler
Thanks for the code corrections. I see how for loops, append and naively populating a NULL vector can be so resource consuming. I tried the codes with 20 million observations in the following machine: processor : 7 cpu family : 6 model name : Intel(R) Core(TM) i7 CPU Q 720

Re: [R] More efficient option to append()?

2011-08-19 Thread Paul Hiemstra
As I already stated in my reply to your earlier post: resending the answer for the archives of the mailing list... Hi Alex, The other reply already gave you the R way of doing this while avoiding the for loop. However, there is a more general reason why your for loop is terribly inefficient. A

Re: [R] More efficient option to append()?

2011-08-19 Thread Paul Hiemstra
On 08/18/2011 07:46 AM, Timothy Bates wrote: > This takes a few seconds to do 1 million lines, and remains explicit/for loop > form > > numberofSalaryBands = 100 # 200 > x= sample(1:15,numberofSalaryBands, replace=T) > y= sample((1:10)*1000, numberofSalaryBands, replace=T)

Re: [R] More efficient option to append()?

2011-08-19 Thread Paul Hiemstra
On 08/17/2011 10:53 PM, Alex Ruiz Euler wrote: > Dear R community, > > I have a 2 million by 2 matrix that looks like this: > > x<-sample(1:15,200, replace=T) > y<-sample(1:10*1000, 200, replace=T) > x y > [1,] 10 4000 > [2,] 3 1000 > [3,] 3 4000 > [4,] 8 6000 > [5,] 2 9

Re: [R] More efficient option to append()?

2011-08-18 Thread Dennis Murphy
Hi: This seems to take a bit less code, avoids explicit loops (by using mapply() instead, where the loops are internal) and takes about 10 seconds on my system: m <- cbind(x = sample(1:15,200, replace=T), y = sample(1:10*1000, 200, replace=T)) sum(m[, 1]) # [1] 16005804 ff <- f

Re: [R] More efficient option to append()?

2011-08-18 Thread Timothy Bates
This takes a few seconds to do 1 million lines, and remains explicit/for loop form numberofSalaryBands = 100 # 200 x= sample(1:15,numberofSalaryBands, replace=T) y= sample((1:10)*1000, numberofSalaryBands, replace=T) df = data.frame(x,y) finalN = sum(df$x) myVar

Re: [R] More efficient option to append()?

2011-08-17 Thread Alex Ruiz Euler
alf Of Alex Ruiz Euler > > Sent: Wednesday, August 17, 2011 3:54 PM > > To: r-help@r-project.org > > Subject: [R] More efficient option to append()? > > > > > > Dear R community, > > > > I have a 2 million by 2 matrix that looks like this: > >

[R] More efficient option to append()?

2011-08-17 Thread Alex Ruiz Euler
Dear R community, I have a 2 million by 2 matrix that looks like this: x<-sample(1:15,200, replace=T) y<-sample(1:10*1000, 200, replace=T) x y [1,] 10 4000 [2,] 3 1000 [3,] 3 4000 [4,] 8 6000 [5,] 2 9000 [6,] 3 8000 [7,] 2 1 (...) The first column is a popula

Re: [R] More efficient option to append()?

2011-08-17 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Alex Ruiz Euler > Sent: Wednesday, August 17, 2011 3:54 PM > To: r-help@r-project.org > Subject: [R] More efficient option to append()? > > > Dear R

[R] More efficient option to append()?

2011-08-17 Thread Alex Ruiz Euler
Dear R community, I have a 2 million by 2 matrix that looks like this: x<-sample(1:15,200, replace=T) y<-sample(1:10*1000, 200, replace=T) x y [1,] 10 4000 [2,] 3 1000 [3,] 3 4000 [4,] 8 6000 [5,] 2 9000 [6,] 3 8000 [7,] 2 1 (...) The first column is a populat

Re: [R] More effective calculation for loop

2011-05-13 Thread Joshua Ulrich
On Fri, May 13, 2011 at 4:32 AM, Wolfgang Wu wrote: > I am getting confused in how to use R effectively. Below is the example that I > would like to optimize, which is basically a loop. In its current version it > takes  about 20 seconds to run. I have looked at the apply function and but > didn't

Re: [R] More effective calculation for loop

2011-05-13 Thread John Kane
What is xts? What package? --- On Fri, 5/13/11, Wolfgang Wu wrote: > From: Wolfgang Wu > Subject: [R] More effective calculation for loop > To: R-help@r-project.org > Received: Friday, May 13, 2011, 5:32 AM > I am getting confused in how to use R > effectively. Below is

[R] More effective calculation for loop

2011-05-13 Thread Wolfgang Wu
I am getting confused in how to use R effectively. Below is the example that I would like to optimize, which is basically a loop. In its current version it takes about 20 seconds to run. I have looked at the apply function and but didn't seem to get it to work. I am sure this is relatively easy

Re: [R] More flexible aggregate / eval

2011-04-30 Thread David Winsemius
On Apr 30, 2011, at 7:06 AM, Patrick Hausmann wrote: Dear list, I would like to do some calculation using different grouping variables. My 'df' looks like this: # Some data set.seed(345) id <- seq(200,400, by=10) ids <- sample(substr(id,1,1)) group1 <- rep(1:3, each=7) group2 <- rep(1:2, c

[R] More flexible aggregate / eval

2011-04-30 Thread Patrick Hausmann
Dear list, I would like to do some calculation using different grouping variables. My 'df' looks like this: # Some data set.seed(345) id <- seq(200,400, by=10) ids <- sample(substr(id,1,1)) group1 <- rep(1:3, each=7) group2 <- rep(1:2, c(10,11)) group3 <- rep(1:4, c(5,5,5,6)) df <- data.frame(

Re: [R] More appropriate optimization routine?

2011-03-08 Thread Dimitri Liakhovitski
Thnaks a lot, Ben. I really like your suggestion about taking the the log. I'll definitely play with optim - since it seems to work very fast. Actually, I did take a look at the function - I created a grid of function results for many different values of a crossed with many different values of b. T

Re: [R] More appropriate optimization routine?

2011-03-07 Thread Ben Bolker
Dimitri Liakhovitski gmail.com> writes: > I have 2 variables - predictor "pred" and response variable "DV": > > pred<-c(439635.053, 222925.718, 668434.755, 194242.330, 5786.321, 115537.344, > 100835.368, 7133.206, 159058.286, 4079991.629, 3380078.060, 2661279.136, > 2698324.478, 1245213.965, 19

[R] More appropriate optimization routine?

2011-03-07 Thread Dimitri Liakhovitski
Hello! I have 2 variables - predictor "pred" and response variable "DV": pred<-c(439635.053, 222925.718, 668434.755, 194242.330, 5786.321, 115537.344, 100835.368, 7133.206, 159058.286, 4079991.629, 3380078.060, 2661279.136, 2698324.478, 1245213.965, 1901815.503, 1517019.451, 1396857.736, 1034030

Re: [R] more boa plots questions

2011-03-03 Thread emj83
Can anyone help? Thanks in advance Emma -- View this message in context: http://r.789695.n4.nabble.com/more-boa-plots-questions-tp3330312p016.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:/

[R] more boa plots questions

2011-03-01 Thread emj83
I have MCMC output chains A and B for example, I want to produce trace plots for them using the boa command line... #loads boa boa.init() #reads in chains boa.chain.add(boa.importMatrix('A'), 'A') boa.chain.add(boa.importMatrix('B'), 'B') #plot trace plot problems arise here! I know I can get tra

Re: [R] More elegant magnitude method

2010-12-07 Thread Phil Spector
Jonathan - If I understand correctly, max(0,floor(log(x,10))) will return the value you want. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] More elegant magnitude method

2010-12-07 Thread Ravi Varadhan
Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Lorenz Sent: Tuesday, December 07, 2010 2:53 PM To: Jonathan P Daily Cc: r-help@r-project.org; r-help-boun...@r-project.org Subject: Re: [R] More elegant magnitude method Jonathan, I'd just r

Re: [R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
#x27;s the word... imbue it." - Jubal Early, Firefly David Winsemius wrote on 12/07/2010 02:50:34 PM: > [image removed] > > Re: [R] More elegant magnitude method > > David Winsemius > > to: > > Jonathan P Daily > > 12/07/2010 02:50 PM > &

Re: [R] More elegant magnitude method

2010-12-07 Thread David L Lorenz
Jonathan, I'd just return the integer part of the common log: floor(log10(x)) Dave From: Jonathan P Daily To: r-help@r-project.org Date: 12/07/2010 01:44 PM Subject: [R] More elegant magnitude method Sent by: r-help-boun...@r-project.org I have a need to find the order of number to

Re: [R] More elegant magnitude method

2010-12-07 Thread David Winsemius
On Dec 7, 2010, at 2:43 PM, Jonathan P Daily wrote: I have a need to find the order of number to get a scaling parameter as a power of 10. I have a function that works *so far*, but it is ugly and probably buggy. In the interest of avoiding code-based outliers in my data, I thought I would as

[R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
I have a need to find the order of number to get a scaling parameter as a power of 10. I have a function that works *so far*, but it is ugly and probably buggy. In the interest of avoiding code-based outliers in my data, I thought I would ask if anyone here has a better way. > scl <- function(x

Re: [R] more flexible "ave"

2010-11-30 Thread Charles C. Berry
On Tue, 30 Nov 2010, Adaikalavan Ramasamy wrote: Here is a possible solution using sweep instead of ave: df <- data.frame(site = c("a", "a", "a", "b", "b", "b"), gr = c("total", "x1", "x2", "x1", "total","x2"), value1 = c(212, 56, 87, 33, 456, 213),

Re: [R] more flexible "ave"

2010-11-30 Thread Adaikalavan Ramasamy
Here is a possible solution using sweep instead of ave: df <- data.frame(site = c("a", "a", "a", "b", "b", "b"), gr = c("total", "x1", "x2", "x1", "total","x2"), value1 = c(212, 56, 87, 33, 456, 213), value2 = c(1546, 560, 543, 234, 654,

[R] more flexible "ave"

2010-11-30 Thread Patrick Hausmann
Hi all, I would like to calculate the percent of the total per group for this data.frame: df <- data.frame(site = c("a", "a", "a", "b", "b", "b"), gr = c("total", "x1", "x2", "x1", "total","x2"), value1 = c(212, 56, 87, 33, 456, 213)) df calcPercent <- functi

Re: [R] More detail in chart axis?

2010-11-23 Thread Jim Lemon
On 11/23/2010 07:24 PM, Noah Silverman wrote: Hi, I have a series of data (about 80,000 pairs of x,y). Plotting it shows a great chart. However, R has randomly chosen about 6 labels for my x axis. Now, clearly I can't show them all, but would like some control over the granularity of what is

[R] More detail in chart axis?

2010-11-23 Thread Noah Silverman
Hi, I have a series of data (about 80,000 pairs of x,y). Plotting it shows a great chart. However, R has randomly chosen about 6 labels for my x axis. Now, clearly I can't show them all, but would like some control over the granularity of what is displayed. I can't find anything in the documen

Re: [R] more errors (behavior)

2010-10-24 Thread Ted Harding
On 24-Oct-10 19:55:12, ivo welch wrote: > quick programming question. I am not making enough errors in my > programs, so I want to trigger a few more. ;-) > > [1] undefined variable behavior: > >> d=data.frame( x=rnorm(1:10), y=rnorm(1:10)) >> z > Error: object 'z' not found >> d$z NULL > > is

[R] more errors (behavior)

2010-10-24 Thread ivo welch
quick programming question. I am not making enough errors in my programs, so I want to trigger a few more. ;-) [1] undefined variable behavior: > d=data.frame( x=rnorm(1:10), y=rnorm(1:10)) > z Error: object 'z' not found > d$z NULL is this consistent? I thought that z is the same as .GlobalE

Re: [R] more than two NA value names in my data

2010-09-30 Thread Joshua Wiley
Hi, You were on the right track with na.strings, from ?read.table na.strings: a character vector of strings which are to be interpreted as ‘NA’ values. Blank fields are also considered to be missing values in logical, integer, numeric and complex fields. so, you ca

[R] more than two NA value names in my data

2010-09-30 Thread JoonGi
my data(*.txt) has 1000 observations(numbers with no characters) of 5 variables. quite simple. However, NA values are quite tricky. this observer used more than two names for NA values; "." and "na" and more. 1. If I don't want to manipulate this raw data at all, how can I read this table? (

Re: [R] More accurate ODE solver?

2010-09-16 Thread Ben Bolker
Tianchan Niu isis.georgetown.edu> writes: > > Dear All, > > I was using rk4 and lsoda to solve a ODE system. However, both of them gave > bad accurate solutions, especially compared with Matlab solver ODE45. For > example, ODE45 gave solutions that can go to a stable level (about 1.6) when > ti

[R] More accurate ODE solver?

2010-09-16 Thread Tianchan Niu
Dear All, I was using rk4 and lsoda to solve a ODE system. However, both of them gave bad accurate solutions, especially compared with Matlab solver ODE45. For example, ODE45 gave solutions that can go to a stable level (about 1.6) when time goes to infinity, however, the solutions from lsoda are

[R] More accurate ODE solver?

2010-09-16 Thread Tianchan Niu
Dear All, I was using rk4 and lsoda to solve a ODE system. However, both of them gave bad accurate solutions, especially compared with Matlab solver ODE45. For example, ODE45 gave solutions that can go to a stable level (about 1.6) when time goes to infinity, however, the solutions from lsoda are

Re: [R] more questions on gam/gamm(mgcv)...

2010-08-22 Thread Simon Wood
On Wednesday 04 August 2010 20:05, Xia Li wrote: > Hi R-users, > > I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. > I'm new to this package...and just got more and more problems... > > 1. Can I include correlation and/or random effect into gam( ) also? or only > gamm( ) c

Re: [R] more questions on gam/gamm(mgcv)...

2010-08-05 Thread Gavin Simpson
> Hi R-users, > > I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. > I'm new to this package...and just got more and more problems... > > 1. Can I include correlation and/or random effect into gam( ) also? or > only > gamm( ) could be used? Only in gamm() > 2. I want to e

[R] more questions on gam/gamm(mgcv)...

2010-08-04 Thread Xia Li
Hi R-users, I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. I'm new to this package...and just got more and more problems... 1. Can I include correlation and/or random effect into gam( ) also? or only gamm( ) could be used? 2. I want to estimate the smoothing function s

Re: [R] ...more values follow?

2010-07-29 Thread Uwe Ligges
See ?options and its argument "max.print". Uwe Ligges On 28.07.2010 09:50, nero wrote: Hello! I´m playing arround with rJava... Always when i want to print(list), it only shows me the first values, and then (900534 more values follow)... How can i get shure, that all list-values are printed?

[R] ...more values follow?

2010-07-28 Thread nero
Hello! I´m playing arround with rJava... Always when i want to print(list), it only shows me the first values, and then (900534 more values follow)... How can i get shure, that all list-values are printed? what i´m doing wrong? -- View this message in context: http://r.789695.n4.nabble.com/m

Re: [R] More than two font in a plot

2010-06-30 Thread Jinsong Zhao
On 2010-6-30 16:24, Patrick Connolly wrote: On Wed, 30-Jun-2010 at 11:06AM +1200, Paul Murrell wrote: Hi On 6/30/2010 2:17 AM, Jinsong Zhao wrote: Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article ti

Re: [R] More than two font in a plot

2010-06-30 Thread Jinsong Zhao
On 2010-6-30 7:06, Paul Murrell wrote: Hi On 6/30/2010 2:17 AM, Jinsong Zhao wrote: Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article titled "Non-Standard Fonts in PostScript and PDF Graphics", especia

Re: [R] More than two font in a plot

2010-06-30 Thread Jinsong Zhao
On 2010-6-30 17:20, baptiste auguie wrote: Hi, Another option would be the tikzDevice package, which lets you process all the text of your plot with LaTeX. I think the XeTeX variant might be the most straight-forward to mix different fonts using this approach. HTH, baptiste Thank you very

Re: [R] More than two font in a plot

2010-06-30 Thread baptiste auguie
Hi, Another option would be the tikzDevice package, which lets you process all the text of your plot with LaTeX. I think the XeTeX variant might be the most straight-forward to mix different fonts using this approach. HTH, baptiste On 29 June 2010 16:17, Jinsong Zhao wrote: > Hi there, > > I

Re: [R] More than two font in a plot

2010-06-30 Thread Patrick Connolly
On Wed, 30-Jun-2010 at 11:06AM +1200, Paul Murrell wrote: > Hi > > On 6/30/2010 2:17 AM, Jinsong Zhao wrote: >> Hi there, >> >> I am a Chinese R user. I hope to display Chinese character in a plot, >> and than save it in PostScript format. I have read the article titled >> "Non-Standard Fonts in P

Re: [R] More than two font in a plot

2010-06-29 Thread Paul Murrell
Hi On 6/30/2010 2:17 AM, Jinsong Zhao wrote: Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article titled "Non-Standard Fonts in PostScript and PDF Graphics", especially the section about CJK fonts. I also

[R] More than two font in a plot

2010-06-29 Thread Jinsong Zhao
Hi there, I am a Chinese R user. I hope to display Chinese character in a plot, and than save it in PostScript format. I have read the article titled "Non-Standard Fonts in PostScript and PDF Graphics", especially the section about CJK fonts. I also tried the code: > pdf("chinese.pdf", width=3, h

  1   2   3   >