Re: [R] limits on liniar model
It is hard to prove a negative, but to the best of my knowledge lm will not do what you want. This does not mean there is not a function that will perform your analyses; the sort of thing you want to do is often accomplished using non-linear methods. John >>> ראובן אברמוביץ 8/3/2011 12:00:04 PM >>> Can I put limits on the lm() command? I only know that you can choose a liniar model with or without an intercept, but can I put other limits on the coefficients (for example- the intercept must be bigger than 1) ? _ Walla! Mail - [1]Get your free unlimited mail today References 1. http://www.walla.co.il/ Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits on liniar model
Please use R's search capabilities before posting. RSiteSearch("Linear Model with Constraints") appears to give you what you're looking for. Incidentally, with constraints, the model is no longer linear, I believe. -- Bert 2011/8/3 ראובן אברמוביץ : > > Can I put limits on the lm() command? I only know that you can choose a > liniar model with or without an intercept, but can I put other limits on > the coefficients (for example- the intercept must be bigger than 1) ? > > _ > > Walla! Mail - [1]Get your free unlimited mail today > > References > > 1. http://www.walla.co.il/ > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > -- "Men by nature long to get on to the ultimate truths, and will often be impatient with elementary studies or fight shy of them. If it were possible to reach the ultimate truths without the elementary studies usually prefixed to them, these would not be preparatory studies but superfluous diversions." -- Maimonides (1135-1204) Bert Gunter Genentech Nonclinical Biostatistics __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
I sometimes have to work with vectors/matrices with > 2^31 - 1 elements. I have found the bigmemory package to be of great help. My lab is also going to learn sqldf package for getting bits of big data into/out of R. Learning both of those packages should help you work with large datasets in R. That said, I still hold out hope that someday, the powers that be - or some hotshot operation like R+ or Revolutions - will see that increasing numbers of users will routinely need to access > 2^31-1 elements, and that the packages above are a band-aid on a deeper issue: using such large datasets with ease in R. As of now, it remains quite awkward. Matt On Tue, Aug 3, 2010 at 12:32 PM, Duncan Murdoch wrote: > On 03/08/2010 2:28 PM, Dimitri Liakhovitski wrote: >> >> And once one above the limit that Jim indicated - is there anything one >> can do? >> > > Yes, there are several packages for handling datasets that are too big to > fit in memory: biglm, ff, etc. You need to change your code to work with > them, so it's a lot of work to do something unusual, but there are > possibilities. > > Duncan Murdoch > >> Thank you! >> Dimitri >> >> >> On Tue, Aug 3, 2010 at 2:12 PM, Dimitri Liakhovitski >> wrote: >> > Thanks a lot, it's very helpful! >> > Dimitri >> > >> > On Tue, Aug 3, 2010 at 1:53 PM, Duncan Murdoch >> > wrote: >> >> On 03/08/2010 1:10 PM, Dimitri Liakhovitski wrote: >> >>> >> >>> I understand the question I am about to ask is rather vague and >> >>> depends on the task and my PC memory. However, I'll give it a try: >> >>> >> >>> Let's assume the goal is just to read in the data frame into R and >> >>> then do some simple analyses with it (e.g., multiple regression of >> >>> some variables onto some - just a few - variables). >> >>> >> >>> Is there a limit to the number of columns of a data frame that R can >> >>> handle? I am asking because where I work many use SAS and they are >> >>> running into the limit of >~13,700columns there. >> >>> >> >>> Since I am asking - is there a limit to the number of rows? >> >>> >> >>> Or is the correct way of asking the question: my PC's memory is X. The >> >>> .txt tab-delimited file I am trying to read in has the size of YYY Mb, >> >>> can I read it in? >> >>> >> >> >> >> Besides what Jim said, there is a 2^31-1 limit on the number of >> >> elements in >> >> a vector. Dataframes are vectors of vectors, so you can have at most >> >> 2^31-1 >> >> rows and 2^31-1 columns. Matrices are vectors, so they're limited to >> >> 2^31-1 >> >> elements in total. >> >> This is only likely to be a limitation on a 64 bit machine; in 32 bits >> >> you'll run out of memory first. >> >> >> >> Duncan Murdoch >> >> >> > >> > >> > >> > -- >> > Dimitri Liakhovitski >> > Ninah Consulting >> > www.ninah.com >> > >> >> >> >> > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Matthew C Keller Asst. Professor of Psychology University of Colorado at Boulder www.matthewckeller.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
On 03/08/2010 2:28 PM, Dimitri Liakhovitski wrote: And once one above the limit that Jim indicated - is there anything one can do? Yes, there are several packages for handling datasets that are too big to fit in memory: biglm, ff, etc. You need to change your code to work with them, so it's a lot of work to do something unusual, but there are possibilities. Duncan Murdoch Thank you! Dimitri On Tue, Aug 3, 2010 at 2:12 PM, Dimitri Liakhovitski wrote: > Thanks a lot, it's very helpful! > Dimitri > > On Tue, Aug 3, 2010 at 1:53 PM, Duncan Murdoch wrote: >> On 03/08/2010 1:10 PM, Dimitri Liakhovitski wrote: >>> >>> I understand the question I am about to ask is rather vague and >>> depends on the task and my PC memory. However, I'll give it a try: >>> >>> Let's assume the goal is just to read in the data frame into R and >>> then do some simple analyses with it (e.g., multiple regression of >>> some variables onto some - just a few - variables). >>> >>> Is there a limit to the number of columns of a data frame that R can >>> handle? I am asking because where I work many use SAS and they are >>> running into the limit of >~13,700columns there. >>> >>> Since I am asking - is there a limit to the number of rows? >>> >>> Or is the correct way of asking the question: my PC's memory is X. The >>> .txt tab-delimited file I am trying to read in has the size of YYY Mb, >>> can I read it in? >>> >> >> Besides what Jim said, there is a 2^31-1 limit on the number of elements in >> a vector. Dataframes are vectors of vectors, so you can have at most 2^31-1 >> rows and 2^31-1 columns. Matrices are vectors, so they're limited to 2^31-1 >> elements in total. >> This is only likely to be a limitation on a 64 bit machine; in 32 bits >> you'll run out of memory first. >> >> Duncan Murdoch >> > > > > -- > Dimitri Liakhovitski > Ninah Consulting > www.ninah.com > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
And once one above the limit that Jim indicated - is there anything one can do? Thank you! Dimitri On Tue, Aug 3, 2010 at 2:12 PM, Dimitri Liakhovitski wrote: > Thanks a lot, it's very helpful! > Dimitri > > On Tue, Aug 3, 2010 at 1:53 PM, Duncan Murdoch > wrote: >> On 03/08/2010 1:10 PM, Dimitri Liakhovitski wrote: >>> >>> I understand the question I am about to ask is rather vague and >>> depends on the task and my PC memory. However, I'll give it a try: >>> >>> Let's assume the goal is just to read in the data frame into R and >>> then do some simple analyses with it (e.g., multiple regression of >>> some variables onto some - just a few - variables). >>> >>> Is there a limit to the number of columns of a data frame that R can >>> handle? I am asking because where I work many use SAS and they are >>> running into the limit of >~13,700columns there. >>> >>> Since I am asking - is there a limit to the number of rows? >>> >>> Or is the correct way of asking the question: my PC's memory is X. The >>> .txt tab-delimited file I am trying to read in has the size of YYY Mb, >>> can I read it in? >>> >> >> Besides what Jim said, there is a 2^31-1 limit on the number of elements in >> a vector. Dataframes are vectors of vectors, so you can have at most 2^31-1 >> rows and 2^31-1 columns. Matrices are vectors, so they're limited to 2^31-1 >> elements in total. >> This is only likely to be a limitation on a 64 bit machine; in 32 bits >> you'll run out of memory first. >> >> Duncan Murdoch >> > > > > -- > Dimitri Liakhovitski > Ninah Consulting > www.ninah.com > -- Dimitri Liakhovitski Ninah Consulting www.ninah.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
Thanks a lot, it's very helpful! Dimitri On Tue, Aug 3, 2010 at 1:53 PM, Duncan Murdoch wrote: > On 03/08/2010 1:10 PM, Dimitri Liakhovitski wrote: >> >> I understand the question I am about to ask is rather vague and >> depends on the task and my PC memory. However, I'll give it a try: >> >> Let's assume the goal is just to read in the data frame into R and >> then do some simple analyses with it (e.g., multiple regression of >> some variables onto some - just a few - variables). >> >> Is there a limit to the number of columns of a data frame that R can >> handle? I am asking because where I work many use SAS and they are >> running into the limit of >~13,700columns there. >> >> Since I am asking - is there a limit to the number of rows? >> >> Or is the correct way of asking the question: my PC's memory is X. The >> .txt tab-delimited file I am trying to read in has the size of YYY Mb, >> can I read it in? >> > > Besides what Jim said, there is a 2^31-1 limit on the number of elements in > a vector. Dataframes are vectors of vectors, so you can have at most 2^31-1 > rows and 2^31-1 columns. Matrices are vectors, so they're limited to 2^31-1 > elements in total. > This is only likely to be a limitation on a 64 bit machine; in 32 bits > you'll run out of memory first. > > Duncan Murdoch > -- Dimitri Liakhovitski Ninah Consulting www.ninah.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
On 03/08/2010 1:10 PM, Dimitri Liakhovitski wrote: I understand the question I am about to ask is rather vague and depends on the task and my PC memory. However, I'll give it a try: Let's assume the goal is just to read in the data frame into R and then do some simple analyses with it (e.g., multiple regression of some variables onto some - just a few - variables). Is there a limit to the number of columns of a data frame that R can handle? I am asking because where I work many use SAS and they are running into the limit of >~13,700columns there. Since I am asking - is there a limit to the number of rows? Or is the correct way of asking the question: my PC's memory is X. The .txt tab-delimited file I am trying to read in has the size of YYY Mb, can I read it in? Besides what Jim said, there is a 2^31-1 limit on the number of elements in a vector. Dataframes are vectors of vectors, so you can have at most 2^31-1 rows and 2^31-1 columns. Matrices are vectors, so they're limited to 2^31-1 elements in total. This is only likely to be a limitation on a 64 bit machine; in 32 bits you'll run out of memory first. Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits of a data frame size for reading into R
You probably don't want an object that is larger than about 25% of the physical memory so that copies can be made during some processing. If you are running on a 32-bit system which will limit you to at most 3GB of memory, then your largest object should not be greater than 800MB. If you want to have 13,700 columns of numeric data (takes 8 bytes per element), then each row would require about 100KB and that would mean you would probably have an object with about 8000 rows. 64-bit is probably limited by how much you want to spend for memory. On Tue, Aug 3, 2010 at 1:10 PM, Dimitri Liakhovitski wrote: > I understand the question I am about to ask is rather vague and > depends on the task and my PC memory. However, I'll give it a try: > > Let's assume the goal is just to read in the data frame into R and > then do some simple analyses with it (e.g., multiple regression of > some variables onto some - just a few - variables). > > Is there a limit to the number of columns of a data frame that R can > handle? I am asking because where I work many use SAS and they are > running into the limit of >~13,700columns there. > > Since I am asking - is there a limit to the number of rows? > > Or is the correct way of asking the question: my PC's memory is X. The > .txt tab-delimited file I am trying to read in has the size of YYY Mb, > can I read it in? > > Thanks a lot! > > -- > Dimitri Liakhovitski > Ninah Consulting > www.ninah.com > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits
Try the rSymPy or Ryacas packages. In the rSymPy code below the var command defines x as symbolic to sympy and then we perform the computation: > library(rSymPy) Loading required package: rJava > sympy("var('x')") [1] "x" > sympy("limit(x*x + x + 2, x, 2)") [1] "8" Or using devel version define x as symbolic first to sympy and then to R: > library(rSymPy) > source("http://rsympy.googlecode.com/svn/trunk/R/Sym.R";) > sympy("var('x')") [1] "x" > x <- Sym("x") > limit(x*x + x + 2, x, 2) [1] "8" or using Ryacas: > library(Ryacas) Loading required package: XML > x <- Sym("x") > Limit(x^2+x+2, x, 2) [1] "Starting Yacas!" expression(8) More info is available here which you should read before using these packages: http://rsympy.googlecode.com http://ryacas.googlecode.com On Tue, May 5, 2009 at 5:39 AM, Hassan Mohamed wrote: > Hey, > what is the R function for the mathematical limit ? > e.g. to calculate and return the amount that the expression > X^2 +X +2 > approach > as X approach 2 > (X-> 2) > thanks > hassan > > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits
Uwe Ligges wrote: > So you want some software that can do symbolic calculations? In that > case use other software. R is designed for numerical analyses. In particular, if you are looking for good free software, you might try Maxima. -- Mike Prager, NOAA, Beaufort, NC * Opinions expressed are personal and not represented otherwise. * Any use of tradenames does not constitute a NOAA endorsement. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits
Hassan Mohamed wrote: Hey, what is the R function for the mathematical limit ? e.g. to calculate and return the amount that the expression X^2 +X +2 approach as X approach 2 (X-> 2) So you want some software that can do symbolic calculations? In that case use other software. R is designed for numerical analyses. Uwe Ligges thanks hassan [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits
Dear Hassam, Take a look at the section 5.8 in [1]. HTH, Jorge [1] http://cran.r-project.org/web/packages/Ryacas/vignettes/Ryacas.pdf On Tue, May 5, 2009 at 5:39 AM, Hassan Mohamed wrote: > Hey, > what is the R function for the mathematical limit ? > e.g. to calculate and return the amount that the expression > X^2 +X +2 > approach > as X approach 2 > (X-> 2) > thanks > hassan > > > >[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] limits on the length of the name of a script file in R 2.6.0.?
On 11/26/2007 11:03 AM, Dimitri Liakhovitski wrote: > Hello! > I posted earlier - about my problems with R 2.6 crashing (i.e., > telling me it needs to shut down) every time I tried to open an R > script. First, it looked like it was unhappy with my working outside > of R folder (under Program Files). But not it looks like it was not > really the problem. > Now, it opens and works when I open scripts whose names are not very > long (e.g., "Selecting cases I need.R"). But it does crash (gives me a > message that R needs to shut down) when the script I am trying to open > has a slightly longer file name (e.g, in my case: > "randforestImportanceExample with MR.r" and longer). > > Is anyone aware of the limits the latest version of R imposes on > script name length? I never experienced such a problem with R 2.5.0. The latest version of R is 2.6.1 (released today), but I doubt if you're using that yet. It has the same limit as Windows on filename length. 2.6.0 had a bug which meant long filenames could cause a crash. This was repaired a couple of weeks ago: http://developer.r-project.org/blosxom.cgi/R-2-6-branch/2007/11/10#c2007-11-10 Duncan Murdoch __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.