Re: [R] Max-Diff Package

2022-04-13 Thread Eric Berger
I have no experience with this but a Google search came up with CRAN support.BWS See https://cran.r-project.org/web/packages/support.BWS/index.html On Wed, Apr 13, 2022 at 4:37 PM Dr Cazhaow Qazaz wrote: > Hi All, > > Any recommendations for a R package to perform MaxDiff analysis? > > Thank y

[R] Max-Diff Package

2022-04-13 Thread Dr Cazhaow Qazaz
Hi All, Any recommendations for a R package to perform MaxDiff analysis? Thank you, Cazhaow Qazaz [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo

Re: [R] max size of a file that R can open to work

2019-06-06 Thread Jeff Newmiller
Technically "opening" a file does not involve reading it into memory at all, so any limits would arise from the OS. As for "reading" the file, the amount of virtual memory [1] is the key factor, but different file formats can require more or less overhead memory to parse the data. Also, differe

[R] max size of a file that R can open to work

2019-06-05 Thread Ricardo Lopez
Hello, I´d like to ask you if the max size of a file that R can open or import to work depends of the memory RAM?? or has other restriction??? Thank you very much [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To

Re: [R] max and pmax of NA and NaN

2018-01-20 Thread peter dalgaard
> On 20 Jan 2018, at 07:53 , Suharto Anggono Suharto Anggono via R-help > wrote: > > Extremes.Rd, that documents 'max' and 'pmax', has this in "Details" section, > in the paragraph before the last. > By definition the min/max of a numeric vector containing an NaN is NaN, > except that the

Re: [R] max and pmax of NA and NaN

2018-01-19 Thread Suharto Anggono Suharto Anggono via R-help
Extremes.Rd, that documents 'max' and 'pmax', has this in "Details" section, in the paragraph before the last. By definition the min/max of a numeric vector containing an NaN is NaN, except that the min/max of any vector containing an NA is NA even if it also contains an NaN. --

Re: [R] max and pmax of NA and NaN

2018-01-15 Thread Martin Maechler
> Michal Burda > on Mon, 15 Jan 2018 12:04:13 +0100 writes: > Dear R users, is the following OK? >> max(NA, NaN) > [1] NA >> max(NaN, NA) > [1] NA >> pmax(NaN, NA) > [1] NA >> pmax(NA, NaN) > [1] NaN > ...or is it a bug? > Documentation

[R] max and pmax of NA and NaN

2018-01-15 Thread Michal Burda
Dear R users, is the following OK? > max(NA, NaN) [1] NA > max(NaN, NA) [1] NA > pmax(NaN, NA) [1] NA > pmax(NA, NaN) [1] NaN ...or is it a bug? Documentation says that NA has a higher priority over NaN. Best regards, Michal Burda [[alternative HTML version deleted]] ___

Re: [R] Max characters from deparse(substitute(.))?

2014-05-05 Thread Spencer Graves
On 5/5/2014 3:42 PM, William Dunlap wrote: Have you looked at the width.cutoff and nlines arguments to deparse? width.cutoff controls how long a line can be and it quits producing output (saving time and space) after nlines of output are produced. You want essentially the following f0 <- func

Re: [R] Max characters from deparse(substitute(.))?

2014-05-05 Thread William Dunlap
Have you looked at the width.cutoff and nlines arguments to deparse? width.cutoff controls how long a line can be and it quits producing output (saving time and space) after nlines of output are produced. You want essentially the following f0 <- function(x, maxChar=20) deparse(x, width.cutoff=ma

[R] Max characters from deparse(substitute(.))?

2014-05-05 Thread Spencer Graves
Is there a standard or or a standard utility to limit the size of deparse(substitute(.))? Below please find an example of the problem plus one solution. If another solution already exists, I might prefer to use it. Thanks, Spencer ## ## Problem ## deparse.x0 <-

Re: [R] Max/min problems in multivariate calculus

2013-08-28 Thread Bert Gunter
Homework? We don't do homework here... -- Bert On Wed, Aug 28, 2013 at 10:02 AM, Edoardo Baldoni wrote: > Dear R-help, > > I would like to ask you how to find the critical points of a function of > several variables such as the following one: > > x = seq(-10,10,0.2) > y = seq(-10,10,0.2) > z

[R] Max/min problems in multivariate calculus

2013-08-28 Thread Edoardo Baldoni
Dear R-help, I would like to ask you how to find the critical points of a function of several variables such as the following one: x = seq(-10,10,0.2) y = seq(-10,10,0.2) zfunc = function(x,y) x^2 + y^2 z = outer(x,y,zfunc) persp(x,y,z,theta = 30,phi=1,ticktype='detailed') Thanks Edoardo

Re: [R] max length of a factor variable

2013-05-17 Thread bennose
Technically this is correct for raw R functionality. in practice various modules impose their own limits on variables so you have to check. For example the coxreg package truncates all variables to 16 characters. for example the test below > res Call: coxreg(formula = Surv(vtime, vstatus) ~ abcde

[R] Max width and height

2013-04-08 Thread Eva Prieto Castro
Dear all, How can I calculate (in runtime) the max width and height I can use in order to avoid the content in graphics window appears truncate?. In Windows I can avoid it (using windows(width=my.width, height=my.height, rescale="fixed") because the value "fixed" in rescale makes the scroll bar

Re: [R] max row

2013-03-09 Thread arun
HI, Using c11<- 0.01 c12<- 0.01 c1<- 0.10 c2<- 0.10 One possible problem is that: dim(res5) #[1] 513  20 res6<-aggregate(.~m1+n1+m+n,data=res5[,c(1:6,9:12,21:24)] ,max) #Error in `[.data.frame`(res5, , c(1:6, 9:12, 21:24)) :  # undefined columns selected A.K. ___

Re: [R] Max value of each 2 rows in dataframe

2013-02-13 Thread zuzana zajkova
16001 5500519 > #20 ok 2010-01-15 06:19:59 40193.51 64 17016001 5500519 > > #If you need a rolling max, > library(zoo) > rollapply(A$lig,2,max,align="right",fill=NA) > #[1] NA 64 64 44 32 22 13 4 8 8 0 45 64 64 64 64 64 64 51 64 > > > A.K. > > >

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread arun
y(zoo) rollapply(A$lig,2,max,align="right",fill=NA)  #[1] NA 64 64 44 32 22 13  4  8  8  0 45 64 64 64 64 64 64 51 64   A.K. - Original Message - From: zuzana zajkova To: Rui Barradas Cc: r-help@r-project.org Sent: Tuesday, February 12, 2013 6:53 PM Subject: Re: [R] M

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread zuzana zajkova
Hi, sorry for not useable data... When I tried to use the dput function to the dataframe let's call it A, had some problems with the time and clock variables... however I attach an other dataframe B, which is created by merging A with other dataframe. The B dataframe has a little different struct

Re: [R] Max value of each 2 rows in dataframe

2013-02-12 Thread Rui Barradas
Hello, Your data example is a mess. Can't you please use ?dput to post it? Supposing your data is named 'dat', use dput(head(dat, 20)) # Paste the output of this in a post Hope this helps, Rui Barradas Em 12-02-2013 15:30, zuzana zajkova escreveu: Hello, I would like to ask you for help

[R] Max value of each 2 rows in dataframe

2013-02-12 Thread zuzana zajkova
Hello, I would like to ask you for help. I have quite a big dataframe (119 313 rows), this is a part of it: "jul" "ind" "time" "secs" "geo" "act" "lig" "date.x" "clock" "h" "m" "s" "d" "mo" "y" "dtime" "land" "date.y" "sriseIC" "ssetIC" "dssetIC" "dsriseIC" "1207" 14628 5500519 2010-01-19 15:14:5

Re: [R] max & summary contradict each other

2012-09-28 Thread arun
Hi, Try this: summary(x,digits=max(5)) #   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.   #  1.0  6901.5 13802.0 13802.0 20702.0 27603.0 A.K. - Original Message - From: Sam Steingold To: r-help@r-project.org Cc: Sent: Friday, September 28, 2012 12:14 PM Subject: [R] max & sum

Re: [R] max & summary contradict each other

2012-09-28 Thread Duncan Murdoch
On 28/09/2012 12:14 PM, Sam Steingold wrote: why does summary report max 27600 and not 27603? > x <- c(27603, 1) > max(x) [1] 27603 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 16902 13800 13800 20700 27600 Because you asked for 3 digit accuracy. See ?summ

[R] max & summary contradict each other

2012-09-28 Thread Sam Steingold
why does summary report max 27600 and not 27603? > x <- c(27603, 1) > max(x) [1] 27603 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 16902 13800 13800 20700 27600 -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.chi

Re: [R] max value

2012-05-17 Thread Petr PIKAL
Hi > > On 2012-05-15 08:36, Melissa Rosenkranz wrote: > > Here is an R problem I am struggling with: > > My dataset is organized like this... > > > > subject sessionvariable_x variable_y > > 01 11 > > 01 1

Re: [R] max value

2012-05-15 Thread Peter Ehlers
On 2012-05-15 08:36, Melissa Rosenkranz wrote: Here is an R problem I am struggling with: My dataset is organized like this... subject sessionvariable_x variable_y 01 11 01 12 01 1

[R] max value

2012-05-15 Thread Melissa Rosenkranz
Here is an R problem I am struggling with: My dataset is organized like this... subject sessionvariable_x variable_y 01 11 01 12 01 13 01 2

Re: [R] Max value of an integer

2012-01-11 Thread Mikko Korpela
On 01/11/2012 12:01 PM, Rui Esteves wrote: > Is there any constant that represents the maximum value of an integer? Yes, there is (assuming you refer to the 'integer' type). See ?.Machine. > .Machine$integer.max [1] 2147483647 > as.integer(2147483647) [1] 2147483647 > as.integer(2147483648) [1]

Re: [R] Max value of an integer

2012-01-11 Thread Berend Hasselman
rmx wrote > > Hi. > Is there any constant that represents the maximum value of an integer? > If I need to setup by myself what is the maximum value? > ?.Machine i.e. .Machine$integer.max Berend -- View this message in context: http://r.789695.n4.nabble.com/Max-value-of-an-integer-tp428495

[R] Max value of an integer

2012-01-11 Thread Rui Esteves
Hi. Is there any constant that represents the maximum value of an integer? If I need to setup by myself what is the maximum value? Best, Rui __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] max & min values within dataframe

2011-11-14 Thread B Laura
Thanks for these various tips. Sarah, this is not a howework, but a simplified dataset speecificly for this question. Laura . 2011/11/14 Dennis Murphy > Groupwise data summarization is a very common task, and it is worth > learning the various ways to do it in R. Josh showed you one way to > u

Re: [R] max & min values within dataframe

2011-11-14 Thread Dennis Murphy
Groupwise data summarization is a very common task, and it is worth learning the various ways to do it in R. Josh showed you one way to use aggregate() from the base package and Michael showed you one way of using the plyr package to do the same; another way would be ddply(df, .(Patient, Region),

Re: [R] max & min values within dataframe

2011-11-14 Thread R. Michael Weylandt
I took a stab at this using ddply() from the plyr package. How's this look to you? x<- textConnection("Col Patient Region Score Time 11 X19 28 21 X20 126 31 X22 100 41 X25 191 52 Y121 62 Y

Re: [R] max & min values within dataframe

2011-11-14 Thread Joshua Wiley
Hi Laura, You were close. Just use range() instead of min/max: ## your data (read in and then pasted the output of dput() to make it easy) dat <- structure(list(Patient = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L,

Re: [R] max & min values within dataframe

2011-11-14 Thread Sarah Goslee
Hi Laura, This looks suspiciously like homework. Nonetheless, you may wish to check out ?cbind. Sarah On Mon, Nov 14, 2011 at 11:10 AM, B Laura wrote: > dear R-team > > I need to find the min, max values for each patient from dataset and keep > the output of it as a dataframe with the following

[R] max & min values within dataframe

2011-11-14 Thread B Laura
dear R-team I need to find the min, max values for each patient from dataset and keep the output of it as a dataframe with the following columns - Patient nr - Region (remains same per patient) - Min score - Max score Patient Region Score Time 11 X19 28 21

Re: [R] Max within groups

2011-07-16 Thread David Winsemius
On Jul 16, 2011, at 9:55 AM, Thomas Chesney wrote: I know there's a really easy way to do this but I just can't track it down. I experimented with various apply functions but couldn't get it quite right. I have a matrix like this: 1, 16 1, 23 1, 21 1, 6 1, 25 2, 4 2, 17 2, 45 2, 11 2, 20

[R] Max within groups

2011-07-16 Thread Thomas Chesney
I know there's a really easy way to do this but I just can't track it down. I experimented with various apply functions but couldn't get it quite right. I have a matrix like this: 1, 16 1, 23 1, 21 1, 6 1, 25 2, 4 2, 17 2, 45 2, 11 2, 20 and I'd like to find the max value in Column 2 (or the in

Re: [R] max possible rsquare

2011-07-13 Thread Uwe Ligges
On 13.07.2011 14:42, Rilana Prenger wrote: Dear all, I have a question regarding the output of the coxph function. What does the 'max possible' exactly mean in the output below? Many thanks. coef exp(coef) se(coef) robust se z Pr(>|z|) smocc_zyban -0.43840.6451

[R] max possible rsquare

2011-07-13 Thread Rilana Prenger
Dear all, I have a question regarding the output of the coxph function. What does the 'max possible' exactly mean in the output below? Many thanks. coef exp(coef) se(coef) robust se z Pr(>|z|) smocc_zyban -0.43840.6451 0.86670.9473 -0.4630.644 self

Re: [R] max length of a factor variable

2010-09-28 Thread Richard Mott
Thanks I eventually tracked down the problem to something unrelated to this question (one out of the millions of character strings happened to be "NA" by chance, which of course was parsed as a missing value, breaking the code a long way downstream.) Richard On 28/09/2010 04:01, Michael

Re: [R] max length of a factor variable

2010-09-27 Thread jim holtman
You have provided no information as to what you mean by "my analysis fails". Exactly what error message are you getting, what operation system do you have, how much memory do you have, how much are you using for all the other objects in your address space, etc.. Information like this would hel

Re: [R] max length of a factor variable

2010-09-27 Thread Michael Bedward
Hello Richard, Since no one else has answered yet I'll venture a guess. The following works on my little macbook... x <- as.factor(sapply(letters[1:26], function(x) paste(rep(x, 10), collapse=""))) So each of the 26 factor levels in x has a string representation of 100,000 chars. So I'm *g

[R] max length of a factor variable

2010-09-27 Thread Richard Mott
Hi Is there a maximum length for the character string representing a level of a factor? I have a set of several million variables, each a factor of length 19. Each factor level is a character string which in some cases can be many thousands of characters long. I am trying to find out why my

Re: [R] max limit of list size and vector size?

2010-09-06 Thread jim holtman
It is easy to store a list of that size: > x <- list(1:1e6, 1:1e6, 1:1e6) > object.size(x) 12000112 bytes > str(x) List of 3 $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... $ : int [1:100] 1 2 3 4 5 6 7 8 9 10 ... Now it really depends on how you a

[R] max limit of list size and vector size?

2010-09-06 Thread raje...@cse.iitm.ac.in
Hi, Is it possible for me to store a list of vectors of 1 million entries? like, cc<-list(c(1,2,1million),c(1,2,1million)) also what is the length of the longest string in R? I keep getting info from a socket and keep pasting on a string...when will this start becoming a pr

Re: [R] max number from a list of numbers

2010-05-20 Thread Ted Harding
On 20-May-10 19:29:31, Jonathan wrote: > Hi all, > I'm hoping this question has a simple answer, but I can't find it > through searching or trying commands. > > I have a list of numeric vectors called 'husk'. I'd just like to > treat the set of all numbers from all vectors in the list as if > it w

Re: [R] max number from a list of numbers

2010-05-20 Thread Joshua Wiley
Hello Jonathan, Look at ?sapply Does something like this do what you want? max(sapply(yourlist, max)) Josh On Thu, May 20, 2010 at 12:29 PM, Jonathan wrote: > Hi all, >   I'm hoping this question has a simple answer, but I can't find it through > searching or trying commands. > > I have a li

Re: [R] max number from a list of numbers

2010-05-20 Thread Erik Iverson
You have a list that you want to treat as a vector, so ?unlist it. Jonathan wrote: Hi all, I'm hoping this question has a simple answer, but I can't find it through searching or trying commands. I have a list of numeric vectors called 'husk'. I'd just like to treat the set of all numbers fr

Re: [R] max number from a list of numbers

2010-05-20 Thread Bryan Hanson
I think you want unlist with recursive = TRUE, see ?unlist. Bryan * Bryan Hanson Acting Chair Professor of Chemistry & Biochemistry DePauw University, Greencastle IN USA On 5/20/10 3:29 PM, "Jonathan" wrote: > Hi all, >I'm hoping this question has a simple answer, but I can't

[R] max number from a list of numbers

2010-05-20 Thread Jonathan
Hi all, I'm hoping this question has a simple answer, but I can't find it through searching or trying commands. I have a list of numeric vectors called 'husk'. I'd just like to treat the set of all numbers from all vectors in the list as if it were one large vector, because I'd like to extract

Re: [R] max and in the zoo package

2010-02-13 Thread Gabor Grothendieck
Try this: > library(zoo) > set.seed(1) > z <- zoo(rnorm(100), as.Date(0) + 1:100) > mx <- z[which.max(z)]; mx 1970-03-03 2.401618 > coredata(mx) [1] 2.401618 > time(mx) [1] "1970-03-03" On Sat, Feb 13, 2010 at 3:39 PM, Edouard Tallent wrote: > hi everyone. > i am dealing on a zoo-class object.

[R] max and in the zoo package

2010-02-13 Thread Edouard Tallent
hi everyone. i am dealing on a zoo-class object.i am aware of the 'min' and 'max' function to get the minimum and the maximum values.getting these maximum and minimum values is ont thing.but, how to get the (zoo) dates these values occur ? in fact, in analysing a time series i am interested in th

Re: [R] ?max (so far...)

2009-07-13 Thread Erich Neuwirth
Belated answer: A few remarks regarding your questions: Your running max problem could be solved in the following way: (which is a soution based o Duncan Murdoch's suggestion, but a little bit more general. foldOrbit<-function(x,fun){ res<-numeric(length(x)) res[1]<-x[1]

Re: [R] ?max (so far...)

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 9:10 PM, Carl Witthoft wrote: > More generally, you can always write a loop. They aren't necesssrily fast > or elegant, but they're pretty general. For example, to calculate the max > of the previous 50 observations (or fewer near the start of a vector), you > could do >

Re: [R] ?max (so far...)

2009-07-01 Thread Petr PIKAL
Hi what about do inside some function a subset of your whole data frame fff <- function( data, rows) { data.1 <- data[1:rows,] get all necessary stuf on data.1 return what you want } You can put a dimension check if you want the function to be more robust Regards Petr r-help-boun...@r-pr

[R] ?max (so far...)

2009-07-01 Thread Carl Witthoft
> More generally, you can always write a loop. They aren't necesssrily fast > or elegant, but they're pretty general. For example, to calculate the max > of the previous 50 observations (or fewer near the start of a vector), you > could do > > x <- ... some vector ... > > result <- numeric(le

Re: [R] ?max (so far...)

2009-07-01 Thread baptiste auguie
For another generic approach, you might be interested in the Reduce function, rolling <- function( x, window=seq_along(x), f=max){ Reduce(f, x[window]) } x= c(1:10, 2:10, 15, 1) rolling(x) #15 rolling(x, 1:10) #10 rolling(x, 1:12) #10 Of course this is only part of the solution to the

Re: [R] ?max (so far...)

2009-07-01 Thread Mark Knecht
On Wed, Jul 1, 2009 at 12:54 PM, Duncan Murdoch wrote: > On 01/07/2009 1:26 PM, Mark Knecht wrote: >> >> On Wed, Jul 1, 2009 at 9:39 AM, Duncan Murdoch >> wrote: >>> >>> On 01/07/2009 11:49 AM, Mark Knecht wrote: Hi,  I have a data.frame that is date ordered by row number - earliest

Re: [R] ?max (so far...)

2009-07-01 Thread Duncan Murdoch
On 01/07/2009 1:26 PM, Mark Knecht wrote: On Wed, Jul 1, 2009 at 9:39 AM, Duncan Murdoch wrote: On 01/07/2009 11:49 AM, Mark Knecht wrote: Hi, I have a data.frame that is date ordered by row number - earliest date first and most current last. I want to create a couple of new columns that show

Re: [R] ?max (so far...)

2009-07-01 Thread Mark Knecht
On Wed, Jul 1, 2009 at 9:39 AM, Duncan Murdoch wrote: > On 01/07/2009 11:49 AM, Mark Knecht wrote: >> >> Hi, >>   I have a data.frame that is date ordered by row number - earliest >> date first and most current last. I want to create a couple of new >> columns that show the max and min values from

Re: [R] ?max (so far...)

2009-07-01 Thread Duncan Murdoch
On 01/07/2009 11:49 AM, Mark Knecht wrote: Hi, I have a data.frame that is date ordered by row number - earliest date first and most current last. I want to create a couple of new columns that show the max and min values from other columns *so far* - not for the whole data.frame. It seems

[R] ?max (so far...)

2009-07-01 Thread Mark Knecht
Hi, I have a data.frame that is date ordered by row number - earliest date first and most current last. I want to create a couple of new columns that show the max and min values from other columns *so far* - not for the whole data.frame. It seems this sort of question is really coming from m

[R] max-nsize, cons : what do they all mean?

2009-03-10 Thread Saptarshi Guha
quite understand it. What does the option do and why did I initially run into an error ? >From man R --max-nsize Set max number of cons cells to N Why should there be a maximum? Thanks for your time Saptarshi Guha __ R-help@r-project.org mail

Re: [R] max and min with the indexes in a zoo object (or anything else that could solve the problem)

2008-08-21 Thread Gabor Grothendieck
Perform rollapply over the index rather than the series itself: The result, sin.mx is a zoo series with three columns: the original series, the series of maxima and their index into the original series. library(zoo) library(chron) t1 <- chron("1/1/2006", "00:00:00") t2 <- chron("1/31/2006", "23:

[R] max and min with the indexes in a zoo object (or anything else that could solve the problem)

2008-08-21 Thread stephen sefick
library(zoo) library(chron) t1 <- chron("1/1/2006", "00:00:00") t2 <- chron("1/31/2006", "23:45:00") deltat <- times("00:15:00") tt <- seq(t1, t2, by = times("00:15:00")) d <- sample(33:700, 2976, replace=TRUE) sin.zoo <- zoo(d,tt) #there are ninety six reading in a day d.max <- rollapply(sin.zoo,

Re: [R] max size of a matrix

2008-08-05 Thread Prof Brian Ripley
On Tue, 5 Aug 2008, rostam shahname wrote: Hi R users, I am trying to create a matrix, but R has problem with the size of dim, wondering if there is anything that I can do? No. See ?"Memory-limts", and consider a sparse matrix (e.g. package Matrix). Had this worked 'a' would have used 8*14

Re: [R] max size of a matrix

2008-08-05 Thread Henrik Bengtsson
Are you aware that that matrix will have 147456^2 elements each of size 8 bytes ("double") resulting in R trying to allocate (147456^2)*8/1024^3 = 162 GB of RAM? If you are aware of this and still trying to allocate a large matrix, it is unfortunately too large due to "technical" limitations in R.

[R] max size of a matrix

2008-08-05 Thread rostam shahname
Hi R users, I am trying to create a matrix, but R has problem with the size of dim, wondering if there is anything that I can do? > a <- diag(147456) Error in array(0, c(n, p)) : 'dim' specifies too large an array Thanks for your help Rostam [[alternative HTML version deleted]]

[R] max

2008-07-29 Thread Paul Adams
Hello everyone, I have a vector of p-values and I am trying to find the max for the vector and add it to a list.I am using a loop to loop through 50 times.I have used the following code but it does not pick out the max and add to the list.Any help would be appreciated.   w<-c(v[[1]][3],v[[2]][3]

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Phil Spector
I believe the original poster was looking for runs of consecutive values. Here's a generalization of Tony's solution: findlong = function(seq){ rr = rle(seq) lens = rr$length lens[rr$value == FALSE] = 0 ll = which.max(lens) start = cumsum(c(1,rr$length))[ll] list(start=st

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Tony Plate
If the increases or decreases could be any size, rle(sign(diff(x))) could do it: > x <- c(1, 2, 3, 4, 4, 4, 5, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1) > r <- rle(sign(diff(x))) > r Run Length Encoding lengths: int [1:5] 3 2 2 5 4 values : num [1:5] 1 0 1 -1 0 > i1 <- which(r$lengths==max(r$lengths[r$v

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Marko Milicic
Hi Erik, If you look at first 4 numbers, you will se that there was one increase between first and second number (1 and 2), immediatly after that increase, there is an increase between second and third number (2 and 3) and finaly third consecutive increse between third and fourth number (3 and 4).

Re: [R] Max consecutive increase in sequence

2008-05-13 Thread Ingmar Visser
rle(diff(sq)) could be helpful here, best, Ingmar On May 13, 2008, at 11:19 PM, Marko Milicic wrote: Hi all R helpers, I'm trying to comeup with nice and elegant way of "detecting" consecutive increases/decreases in the sequence of numbers. I'm trying with combination of which() and diff(

[R] Max consecutive increase in sequence

2008-05-13 Thread Marko Milicic
Hi all R helpers, I'm trying to comeup with nice and elegant way of "detecting" consecutive increases/decreases in the sequence of numbers. I'm trying with combination of which() and diff() functions but unsuccesifuly. For example: sq <- c(1, 2, 3, 4, 4, 4, 5, 6, 5, 4, 3, 2, 1, 1, 1, 1, 1); I'd

[R] R: max() and min() functions not found

2007-11-27 Thread Millo Giovanni
areless posting as well :^) Cheers, Giovanni -Messaggio originale- Da: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Inviato: martedì 27 novembre 2007 18:54 A: Millo Giovanni Cc: r-help@r-project.org Oggetto: Re: [R] max() and min() functions not found You have a rogue package loaded in

Re: [R] max() and min() functions not found

2007-11-27 Thread Prof Brian Ripley
You have a rogue package loaded into your session, one that was installed for R < 2.6.0. The R posting guide asked for For questions about unexpected behavior or a possible bug, you should, at a minimum, copy and paste the output from sessionInfo() into your message. and that would hav

Re: [R] max() and min() functions not found

2007-11-27 Thread Uwe Ligges
I guess you have some library in the search path that includes a base package of an outdated R installation. Uwe Ligges Millo Giovanni wrote: > Dear List, > > I just installed R 2.6.1 (on Win2K) and I get a strange error in > functions min() and max(): > >> min(1:3) > Errore in .Internal(min

[R] max() and min() functions not found

2007-11-27 Thread Millo Giovanni
Dear List, I just installed R 2.6.1 (on Win2K) and I get a strange error in functions min() and max(): > min(1:3) Errore in .Internal(min(..., na.rm = na.rm)) : nessuna funzione interna "min" which, as you may have guessed, means 'no internal function "min" '. The same happens for max(). May