Re: [R] Why does a 2 GB RData file exceed my 16GB memory limit when reading it in?
David, If the ".Rdata" contains more than one object you could (and maybe should use) the SOAR package (from Venables). This package helps you to split the objects over multiple RData files. It's useful when you have numerous medium-large objects in the workspace but doesn't use then at the same time. When use SOAR::Attach(), for instance, it loads the current name of all the objects and retain than available in the searchpath but without load then to the memory. As you call, they will be loaded into the memory. If needed, you can update the object and then store it again with the SOAR::Store() For my use, this package is terrific! I use it with an analysis that I need to repeat over medium-large similars datasets. Best Leandro Em qua., 2 de set. de 2020 às 18:33, David Jones escreveu: > Thank you Uwe, John, and Bert - this is very helpful context. > > If it helps inform the discussion, to address John and Bert's > questions - I actually had less memory free when I originally ran the > analyses and saved the workspace, than when I read in the data back in > later on (I rebooted in an attempt to free all possible memory before > rereading the workspace back in). > > > > On Wed, Sep 2, 2020 at 1:27 PM John via R-help r-project.org> wrote: > > >> On Wed, 2 Sep 2020 13:36:43 +0200 > >> Uwe Ligges wrote: > >> > >> > On 02.09.2020 04:44, David Jones wrote: > >> > > I ran a number of analyses in R and saved the workspace, which > >> > > resulted in a 2GB .RData file. When I try to read the file back > >> > > into R > >> > > >> > Compressed in RData but uncompressed in main memory > >> > > >> > > >> > > later, it won't read into R and provides the error: "Error: cannot > >> > > allocate vector of size 37 Kb" > >> > > > >> > > This error comes after 1 minute of trying to read things in - I > >> > > presume a single vector sends it over the memory limit. But, > >> > > memory.limit() shows that I have access to a full 16gb of ram on my > >> > > machine (12 GB are free when I try to load the RData file). > >> > > >> > But the data may need more > >> > > >> > > >> > > gc() shows the following after I receive this error: > >> > > > >> > > used (Mb) gc trigger (Mb) max used (Mb) > >> > > Ncells 623130 33.3 4134347 220.8 5715387 305.3 > >> > > Vcells 1535682 11.8 883084810 6737.5 2100594002 16026.3 > >> > > >> > So 16GB were used when R gave up. > >> > > >> > Best, > >> > Uwe Ligges > >> > >> For my own part, looking at the OP's question, it does seem curious > >> that R could write that .RData file, but on the same system not be able > >> to reload something it created. How would that work. Wouldn't the > >> memory limit have been exceeded BEFORE the the .RData file was written > >> the FIRST time? > >> > >> JDougherty > > > >R experts may give you a detailed explanation, but it is certainly > possible > >that the memory available to R when it wrote the file was different than > >when it tried to read it, is it not? > > >Bert Gunter > > >"The trouble with having an open mind is that people keep coming along and > >sticking things into it." > >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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 -- To UNSUBSCRIBE and more, see 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] Microsoft R Server
John, as I know Microsoft has owned the Revolution Analytics and is continuing the development of the Revolurion R with a new name Microsoft R. Note that Microsoft R has an open source stable version. I'm not quite sure which modifications they are doing on it. I suppose that this modified version of R is the one they are putting in their servers. As I could search few weeks ago they inform us that all R packages works with their version. Best Leandro 2016-04-14 9:33 GMT-03:00 John Sorkin: > Has anyone ever heard of or used Microsoft R server? Does the product > work? What are requirements for running it? How much does it cost and is it > supported by the R community? > Thank you, > John > Confidentiality Statement: > This email message, including any attachments, is for ...{{dropped:13}} __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Show all elements
Hi, Look to the following code: set.seed(1) dados = data.frame(valor=rnorm(100),var=sample(LETTERS[c(1,2,3,5)],100,replace=T),peso=rpois(100,2)) dados[1:10,] dados$var - factor(dados$var,levels=LETTERS[1:5]) table(dados$var) A B C D E 31 31 19 0 19 When I try to use summarize, Hmisc package it shows me the result without D category. g1 - function(y) wtd.mean(y[,1],y[,2]) summarize(dados[,c(1,3)], llist(var=dados$var), g1,stat.name = 'med') var med 1 A 0.02589377 2 B 0.37123239 3 C -0.57820359 4 E 0.39584514 How do I get med = NA or something else with summarize? I realy need to the function to return all factors in the var even it they are an empty set. thanks in advance. leandro [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Suggestion in justify in write.fwf {gdata}
Hi, Sometimes, I need to do some hard work when exporting files using gdata package. It will be very useful if the justify parameter of write.fwf can receive vectors. In some jobs I need to left and right justify in different columns of the same file. Nowadays, I do a lot ow this working in preparing manually each file. I was wondering something like justify=c(rep('right',3),'left',rep('right',2),rep('left',10)) in a file that has 15 columns. Best, Leandro [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] Survey
Dear R-Users, I was using survey for the past years and now I am experiencing some problems with scripts that was working in the past. We are working with big data bases so I can't put all variables that I will use in the svydesign. Script working: data(api) dclus1-svydesign(id=apiclus1$dnum, weights=apiclus1$pw, fpc=apiclus1$fpc) svyby(apiclus1$api99,apiclus1$stype, dclus1, svymean) by V1 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 svyby(apiclus1$api99,~apiclus1$stype, dclus1, svymean) apiclus1$stype V1 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 dclus1-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) svyby(~api99, ~stype, dclus1, svymean) stypeapi99 se.api99 E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 [4] LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] grDevices datasets splines graphics stats tcltk utils methods base other attached packages: [1] gdata_2.8.2 survey_3.26 foreign_0.8-42 SOAR_0.99-8 svSocket_0.9-51 TinnR_1.0.3 R2HTML_2.2 [8] Hmisc_3.8-3 survival_2.36-2 loaded via a namespace (and not attached): [1] cluster_1.14.1 grid_2.12.1 gtools_2.6.2lattice_0.19-33 svMisc_0.9-63 tools_2.12.1 script not working: data(api) dclus1-svydesign(id=apiclus1$dnum, weights=apiclus1$pw, fpc=apiclus1$fpc) svyby(apiclus1$api99,apiclus1$stype, dclus1, svymean) Erro em svyby.default(apiclus1$api99, apiclus1$stype, dclus1, svymean) : objeto 'byfactor' não encontrado svyby(apiclus1$api99,~apiclus1$stype, dclus1, svymean) Erro em svyby.default(apiclus1$api99, ~apiclus1$stype, dclus1, svymean) : objeto 'byfactor' não encontrado dclus1-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc) svyby(~api99, ~stype, dclus1, svymean) stypeapi99 se E E 607.7917 22.81660 H H 595.7143 41.76400 M M 608.6000 32.56064 sessionInfo() R version 3.0.3 (2014-03-06) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252 LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C LC_TIME=Portuguese_Brazil.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] survey_3.29-5 loaded via a namespace (and not attached): [1] tools_3.0.3 [[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] RMySQL problems in ubuntu 12.04.2
Hi, o Before I install an Apache + MySQL + PHP with the following statment: * sudo apt-get install mysql-server apache2 libapache2-mod-php5 php5 php5-mysql phpmyadmin* When i was trying to install RMySQL with install.packages() i received the following error: Could anyone help me with this? Best, Leandro Configuration error: could not find the MySQL installation include and/or library directories. Manually specify the location of the MySQL libraries and the header files and re-run R CMD INSTALL. INSTRUCTIONS: 1. Define and export the 2 shell variables PKG_CPPFLAGS and PKG_LIBS to include the directory for header files (*.h) and libraries, for example (using Bourne shell syntax): export PKG_CPPFLAGS=-IMySQL-include-dir export PKG_LIBS=-LMySQL-lib-dir -lmysqlclient Re-run the R INSTALL command: R CMD INSTALL RMySQL_version.tar.gz 2. Alternatively, you may pass the configure arguments --with-mysql-dir=base-dir (distribution directory) or --with-mysql-inc=base-inc (where MySQL header files reside) --with-mysql-lib=base-lib (where MySQL libraries reside) in the call to R INSTALL --configure-args='...' R CMD INSTALL --configure-args='--with-mysql-dir=DIR' RMySQL_version.tar.gz ERROR: configuration failed for package RMySQL * removing /usr/local/lib/R/site-library/RMySQL The downloaded source packages are in /tmp/RtmpIdWQKu/downloaded_packages Warning message: In install.packages(RMySQL) : installation of package RMySQL had non-zero exit status http://www.showmetech.com.br *LEANDRO MARINO* | Showmetech Estatístico | Fotógrafo Mobile: 55 21 9845-7707 Email: cont...@leandromarino.com.br Profiles SMT: facebook http://www.facebook.com/showmetech | twitterhttp://www.twitter.com/showmetech | Google+ https://plus.google.com/115440786884851522659 http://www.leandromarino.com.br [[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] RMySQL problems in ubuntu 12.04.2
Sorry, the i deleted the first part of the email. Today I downloaded the Ubuntu 12.04.2 32bits to install it on the virtualbox (in a windows machine). After it i have installed R with success. Before I installed R I installed the LAMP as I show in the first email. http://www.showmetech.com.br *LEANDRO MARINO* | Showmetech Estatístico | Fotógrafo Mobile: 55 21 9845-7707 Email: cont...@leandromarino.com.br Profiles SMT: facebook http://www.facebook.com/showmetech | twitterhttp://www.twitter.com/showmetech | Google+ https://plus.google.com/115440786884851522659 http://www.leandromarino.com.br 2013/6/29 Leandro Marino leandromar...@leandromarino.com.br Hi, o Before I install an Apache + MySQL + PHP with the following statment: * sudo apt-get install mysql-server apache2 libapache2-mod-php5 php5 php5-mysql phpmyadmin* When i was trying to install RMySQL with install.packages() i received the following error: Could anyone help me with this? Best, Leandro Configuration error: could not find the MySQL installation include and/or library directories. Manually specify the location of the MySQL libraries and the header files and re-run R CMD INSTALL. INSTRUCTIONS: 1. Define and export the 2 shell variables PKG_CPPFLAGS and PKG_LIBS to include the directory for header files (*.h) and libraries, for example (using Bourne shell syntax): export PKG_CPPFLAGS=-IMySQL-include-dir export PKG_LIBS=-LMySQL-lib-dir -lmysqlclient Re-run the R INSTALL command: R CMD INSTALL RMySQL_version.tar.gz 2. Alternatively, you may pass the configure arguments --with-mysql-dir=base-dir (distribution directory) or --with-mysql-inc=base-inc (where MySQL header files reside) --with-mysql-lib=base-lib (where MySQL libraries reside) in the call to R INSTALL --configure-args='...' R CMD INSTALL --configure-args='--with-mysql-dir=DIR' RMySQL_version.tar.gz ERROR: configuration failed for package RMySQL * removing /usr/local/lib/R/site-library/RMySQL The downloaded source packages are in /tmp/RtmpIdWQKu/downloaded_packages Warning message: In install.packages(RMySQL) : installation of package RMySQL had non-zero exit status http://www.showmetech.com.br *LEANDRO MARINO* | Showmetech Estatístico | Fotógrafo Mobile: 55 21 9845-7707 Email: cont...@leandromarino.com.br Profiles SMT: facebook http://www.facebook.com/showmetech | twitterhttp://www.twitter.com/showmetech | Google+ https://plus.google.com/115440786884851522659 http://www.leandromarino.com.br [[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] Why can't R understand if(num!=NA)?
You can use only if(!is.na(num)) [[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] Windows RT or Windows 8
Dear Levke, R works perfect with windows 8. I didn't update to the 3.0 version but I guess that will work too. Windows Rt differ from Windows 8 in a lot of things really don't know if it will work. Kindly, Leandro http://www.showmetech.com.br *LEANDRO MARINO* | Showmetech Estatístico | Fotógrafo Mobile: 55 21 9845-7707 Email: cont...@leandromarino.com.br Profiles SMT: facebook http://www.facebook.com/showmetech | twitterhttp://www.twitter.com/showmetech | Google+ https://plus.google.com/115440786884851522659 http://www.leandromarino.com.br 2013/4/13 Levke Godbersen levke.godber...@ymail.com Dear R Experts, will R run on Windows RT or Windows 8? I understand these platforms to be significantly different from former Windows versions. Thank you for your time and answer. Kind regards Levke [[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] R and Windows 8
I'm using R 64 in Win8 64 without problems. Only the StatET plugin for eclipse is not working. 2013/1/16 Prof Brian Ripley rip...@stats.ox.ac.uk On 16/01/2013 16:06, Claire Oswald wrote: Hello: I'd like to know if R will run under Windows 8? We have students running it under Windows 8, 32- and 64-bit OS. -- Brian D. Ripley, rip...@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~**ripley/http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __** R-help@r-project.org mailing list https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/** posting-guide.html 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] Editor to program with CRAN R
I think that if you're not familiar with emacs or vim I suggest you to use RStudio. If you're a programmer that knows how to use eclipse I think eclipse with statet it will be the best solution. Another option that you have is the notepad + + with NppToR plugin Best, Att, Leandro Marino -- Enviado do meu dispositivo móvel. Em 05/05/2012 15:49, Joshua Wiley jwiley.ps...@gmail.com escreveu: There are many, off the top of my head: --Emacs + ESS (what I use). You can get them separately or combined from: http://vgoulet.act.ulaval.ca/en/emacs/ --RStudio --Vim --Eclipse + StatEt Most of those work on different (all?) platforms. Cheers, Josh On Sat, May 5, 2012 at 8:34 AM, Trying To learn again tryingtolearnag...@gmail.com wrote: Hi all, Iç£ using the windows writting pad (not Notepad the simplest version). I think there should be greater and helping note pads to help programming. Can you suggest one? Many thanks [[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. -- Joshua Wiley Ph.D. Student, Health Psychology Programmer Analyst II, Statistical Consulting Group University of California, Los Angeles https://joshuawiley.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. [[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] Order a data frame based on the order of another data frame
*Hi,* * * *i think that you are making a mistake. When you use * * * order(rownames(snp.matrix$fam)) you're sorting the data, so it will be in the same order of the data_one. If rownames() are defined correctly in data_one, you only have to do: data_one[rownames(snp.matrix$fam),] Note that it's good to check if all elements from rownames(snp.matrix$fam) are in rownames(data_one). setdiff( rownames(snp.matrix$fam),rownames(data_one)) setdiff(rownames(data_one),rownames(snp.matrix$fam)) * * * * * * * * Atenciosamente, Leandro Marino http://www.leandromarino.com.br (Fotógrafo) http://est.leandromarino.com.br/Blog (Estatístico) Cel.: + 55 21 9845-7707 Cel.: + 55 21 8777-7907 2012/3/5 francesca casalino francy.casal...@gmail.com Hi, I am trying to match the order of the rownames of a dataframe with the rownames of another dataframe (I can't simply sort both sets because I would have to change the order of many other connected datasets if I did that): Also, the second dataset (snp.matrix$fam) is a snp matrix slot: so for example: data_one: xy z sample_1110001-0.3352623 -1.141462-0.4032494 sample_1110005 0.1862424 0.015944 0.1329059 sample_1110420 0.1309120 0.0040055960.06117253 sample_2220017 0.1145205 -0.1250900540.04957881 rownames(snp.matrix$fam) [1] sample_2220017 sample_1110420 sample_1110001 [4] sample_1110005 I would like my data_one to look like this: x y z sample_2220017 0.1145205 -0.1250900540.04957881 sample_1110420 0.1309120 0.0040055960.06117253 sample_1110001-0.3352623 -1.141462-0.4032494 sample_1110005 0.1862424 0.015944 0.1329059 I have tried these but it doesn't work: data_one[order(rownames(snp.matrix$fam)),] data_one[rownames(data_oen)[order(rownames(snp.matrix$fam))],] Thank you for your help! __ 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] Tinn-R
*Paul, I didn't understood your problem with tinn-r. I don't work at a lab, so i have no idea how it can be your specific problem. I think it has a problem with R + Win 7 that is about the changes in the permissions at Program Files folder. What am i doing to cheat this problem. 1) Install R and Tinn-R at c:/MyProgs 2) Change the security permissions and give all full control to all users in the machine and apply the new settings. 3) Open Tinn-R and configure the Rprofile.site file. **(R Configure Permanent) If it necessary you can change some parameters or put some packages to load by default and you can change the default Cran mirror. 4) Open R inside tinn-r and wait to install all packages What version of tinn-r and R are you using? I'm using R version 2.13.1 (2011-07-08) in 32bits and 64bits at the same machine with Tinn-R 2.3.7.1 Yep, you have to configure TINN-R when you install a new release of R. ** In the Option Application R you have an option to use i384 or x64. I didn't understood the problem of the changes in the R path. *Atenciosamente, Leandro Marino http://www.leandromarino.com.br (Fotógrafo) http://est.leandromarino.com.br/Blog (Estatístico) Cel.: + 55 21 9845-7707 Cel.: + 55 21 8777-7907 2011/10/7 Paul Johnson pauljoh...@gmail.com On Wed, Oct 5, 2011 at 12:45 PM, Leandro Marino leandromar...@leandromarino.com.br wrote: Paul, I use Tinn-r and i didn't see anything hard to configure it. You have to install the R, then the Tinn-r. After you have to open Tinn-r go to R Configure Permanent . This procedure will open the Rprofile.site file, if you want you can change some parameters and save. After that you have only to open tinn-r and inside it open the R or the Rterm (i prefer this one because consumes less memory). Regards, Leandro You don't mention which version of windows or R. Setting thus up for all users on a Windows 7 system has been more trouble for me after R re-organized their install so that Rterm.exe is no longer in the path. It is in that subdirectory i386 or such. My notes say Even if you change the paths, TINN-R will not save what you do because it always looks at R again and tries to guess the path when TINN-R starts, and IT ALWAYS GUESSES Wrong. That's why, under the menu where you set those 2 paths (for rterm and rgui), you also TURN OFF the option to always use newest R. And Tinn-R has to be reconfigured whenever R gets updated. But if y ou have tinn-r working, I don't mean to stop you. The problem is that a seemingly endless stream of new users can't make it work. Maybe you post your install recipe on the Tinn-R website, it would help people out. -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas [[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] Tinn-R
*Paul, I use Tinn-r and i didn't see anything hard to configure it. You have to install the R, then the Tinn-r. After you have to open Tinn-r go to R Configure Permanent . This procedure will open the Rprofile.site file, if you want you can change some parameters and save. After that you have only to open tinn-r and inside it open the R or the Rterm (i prefer this one because consumes less memory). Regards, Leandro *Atenciosamente, Leandro Marino http://www.leandromarino.com.br (Fotógrafo) http://est.leandromarino.com.br/Blog (Estatístico) Cel.: + 55 21 9845-7707 Cel.: + 55 21 8777-7907 2011/10/5 Paul Johnson pauljoh...@gmail.com On Tue, Oct 4, 2011 at 1:25 PM, Charles McClure cmccl...@atrcorp.com wrote: I am new to R and have recently tried Tinn-R with very mixed and unexpected results. Can you point me to a Tinn-R tutorial on the web or a decent reference book? In my experience, TINN-R does not work so well, and most new users are recommended to try instead Notepad++ with the addon components R2notepad++ or Rstudio. I have MS Windows setup tips here http://web.ku.edu/~quant/cgi-bin/mw1/index.php?title=Windows:AdminTips Until I see evidence otherwise, I'm concluding that TINN-R was the best in 2008, but it is harder to configure now and there's no reason to prefer it over Notepad++. Real Men[tm] still use Emacs, but new users may not have enough muscles :) pj Thank you for your help; Charles McClure -- Paul E. Johnson Professor, Political Science 1541 Lilac Lane, Room 504 University of Kansas __ 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] How do I get a weighted frequency table?
*Luca, * you may use survey package. You have to declare the design with design function and than you can you svytotal, svyby, svymean functions to do your tabulations. Regards, Leandro Atenciosamente, Leandro Marino http://www.leandromarino.com.br (Fotógrafo) http://est.leandromarino.com.br/Blog (Estatístico) Cel.: + 55 21 9845-7707 Cel.: + 55 21 8777-7907 2011/8/28 Luca Meyer lucam1...@gmail.com Hello, I have to run a set of crosstabulations to which I need to apply some weights. I am currently doing an unweighted version of such crosstabs using table(x,y). I am used with SPSS to create a weighting variable and to use WEIGHT BY VAR before running the CTABLES, is there a similar procedure in R? Thanks, Luca Mr. Luca Meyer www.lucameyer.com R version 2.13.1 (2011-07-08) Mac OS X 10.6.8 [[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.
[R] Using Ubuntu as a Server
*Hi, I want to know how can I configure R in a Ubuntu to be a server. I am planning to use R in a Windows machine with Tinn-R, but I want R running at an Ubuntu Lucid machine. How can i do this? *Atenciosamente, Leandro Marino http://est.leandromarino.com.br/Blog (Estatístico) Cel.: + 55 21 9845-7707 Cel.: + 55 21 8777-7907 [[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] Using Ubuntu as a Server
What I was trying to say is that TINNR has a possibility to connect to R on a server. I want to know if its possible to have the r in a server with ubuntu and use it from the TINNR software. Sent from my mobile. Att, Leandro Marino http://www.leandromarino.com.br (Fotógrafo) http://est.leandromarino.com.br (EstatÃstico) Cel.: +55 21 9845-7707 Cel.: +55 21 8777-7907 Em 10/07/2010 18:27, VojtÄch Zeisek vojtech.zei...@opensuse.orgescreveu: Hello, well, if You wish, You can always write scripts in R and then send it to Ubuntu server, but it is too complicated. Tinn-R is Windows only, but Rkward is IMHO much more better. You can not work in Windows in Tinn-R and send it directly to R running on remote Linux server. Best regards, VojtÄch Zeisek Dne Sat 10. of July 2010 21:30:57 Cedrick W. Johnson napsal(a): You can do that, as well as install RKWard if you want a gui front end and use ssh/x11 forward... -- VojtÄch Zeisek Department of Botany, Faculty of Science, Charles Uni., Prague, CZ Institute of ... https://www.natur.cuni.cz/faculty-en?set_language=en http://www.ibot.cas.cz/?p=indexamp;site=en http://www.opensuse.org/ http://web.natur.cuni.cz/~zeise... __ 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.
[R] RES: R help for read.table()
Hi, You didnt put the parameter sep=' ' in the read.table. If you try to see str(file), i think you are going to see only one column. read.table(data.txt,header=FALSE,sep=' ') Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Gaurav Kumar Enviada em: quarta-feira, 20 de janeiro de 2010 08:05 Para: r-help@r-project.org Assunto: [R] R help for read.table() I've a table containing two columns seperated by space, as shown below. S:C 2.011085038928 S:A 21.496800549900762 S:J 0.183181039138149 P:E 9.641984304606304 I'm reading this table inside a loop but unable to access the first column as file[i,1]. file - read.table(data.txt,header=FALSE) for ( i in 1:nrow(file)) { cat(file[i,1],:) pvalue - 2*(1-pnorm(abs(file[i,2]))) cat(pvalue,\n) } can anyone help me how to read the first column. regards Gaurav Kumar www.gauravkumar.org PhD Student, Chemistry and Biomolecular Sciences, Macquarie , Sydney, Australia. MS (Computational Biology), NCBS-TIFR, Bangalore, India. [[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] ggplot2 = bar size
Hi, i am newbie into ggplot and i thow that i have to learn a lot about this package. I am doing this function to draw an graphic: library(ggplot2) posx - theme_text(angle=45,hjust=1,face='bold',size=12) posy - theme_text(angle=0,hjust=1,face='bold',size=12) y1 - c(1,4,6,1,8,10,6,1,5,4) x - qplot(x=factor(paste('nomes',1:10),labels=paste('nomes',1:10)), y= y1 , geom='bar',margins=F, stat=identity,xlab='',ylab='Y LABEL') x + opts(axis.text.x=posx,axis.text.y=posy) + geom_bar(fill=c(rgb (000,100,000,maxColorValue=255),rep(rgb(110,139,061,maxColorValue=255), 9))) Now, I want to know how can i change the size of the bar. I want to draw it thinner than it appears into the R Graphics Console. Another doubt is how can I use another format into the y label, called in this graphic 'Y LABEL' Regards, Leandro Marino Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. __ 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] RES: Re : How to Import Excel file into R 2.9.0 version
Another possibility is to download the xlsReadWrite package in http://treetron.googlepages.com/xlsreadwrite.htm And use the read.xls() function. I am using this package without problems. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Inchallah Yarab Enviada em: terça-feira, 11 de agosto de 2009 09:33 Para: r-help@r-project.org Assunto: [R] Re : How to Import Excel file into R 2.9.0 version i advice you to save the file under csv and then use read.csv2(c:/file.csv,sep=,) hope that helps!!! inchallahyarab 2009/8/11 rajclinasia r...@clinasia.com Hi Every one, I have a problem with Reading Excel file into R 2.9.0 version. In older versions it is working with xlsReadWrite package. But in 2.9.0 version there is no package like that. so help me out in this aspect. Thanks in Advance. -- View this message in context: http://www.nabble.com/How-to-Import-Excel-file-into-R-2.9.0-version-tp 24914638p24914638.html Sent from the R help mailing list archive at Nabble.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. [[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.
[R] Problems with help
Hi, I was trying to read some help of functions and in all functions I try to see is giving me this error: ?write.table Erro em print.help_files_with_topic(C:/ARQUIV~1/R/R-29~1.0/library/utils/chm/write.table) : CHM file could not be displayed Anybody knows what is happening? Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. __ 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] RES: Hi
Try this: mrp - function(){ r - list() mr-matrix(0,4,1) for(i in 1:4){ r[[i]] - lm(dat(,i+1)~dat(,1)) mr[i,1] - coefficients(r[[i]]) } mr } Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Oscar Bayona Enviada em: segunda-feira, 15 de junho de 2009 18:42 Para: r-help@r-project.org Assunto: [R] Hi Hi I have a simple question. I want to run a n times a simple linear regession and save beta in a matrix but I4m not able. Imagine: Data.txt is a 10*5 file and want to run 4 different stimations always regressing first column on the rest. So I try this: First I run Data on memory This is my function mrp - function(){ mr-matrix(0,4,1) for(i in 1:4) r(i)=lm(dat(,i+1)~dat(,1) mr[i] - coefficients(r(i))) } I execute mrp usin source file choose option but nothing happens Where I4m wrong? [[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] RES: help
a - matrix(c(1:4),ncol=2) b - matrix(c(5:8),ncol=2) a [,1] [,2] [1,]13 [2,]24 b [,1] [,2] [1,]57 [2,]68 a+b [,1] [,2] [1,]6 10 [2,]8 12 Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de daniele riggi Enviada em: quinta-feira, 21 de maio de 2009 12:08 Para: r-help@r-project.org Assunto: [R] help Someone knows the existence of a function to sum the elements of the same place A[i,j] B[i,j] of a matrix?thank you -- Dr. Daniele Riggi, PhD student University of Milano-Bicocca Department of Statistics Building U7, Via Bicocca degli Arcimboldi, 8 20126 Milano, Italy cell. +39 328 3380690 mailto: daniele.ri...@gmail.com [[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.
[R] RES: Read.table problems
I was having this problem with a file. My problem was a ' indo the name, link Ricardo D'avilla, the ' skipped all sep to the end of the file. Maybe it is your problem. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE Esta mensagem, incluindo seus anexos, pode conter informacoes privilegiadas e/ou de carater confidencial, nao podendo ser retransmitida sem autorizacao do remetente. Se voce nao e o destinatario ou pessoa autorizada a recebe-la, informamos que o seu uso, divulgacao, copia ou arquivamento sao proibidos. Portanto, se você recebeu esta mensagem por engano, por favor, nos informe respondendo imediatamente a este e-mail e em seguida apague-a. -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Marc Schwartz Enviada em: segunda-feira, 18 de maio de 2009 13:58 Para: Steve Murray Cc: r-help@r-project.org Assunto: Re: [R] Read.table problems On May 18, 2009, at 11:24 AM, Steve Murray wrote: Dear all, I have a file which I've converted from NetCDF (.nc) to text (.txt) using ncdump in Unix (as I had problems using the ncdf package to do this). The first few rows (as copied and pasted from the Unix console) of the file appear as follows: _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, As you can see, there are a lot of NA values before the actual numeric values start further down the dataset. My problem is that I'm having trouble reading this file into R. I think the problem lies with the sep= argument, although I may be wrong. I tried the following command at first, as the data appear to be comma separated: read.table(test86.txt, skip=43, na.strings=-, header=FALSE, sep=,) - test86 # skip =43 due to meta-data information being held in the initial rows Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 29 did not have 25 elements I then tried sep= , followed by sep= but received a similar-type error message (although line 29 doesn't appear to be especially different from the rest). I subsequently tried using sep=\t and then sep=\n. These both result in the data being read in without an error message being displayed, although the data are formatted as follows: head(test86) V1 1 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 2 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 3 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 4 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 5 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, 6 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, dim(test86) [1] 179899 1 Instead of one column, I'd expect there to be 720. I think I'm getting something wrong relating to the sep= argument (or possibly mis-using na.strings?). If anyone has any solutions to this then I'd be very grateful to hear them. Many thanks for any advice, Steve Two problems, 1. Your first line above has one more column/entry than the subsequent lines. If that is correct, you need to use the 'fill = TRUE' argument so that all subsequent rows are filled to have the same number of columns. If the above is due to a copy/paste error, then disregard this. 2. You are using a '-' (hyphen) as your 'na.strings' character, when the data is using a '_' (underscore). Additionally, I would use 'strip.white = TRUE', to aid in getting rid of extraneous white space around your fields/separators. That will also help with column separations. Thus (on OSX) with the above data copied to the clipboard: read.table(pipe(pbpaste), na.strings = _, sep = ,, fill = TRUE,
[R] RES: SAS PROC SORT nodupkey
Amor, You have the possibility to use the duplicated() function. A[!duplicated(A[,var]),] Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de amor Gandhi Enviada em: terça-feira, 12 de maio de 2009 09:30 Para: r-h...@stat.math.ethz.ch Assunto: [R] SAS PROC SORT nodupkey Hi, I have the following data and I would like to delete douple names, it is almost similar to SAS PROC SORT nodupkey! Is there any function in R does this? x1 - rnorm(11,5,1) x2 - runif(11,0,1) nam -paste(A, c(1:4,4,5:9,9), sep=.) mydata - data.frame(x1,x2) crownames(mydata) - nam Many thanks in advance, Amor [[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] RES: Removing rows
Hi Tammy, You can do: act_2temp - act_2[which(!duplicated(act_2[,c(1:5)])),] act_2temp[1:5,] act_2 - act_2temp rm(act_2temp) Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Tammy Ma Enviada em: quinta-feira, 12 de março de 2009 06:49 Para: r-help@r-project.org Assunto: [R] Removing rows Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51 4 58 2006-02-22 14:52:52 14 52 52 3 60 2006-02-22 14:54:42 14 54 42 useractivity_idle I want to change act_2 to DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 58 2006-02-22 14:52:52 14 52 52 3 60 2006-02-22 14:54:42 14 54 42 useractivity_idle in other word, I want to keep 1st if there are many repeated value, I made the program as: rm_r-function(act_2){ dm-dim(act_2)[1]-1 for(i in 2:dm){ if(act_2$Rep[i+1]==act_2$Rep[i]){ act_2-act_2[-(i+1),] }else{ act_2-act_2 } } return(act_2) } when it moved one row on 1st loop, i should still start 2 but it become 3 at 2nd loop, if I add i-i-1, then i go to 1 seems not reasonbale. How should I modify it`? Tammy _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx [[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.
[R] RES: RES: Removing rows
Sorry, act_2temp - act_2[which(!duplicated(act_2[,c(1: 6 )])),] # not 5 Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Leandro Marino Enviada em: quinta-feira, 12 de março de 2009 08:55 Para: 'Tammy Ma'; r-help@r-project.org Assunto: [R] RES: Removing rows Hi Tammy, You can do: act_2temp - act_2[which(!duplicated(act_2[,c(1:5)])),] act_2temp[1:5,] act_2 - act_2temp rm(act_2temp) Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Tammy Ma Enviada em: quinta-feira, 12 de março de 2009 06:49 Para: r-help@r-project.org Assunto: [R] Removing rows Hi All, act_2 DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 55 2006-02-22 14:52:49 14 52 49 4 57 2006-02-22 14:52:51 14 52 51 4 58 2006-02-22 14:52:52 14 52 52 3 60 2006-02-22 14:54:42 14 54 42 useractivity_idle I want to change act_2 to DateDtime Hour Min Second Rep 51 2006-02-22 14:52:18 14 52 18 useractivity_act 52 2006-02-22 14:52:18 14 52 18 4 58 2006-02-22 14:52:52 14 52 52 3 60 2006-02-22 14:54:42 14 54 42 useractivity_idle in other word, I want to keep 1st if there are many repeated value, I made the program as: rm_r-function(act_2){ dm-dim(act_2)[1]-1 for(i in 2:dm){ if(act_2$Rep[i+1]==act_2$Rep[i]){ act_2-act_2[-(i+1),] }else{ act_2-act_2 } } return(act_2) } when it moved one row on 1st loop, i should still start 2 but it become 3 at 2nd loop, if I add i-i-1, then i go to 1 seems not reasonbale. How should I modify it`? Tammy _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx [[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. __ 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] RES: portable R editor
Another possibility is buy an U3 smartdrive (U3). And then you can use de UltraEdit Portable. It’s a good text editor with some level of support for R. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Federman, Douglas Enviada em: sexta-feira, 6 de março de 2009 16:29 Para: Werner W.; r-help@r-project.org Assunto: Re: [R] portable R editor You might also look at http://www.portableapps.com for a portable version of several editors, including gVim, Notepad++ and SciTE which all have some level of support for R -- I like nonsense, it wakes up the brain cells. Fantasy is a necessary ingredient in living, it's a way of looking at life through the wrong end of a telescope. Which is what I do, and that enables you to laugh at life's realities. - Dr. Suess From: r-help-boun...@r-project.org on behalf of Werner W. Sent: Wed 3/4/2009 6:39 AM To: r-help@r-project.org Subject: Re: [R] portable R editor Many, many thanks for all the answers! Notepad++ looks very promising although it does not have a project file management facility. But it has a very clean appearance. I'll have to look into SciTE which also sounds quite good. There seem to be some good alternatives. Meanwhile, I found a freeware application which helps to make Tinn-R truly portable: JauntePE (http://www.portablefreeware.com/?id=1452) virtualizes access to the registry and file system and can easily be used to make also the ini settings portable. Thus, everything will be on the USB stick. Thanks again, Werner -- View this message in context: http://www.nabble.com/portable-R-editor-tp22291017p22328322.html Sent from the R help mailing list archive at Nabble.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. [[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.
[R] Numbers
Hi, I know the function LETTERS, but, now I have some letters to convert it in numbers, like A=1,B=2, etc... Is any function to do that? Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: R on netbooks et al?
I use it on an ASUS EEE 701 PC! It works with some limitation, because this model have only 512mb of RAM. But it is working fine. The OS is Windows XP. I think that the better netbooks is one from HP, this netbook have an normal keyboard. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Erik Iverson Enviada em: quinta-feira, 5 de março de 2009 11:03 Para: herrdittm...@yahoo.co.uk Cc: r-help@r-project.org Assunto: Re: [R] R on netbooks et al? I've installed Ubuntu, Emacs, and R on my Samsung NC10 with 2 GB RAM. I think the keyboard is very usable on the NC10, and it has about 5-7 hours of battery life, which is also nice. R runs just fine on it. I'd consider paying extra for the Samsung just for the keyboard. herrdittm...@yahoo.co.uk wrote: Dear useRs, With the rise of netbooks and 'lifestyle laptops I am tempted to get one of these to mainly run R on it. Processor power and hard disk space seem to be ok. What I wonder is the handling and feel with respect to R. Has anyone here installed or is running R on one of these, and if so, what is your experience? Would it be more of a nice looking gadget than a feasable platform to do some stats on? Many thanks, Bernd __ 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. __ 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] RES: xlsReadWrite package repository for Ubuntu
I think in this case its better use the write.csv. Microsoft Excel reads csv files normally. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Marc Schwartz Enviada em: terça-feira, 3 de março de 2009 10:38 Para: reverend33 Cc: r-help@r-project.org Assunto: Re: [R] xlsReadWrite package repository for Ubuntu You perhaps missed the key point in Uwe's response, which is that the package is only available under Windows, as it depends upon Windows specific functionality (MS Office API via a third party library which is available for Windows only) to natively read and write Excel files. Thus, there is no package version available for Linux, or OSX for that matter. If you need to read Excel files under Linux, you could look at the read.xls() function in the 'gdata' CRAN package. This package requires that Perl be installed, as it calls a Perl routine (xls2csv) for converting the Excel file to a CSV file, which can then be read into R. If you need to write Excel files under Linux, you can use a Perl routine that I had posted back in 2007: https://stat.ethz.ch/pipermail/r-help/2007-July/135968.html and have updated since then to handle Unicode issues. I am attaching a 2k text file here with the updated routine. HTH, Marc Schwartz on 03/03/2009 06:38 AM reverend33 wrote: I'm sorry, maybe i didn't explain clearly: i'm trying to install xlsReadWrite on a Linux-type OS (Ubuntu)... Uwe Ligges-3 wrote: reverend33 wrote: Hi, I'm trying to install R on Ubuntu. I succeeded at installing the r-recommended package that is present in the synaptics, but i can't find the xlsReadWrite package in the repositories included in my synaptics manager. Does anybody know a liable repository in which this package is present. If you consider the CRAN master to be liable, it tells you for xlsReadWrite: OS_type: windows Moreover it tells you that the package's status for R-devel is ERROR. Uwe Ligges __ 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] RES: object .trPaths not found
Did you do the configuration of Tinn-R after the installation? Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE -Mensagem original- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Em nome de Uwe Ligges Enviada em: sábado, 28 de fevereiro de 2009 16:34 Para: rkevinbur...@charter.net Cc: R help Assunto: Re: [R] object .trPaths not found rkevinbur...@charter.net wrote: I am running an R script with Tinn-R (2.2.0.1) and I get the error message Error in source(.trPaths[4], echo = TRUE, max.deparse.length = 150) : object .trPaths not found Any solutions? Maybe, but the may depend on your script, your OS, your R version, used packages and so on. Hence please read and follow the posting guide and provide commented, minimal, self-contained, reproducible code. Uwe Ligges Thank you. Kevin __ 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. __ 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] LATTICE
Hi, I am having some problems using bwplot(lattice) in my data. I want change some parameters: 1) Fontfamily to serif 2) The size of the font 3) Put it in a bold face 4) Change de color of the lines How can I do that?! Now, I am using this to plot my boxplot. dados - data.frame(varsep=as.factor(rep(1:2,10)),i=runif(20)) bwplot(dados[,'varsep']~dados[,'i'],xlab=names(dados)[2],ylab=names(dados)[1 ],panel =function(...){panel.grid(v = -1, h = 0);panel.bwplot(...)},font=2,fontfamily='serif') Thanks for any help on advance and sorry about my English. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 lean...@cesgranrio.org.br __ 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] color and fontfamily in lattice
Hi, I am having some problems using bwplot(lattice) in my data. I want change some parameters: 1) Fontfamily to serif 2) The size of the font 3) Put it in a bold face 4) Change de color of the lines How can I do that?! Now, I am using this to plot my boxplot. dados - data.frame(varsep=as.factor(rep(1:2,10)),i=runif(20)) bwplot(dados[,'varsep']~dados[,'i'],xlab=names(dados)[2],ylab=names(dados)[1],panel =function(...){panel.grid(v = -1, h = 0);panel.bwplot(...)},font=2,fontfamily='serif') Thanks for any help on advance and sorry about my English. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 0 (21) 8777-7907 ( lean...@cesgranrio.org.br Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: memory limit
It depends of the number of the variables. If you are using 2 or 3 variables you can do some things. I should you read about ff package and ASOR packages they manage the dataset to do some kind of IO. Regards, -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Em nome de iwalters Enviada em: quarta-feira, 26 de novembro de 2008 09:42 Para: r-help@r-project.org Assunto: [R] memory limit I'm currently working with very large datasets that consist out of 1,000,000 + rows. Is it at all possible to use R for datasets this size or should I rather consider C++/Java. -- View this message in context: http://www.nabble.com/increasing-memory-limit-in-Windows-Server-2008-64-bit- tp20675880p20699700.html Sent from the R help mailing list archive at Nabble.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. __ 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] Package Deal
Hi, I was trying to adjust an bayesian network with Deal package. I know how to adjust when I give the structure and when I don't give the struture. Now, I want to adjust when I know some variables relationships and others I don't know. Anybody knows how can I do that? Regards, Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] Jpg files in R
If I have an file like an JPG, gif, png or other, exist any kind of function in the R to see de dimension in pixels of this image? Thanks Atenciosamente, Leandro Lins Marino Centro de Avaliacao Fundacao CESGRANRIO Rua Santa Alexandrina, 1011 - 2o andar Rio de Janeiro, RJ - CEP: 20261-903 * (21) 2103-9600 R.:236 * (21) 8777-7907 * [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Aquele que suporta o peso da sociedade e precisamente aquele que obtem as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: Merging two datasets
merge(df1,df2,by=commonvar,all=T) Regards, Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Shreyasee Pradhan Enviada em: quarta-feira, 6 de agosto de 2008 11:15 Para: r-help@r-project.org Assunto: [R] Merging two datasets I am facing a problem in merging two datasets. I have given codes to the names which are common in both the datasets and also to those which are uncommon. When I gave gave the following command merge(df1,df2) only those rows and columns were merged which were having common codes. When I viewed the results, only common codes are seen and the remaining entries are not seen. Can anyone guide me in this regards? How should I merge these two datasets completely without loss of any information? Thanks, Shreyasee [[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.
[R] RES: Simple... but...
I thinks this is the solution that you want! as.vector(matrix(c(x,y),byrow=T,ncol=3)) -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Wacek Kusnierczyk Enviada em: quarta-feira, 23 de julho de 2008 10:25 Para: R help Assunto: Re: [R] Simple... but... Shubha Vishwanath Karanth wrote: Hi R, If x=c(1,3,5) y=c(2,4,6) I need a vector which is c(1,2,3,4,5,6) from x and y. How do I do it? I mean the best way the absolutely best way is: ?c vQ __ 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.
[R] Colours in R
Hi list, I will help an person that will use some graphics of R in internet. But this pearson want to specify the colours. This person want me to create an pallete of colours like that: Name of color - Code - Colour White - 0xFF - color white (like an box with this color) I know that is possible with R, but i don't know how. Thanks for the advance. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: Colours in R
I know that! But i will select about 10 colurs and show him But he needs in that format! thanks@ -Mensagem original- De: Duncan Murdoch [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 17 de julho de 2008 11:32 Para: Leandro Marino Cc: [EMAIL PROTECTED] Org Assunto: Re: [R] Colours in R On 7/17/2008 10:25 AM, Leandro Marino wrote: Hi list, I will help an person that will use some graphics of R in internet. But this pearson want to specify the colours. This person want me to create an pallete of colours like that: Name of color - Code - Colour White - 0xFF - color white (like an box with this color) I know that is possible with R, but i don't know how. The colors() function returns all of the names. The ?col2rgb has examples that produce text tables like what you want, but doing it graphically will be hard: there are 150 different colours to show. There's some code in the ?rainbow examples that displays a smaller number of colours. Duncan Murdoch Thanks for the advance. Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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.
[R] Exporting an list()
Hi, I have an list() like this: $VAR1 Num Perc media stdev min P5P10P25 1 4381 56.35 181.35 39.81 87.13 123.05 132.59 152.95 2 1628 20.94 192.83 43.76 87.13 125.09 138.78 162.04 3786 10.11 197.23 50.65 88.16 120.46 136.62 159.33 4980 12.60 170.90 38.34 86.98 114.27 126.84 144.04 tot 7775 100.00 184.05 42.40 86.98 122.34 132.66 153.69 $VAR2 Num Perc media stdev min P5P10P25 1 4296 55.25 182.04 40.90 87.13 122.62 132.51 153.06 2 1634 21.02 191.57 43.81 86.98 126.87 137.04 160.35 3695 8.94 189.29 46.98 88.16 120.15 132.29 155.60 4 1150 14.79 177.66 41.13 92.47 116.22 129.17 147.23 tot 7775 100.00 184.05 42.40 86.98 122.34 132.66 153.69 How can I export that into a .txt? I tried the write.table but isn't working. It returns Erro em data.frame(Q05 = c(4381, 1628, 786, 980, 7775, 56.35, 20.94, : arguments imply differing number of rows: 5, 3, 4, 6 Thanks for the help! Leandro Marino __ 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] Bootstrap in betareg()
Hi list, I have an database (30.000 entrys) that my R is not modelling into betareg() so I decided to do an sample and uses an bootstrap to give me the correct estimates to the variance. Anybody knows what library can I use in this case? Regards, Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: Sum(Random Numbers)=100
One of possible solutions is: generate all the numbers. num - rpois(...) num - round(num/sum(num)*100,0) sum(num) I don't know if it is the best solution, but is one! Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Peter Dalgaard Enviada em: terça-feira, 8 de julho de 2008 05:12 Para: Richard Pearson Cc: [EMAIL PROTECTED] Assunto: Re: [R] Sum(Random Numbers)=100 Richard Pearson wrote: Shubha Does table(ceiling(runif(100,0,50))) give you something like you want? That's a neat(-ish) solution of Moshe's multinomial formulation. More generally, if p is a vector of probabilities you can simulate independent indicators with cut(runif(N), c(0,cumsum(p)) and then multinomials by tabulation. However, it is inefficient for large N, and awkward if you want replicates, which is why we have rmultinom(). In the present case use rmultinom(1, 100, rep(1/50,50)) -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ 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.
[R] RES: initialize a matrix
You have to put the tml in the function and deltat too. like VAR-function(power,length,deltat,tml){ -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de mysimbaa Enviada em: sexta-feira, 4 de julho de 2008 11:22 Para: r-help@r-project.org Assunto: [R] initialize a matrix Dear R users, I'm trying to write a function which returns minimum,maximum,mean of a vector(power) I've done the following : VAR-function(power,length){ for(i in tml:length)){ tvar[i]-i pmean[i]-mean(power[i:i+deltat]) pmin[i]-min(power[i:i+deltat]) pmax[i]-max(power[i:i+deltat]) varmax[i]-100*(pmax[i]-pmean[i])/pmean[i] varmin[i]-100*(pmean[i]-pmin[i])/pmean[i] Resulats-list(tvar,pmin,pmax,pmean,varmin,varmax) }} p.s. tml is a variable which is grater than 0 , deltat is a constant defined The problem is that tvar is unknown for R. So I have to initialize tvar,pmean... Should I create a zero matrix with length of the vector? And how to do it? Thanks for help -- View this message in context: http://www.nabble.com/initialize-a-matrix-tp18279886p18279886.html Sent from the R help mailing list archive at Nabble.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. __ 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] RES: Error while plotting matrix
You aren't using a matrix. This is a vector so you can only use: tvar - rep(0,(length-tml0)) pmean - rep(0,(length-tml0)) pmin - rep(0,(length-tml0)) pmax - rep(0,(length-tml0)) varmax - rep(0,(length-tml0)) varmin - rep(0,(length-tml0)) Why are you not using an data frame? Do you have to output this in a list()? Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de mysimbaa Enviada em: sexta-feira, 4 de julho de 2008 12:51 Para: r-help@r-project.org Assunto: [R] Error while plotting matrix Dear R user, I have written a function which returns max,min and variation of a power (see below) Power is a given matrix(1,n) I call the function Variation-VAR(p,(n-deltat)) Now the problem is when I want plot(Results[1],Results[2]). Not possible! I become the following error (in english it means: Error in as.double.default(x) :Object cannot be transformed in double) plot(Variation[1],Variation[2]) Fehler in as.double.default(x) : (list) Objekt kann nicht nach 'double' umgewandelt werden Any suggestion? Hier is the function: #Computing variation of the power VAR-function(power,length){ tvar=pmean=pmin=pmax=varmax=varmin-matrix(data=0,ncol=(length-tml0)) for(i in tml0:length){ tvar[i]=i pmean[i]=mean(power[i:(i+deltat)]) pmin[i]=min(power[i:(i+deltat)]) pmax[i]=max(power[i:(i+deltat)]) varmax[i]=100*(pmax[i]-pmean[i])/pmean[i] varmin[i]=100*(pmean[i]-pmin[i])/pmean[i] Results=list(tvar,pmean,pmin,pmax,varmax,varmin) }} Thanks, Adel -- View this message in context: http://www.nabble.com/Error-while-plotting-matrix-tp18281974p18281974.html Sent from the R help mailing list archive at Nabble.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. __ 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] RES: bug in axis.Date? was (Re: newbie needs help plotting timeseries)
You can do this plot saying to R that your file is a time series with the ts() function. serie=ts(x,) and then you use plot(serie) -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Petr PIKAL Enviada em: quarta-feira, 2 de julho de 2008 05:04 Para: Kathi Cc: [EMAIL PROTECTED] Assunto: [R] bug in axis.Date? was (Re: newbie needs help plotting timeseries) Hi Kathi [EMAIL PROTECTED] napsal dne 01.07.2008 18:48:47: On Tue, 1 Jul 2008 14:33:12 +0200, Petr PIKAL wrote Kathi [EMAIL PROTECTED] napsal dne 01.07.2008 13:39:18: Thanks, Petr. After fiddling around some more with my code I found out that this seems to have something to do with the number of records the table I'm reading (here: column B112). Somehow, changing the number of records for B112 changes the numbers in the error message - though I don't quite understand how the number of records influences the axis intervals or their labels, since I define those explicitly... Neither I. So I sent it to r-help maybe somebody else will know. If you debug code of axis.Date you find that after some computing there is this comparison where range is based on your input data (in your case x), and z is from defined at sequence of dates. z - z[z = range[1] z = range[2]] and this comparison results in character(0), when plotting with this artificial example. plot(1:100, seq(405,410,length=100), axes=FALSE, ylim=c(405,410), col=red, pch=15, type=o, ylab=metres above sea level, main=Main Plot Title) axis(2, at=405:410, tck=1, col=gray60) axis.Date(1, at=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), labels=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), tck=1, col=gray60) I presume, that your x is from different interval of dates or it is not a date. My data comes from a groundwater monitoring program. Once a month the water surface is measured in some 170 stations, and I've been using R to visualize these measurements. In this particular case, the water table ranges between approximately 406 and 408 metres above sea level, hence the y axis interval between 405 and 410. The values of my column x are dates of the format -MM-DD. If something were wrong there, then I guess I would not be able to plot my data at all. But using the limits of 2004-01-01 and 2008-06-01, I can plot all the timelines for my 170 measuring stations without any problem. But since it's now July, I wanted to shift the view by half a year. So I used search and replace in my code to change to 2004-07-01 and 2008-12-01 (plus six months in both cases). That's when I got the error. I almost have a feeling that R doesn't like the empty part of the graph for July-December... I don't understand why this happens, but maybe it has something to do with the comparison of ranges you mentioned. OK, It seems that you are right. Maybe you could add some expected x date/time values so that x axis will have no NA values. x-seq(as.Date(2004-01-01), as.Date(2008-06-01),by=month) y - seq(405,410,length=54) y[50:54] -NA plot(x, y, axes=FALSE, ylim=c(405,410),col=red, pch=15, type=o, ylab=metres above sea level, main=Main Plot Title) axis(2, at=405:410, tck=1, col=gray60) axis.Date(1, at=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), labels=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), tck=1, col=gray60) as you see, then everything works. However I think that it is pretty close to bug in axis.Date, maybe somebody can enlighten us both :-) Regards Petr Thanks for all your help! Kathi Regards Petr Kathi On Mon, 30 Jun 2008 11:48:43 +0200, Petr PIKAL wrote Hi [EMAIL PROTECTED] napsal dne 30.06.2008 11:14:48: Dear R help list I have recently started using R to visualize time series of water level measurements. The code I wrote does exactly what I want: plot(x, a$B112, axes=FALSE, ylim=c(405,410), col=red, pch=15, type=o, ylab=metres above sea level, main=Main Plot Title) axis(2, at=405:410, tck=1, col=gray60) axis.Date(1, at=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), labels=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month), tck=1, col=gray60) Now I wanted to shift the data visualized by 6 months, so I replaced 2004-01-01 by 2004-07-01 and 2008-06-01 by 2008-12-01. Instead of the desired plot, I get an error message stating (forgive the perhaps faulty translation into English, I'm working on a German version of R): mistake in axis(side, at = z, labels = labels, ...) : length of 'at' and 'labels' different, 50 != 54 Those two calls have different length at=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month) labels=seq(as.Date(2004-01-01), as.Date(2008-06-01), by=month) you can try it by
[R] Migrating from S-Plus to R - Exporting Tables
Hi, I want to export an table using the write.table and i want is this format: (this table was exported in s-plus) Q01 row.names Num Percmeabstdev min P5 P10 P25 P50 P75 P90 P95 max A 10237 47.88 183.48 38.84 86.98 126.52 138.13 157.82 182.41 210.17 238.94 254.13 354.49 B 10243 47.91 186.91 36.55 86.98 128.18 139.96 159.27 182.42 208.75 233.2 249.07 336.17 762 3.56178.73 36.37 90.19 114.27 127.16 144.88 166.59 193.56 220.37 234.42 307.87 * 137 0.64150.77 32.88 96.42 112.72 120.59 139.84 159.36 181.25 206.01 216.33 254.58 tot 21379 100 182.48 37.77 86.98 126.52 138.22 157.85 181.75 208.82 235.51 251.35 354.49 It is a lot of tables, in S-plus I was using for (i in 1:length(nrotulos)) { write.table(nomequest[i], Y:\\questgeral.txt,sep=\t,append=T) write.table(questgeral[[i]], Y:\\questgeral.txt,sep=\t,dimnames.write=T,append=T) } Now, i am trying to do the same thing in R. But, I have a lot of warnings and the result is: x 1 Q05 Num Percmedia stdev min P5 P10 P25 P50 P75 P90 P95 max 1 12418 58 183.71 37.28 86.98 126.11 138.11 157.58 180.95 207.55 233.76 249.24 354.49 2 489822.88 188.45 38.79 86.98 128.89 140.62 160.69 185.38 214.12 241.36 256.39 344.28 3 216110.09 188.22 39.38 87.13 126.97 138.63 159.67 186.76 212.59 241.15 256.44 352.71 4 19349.03175.7 34.59 86.98 122.76 133 152.29 172.4 198.13 220.71 237.78 317.62 tot 21411 100 184.53 37.77 86.98 126.52 138.22 157.85 181.75 208.82 235.51 251.35 354.49 using this code: for (i in 1:length(nrotulos04)) { write.table(nomequest[i], Y:/questimp1104m.txt,dec=.,sep=;,append=T,quote=F) write.table(questimp[[i]], Y:/questimp1104m.txt,dec=.,sep=;,append=T,quote=F) } How can I put the row.names before the col num in R? And how can I remove the x in first line and the number 1 and the ^t in the second line before Q05? Thanks for the advance! Leandro Marino __ 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] exporting ftable
How can I export an ftable object in the same format that appears in R command window? For testing that i was using this example that is in help of this function. ## Start with a contingency table. ftable(Titanic, row.vars = 1:3) ftable(Titanic, row.vars = 1:2, col.vars = Survived) ftable(Titanic, row.vars = 2:1, col.vars = Survived) ## Start with a data frame. x - ftable(mtcars[c(cyl, vs, am, gear)]) x ftable(x, row.vars = c(2, 4)) ## Start with expressions, use table()'s dnn to change labels ftable(mtcars$cyl, mtcars$vs, mtcars$am, mtcars$gear, row.vars = c(2, 4), dnn = c(Cylinders, V/S, Transmission, Gears)) When I tried to export the object x i have thsis result: V1 V2 V3 1 0 0 0 2 0 0 1 3 1 2 0 4 0 6 1 5 0 0 0 6 0 2 1 7 2 2 0 8 0 0 0 9 12 0 0 10 0 0 2 11 0 0 0 12 0 0 0 I used to export: write.table(x,c:/x.txt) Thanks in advance! Best regards, Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: how to automatically maximize the graph window (under XP) ?
Hi, you can use the jpeg(), pdf(), bmp() functions. In this function you can determinate the size of the graph, background color, quality of the image. Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Ptit_Bleu Enviada em: terca-feira, 1 de julho de 2008 12:50 Para: r-help@r-project.org Assunto: [R] how to automatically maximize the graph window (under XP) ? Hello, I'm trying to produce graphs automatically from data stored in database. Before saving the graphs, I would like to maximize the size of the graphs. The best would be to directly open maximized windows with x11() but up to now I failed doing it. I tried different widths and heighs but I never managed to obtain a full screen window. Is there a command to do it ? Thanks in advance, Ptit Bleu. PS : I'm under XP -- View this message in context: http://www.nabble.com/how-to-automatically-maximize-the-graph-window-%28unde r-XP%29---tp18219242p18219242.html Sent from the R help mailing list archive at Nabble.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. __ 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] RES: Invalid object error in boxplot
HI Miriam, the problem is that you have the Date and some other factors in your database. try to use the lapply(your_base,class) and see what appears. If you have any kind of factor or date you cannot use boxplot. If you verify that only V1, V2 and V3 are numeric you can do the box plot with this sintax: boxplot(your_base[,c(V1,V2,V3]) or boxplot(your_base[,c(5:7)] Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de [EMAIL PROTECTED] Enviada em: terca-feira, 1 de julho de 2008 12:22 Para: r-help@r-project.org Assunto: [R] Invalid object error in boxplot Hi, I'm trying to make a boxplot with the data at the end of the message, and when I try to execute the command boxplot(Diatoms) (or for any other field instead of Diatoms) I get the following error message: Error in oldClass(stats) - cl : adding class factor to an invalid object Any advice would be much appreciated. Thanks a lot, Miriam Date Depth Diatoms Bacteria V1 V2 V3 1 15/02/2000 0 17 700,000 14,067,895 380,000 69,000 2 15/02/2000 2 17 316,680 9,311,160 250,000 26,000 3 15/02/200010 20 313,010 8,422,355 460,000 30,000 4 15/02/200020 21 374,535 9,259,900 280,000 33,000 5 22/02/2000 0 21 370,000 16,952,360 320,000 72,000 6 22/02/2000 2 21 462,480 10,526,390 360,000 64,000 7 22/02/200010 39 374,860 8,378,655 290,000 49,000 8 22/02/200020 140 381,900 9,468,550 390,000 73,000 9 29/02/2000 0 240 200,000 5,783,980 440,000 61,000 10 29/02/2000 2 240 224,125 8,077,105 600,000 89,000 11 29/02/200010 110 190,810 8,154,005 600,000 61,000 12 29/02/200020 460 177,050 8,333,120 600,000 69,000 13 08/03/2000 0 1,800 270,000 5,277,265 200,000 34,000 14 08/03/2000 2 1,800 403,380 9,237,105 490,000 80,000 15 08/03/200010 1,400 372,530 10,624,735 480,000 57,000 16 08/03/200020 3,100 261,215 6,228,160 340,000 37,000 17 14/03/2000 0 4,900 750,000 16,258,720 440,000 80,000 18 14/03/2000 2 4,900 633,895 10,952,305 380,000 54,000 19 14/03/200010 4,100 583,367 10,383,383 310,000 53,000 20 14/03/200020 8,200 653,945 10,148,210 380,000 48,000 21 21/03/2000 0 850 570,000 11,000,000 180,000 170,000 22 21/03/2000 2 850 520,000 27,000,000 130,000 190,000 23 21/03/200010 1,800 540,000 21,000,000 250,000 140,000 24 21/03/200020 1,800 470,000 10,000,000 110,000 70,000 25 27/03/2000 0 1,300 640,000 13,000,000 170,000 90,000 26 27/03/2000 2 1,300 770,000 17,000,000 230,000 120,000 27 27/03/200010 520 720,000 15,000,000 120,000 170,000 28 27/03/200020 130 620,000 12,000,000 98,000 74,000 29 04/04/2000 0 2,003 940,000 29,582,000 190,000 46,000 30 04/04/2000 2 2,003 952,400 27,186,525 210,000 67,000 31 04/04/200010 1,671 503,300 11,140,225 85,000 24,000 32 04/04/200020 863 682,550 14,605,825 140,000 32,000 33 07/04/2000 0 1,653 840,000 15,862,125 370,000 95,000 34 07/04/2000 2 1,653 819,350 13,099,600 280,000 67,000 35 07/04/200010 1,520 769,825 13,395,825 240,000 57,000 36 07/04/200020 422 784,700 10,910,700 170,000 28,000 37 12/04/2000 0 7,671 640,000 9,851,750 470,000 100,000 38 12/04/2000 2 7,671 600,625 9,339,400 490,000 170,000 39 12/04/200010 5,865 585,650 8,439,300 450,000 180,000 40 12/04/200020 1,276 595,225 7,297,150 360,000 92,000 41 14/04/2000 0 10,479 730,000 12,406,650 540,000 140,000 42 14/04/2000 2 10,479 700,000 10,406,650 490,000 110,000 43 14/04/200010 6,576 682,500 9,869,050 470,000 100,000 44 14/04/200020 3,307 739,075 8,875,250 420,000 180,000 45 16/04/2000 0 1,636 890,000 9,653,050 290,000 120,000 46 16/04/2000 2 1,636 885,725 9,934,300 300,000 97,000 47 16/04/200010 2,986 973,750 10,270,975 310,000 190,000 48 16/04/200020 1,222 629,250 6,792,500 210,000 90,000 49 19/04/2000 0 656 730,000 12,751,350 510,000 150,000 50 19/04/2000 2 656 831,575 13,673,700 400,000 120,000 51 19/04/200010 480 723,925 11,230,150 420,000 100,000 52 19/04/200020 872 671,975 9,858,900 330,000 97,000 53 27/04/2000 0 180 1,000,000 15,346,525 370,000 85,000 54 27/04/2000 2 180 926,800 22,825,400 670,000 93,000 55 27/04/200010 7 880,925 15,121,675 490,000 86,000 56 27/04/200020 64 723,100 10,638,400 230,000 21,000 -- University of St Andrews Webmail: https://webmail.st-andrews.ac.uk __ 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
[R] RES: WIERD: Basic computing in R
Hi, the problem is what you want! With the -2.7^8.6 you are doing -(2.7^8.6) it exists... But, if you try (-2.7)^8.6 the R gives you NaN. When you define p=-2.7 and q=8.6 and do p^q you are doing that (-2.7)^8.6. If you write p=2.7 and q=8.6 and use the -p^q it will work! Leandro Marino www.leandromarino.com.br -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de Dirk Eddelbuettel Enviada em: terca-feira, 1 de julho de 2008 15:19 Para: [EMAIL PROTECTED] Cc: r-help@r-project.org Assunto: Re: [R] WIERD: Basic computing in R On Tue, Jul 01, 2008 at 11:15:58AM -0700, [EMAIL PROTECTED] wrote: Can someone please enlighten me as to why the following happens? -2.7^8.6 [1] -5125.407 p- -2.7 q- 8.6 p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the computation is repeated. Thanks in advance for any suggetsions. Try -(p^q) Dirk -- Three out of two people have difficulties with fractions. __ 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.
[R] plot window
Hi list, I want to know how can i creat a plot window with this configuration: ___ | | | PLOT 1| | | |-| | | | | | | | PLOT 2 |PLOT 3| | | | | | | |-| | | | | | | | PLOT 4 |PLOT 5| | | | | | | |-| | | | PLOT 6| | | ___ and other configurations! Thanks for the help! Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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] RES: plot window
I will see the code! It is similar that i want! Thanks a lot! -Mensagem original- De: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Enviada em: terça-feira, 1 de julho de 2008 16:22 Para: Leandro Marino Cc: [EMAIL PROTECTED] Org Assunto: Re: [R] plot window Look at the code for the graphic on the R home page. If you click on it you will see the code. On Tue, Jul 1, 2008 at 3:15 PM, Leandro Marino [EMAIL PROTECTED] wrote: Hi list, I want to know how can i creat a plot window with this configuration: ___ | | | PLOT 1| | | |-| | | | | | | | PLOT 2 |PLOT 3| | | | | | | |-| | | | | | | | PLOT 4 |PLOT 5| | | | | | | |-| | | | PLOT 6| | | ___ and other configurations! Thanks for the help! Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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.
[R] RES: Change name of a specific column of a data frame
You can use names(database)[position] where position is the number of the column that you want to rename! Leandro Marino -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] nome de [EMAIL PROTECTED] Enviada em: terca-feira, 1 de julho de 2008 16:18 Para: R-help@r-project.org Assunto: [R] Change name of a specific column of a data frame Hi, Sorry for the simple question. Is there a way to change the name of only one column of an existing data frame? I know colnames allows you to set the name of all the columns, but only one column in the middle of my data frame needs a new name. Thanks, -Nina __ 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.
[R] RES: Need ideas on how to show spikes in my data and how to codeit in R
Hi list, I want to make a lot of graphics to my end course project. So, i was using this sintax: jpeg(filename = graf01.jpg, width = 1024, height = 1024, units = px, pointsize = 25, quality = 100, bg = grey95, res = NA, restoreConsole = TRUE) i=1 par(mfrow=c(4,1),col=grey90,font.lab=2) hist(sul[,i+2],nclass=75,xlab=Região Sul,ylab=Freqüência,col=antiquewhite4,main=) hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4, main=) hist(SC[,i+2],nclass=75,xlab=Santa Catarina,ylab=Freqüência,col=antiquewhite4,main=) hist(RS[,i+2],nclass=75,xlab=Rio Grande do Sul,ylab=Freqüência,col=antiquewhite4,main=) dev.off() But, I want to know how can I create an for to do that. Like that: for(i in 1:250){ jpeg(filename = graf01.jpg, width = 1024, height = 1024, units = px, pointsize = 25, quality = 100, bg = grey95, res = NA, restoreConsole = TRUE) par(mfrow=c(4,1),col=grey90,font.lab=2) hist(sul[,i+2],nclass=75,xlab=Região Sul,ylab=Freqüência,col=antiquewhite4,main=) hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4, main=) hist(SC[,i+2],nclass=75,xlab=Santa Catarina,ylab=Freqüência,col=antiquewhite4,main=) hist(RS[,i+2],nclass=75,xlab=Rio Grande do Sul,ylab=Freqüência,col=antiquewhite4,main=) dev.off() } The problem is the name of the file, I want to do something like grafi.jpg where i goes from 1 to 250. Thanks a lot for the help. Best Regards, Leandro Marino __ 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] Graphs in R
Hi list, I want to make a lot of graphics to my end course project. So, i was using this sintax: jpeg(filename = graf01.jpg, width = 1024, height = 1024, units = px, pointsize = 25, quality = 100, bg = grey95, res = NA, restoreConsole = TRUE) i=1 par(mfrow=c(4,1),col=grey90,font.lab=2) hist(sul[,i+2],nclass=75,xlab=Região Sul,ylab=Freqüência,col=antiquewhite4,main=) hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4, main=) hist(SC[,i+2],nclass=75,xlab=Santa Catarina,ylab=Freqüência,col=antiquewhite4,main=) hist(RS[,i+2],nclass=75,xlab=Rio Grande do Sul,ylab=Freqüência,col=antiquewhite4,main=) dev.off() But, I want to know how can I create an for to do that. Like that: for(i in 1:250){ jpeg(filename = graf01.jpg, width = 1024, height = 1024, units = px, pointsize = 25, quality = 100, bg = grey95, res = NA, restoreConsole = TRUE) par(mfrow=c(4,1),col=grey90,font.lab=2) hist(sul[,i+2],nclass=75,xlab=Região Sul,ylab=Freqüência,col=antiquewhite4,main=) hist(PR[,i+2],nclass=75,xlab=Paraná,ylab=Freqüência,col=antiquewhite4, main=) hist(SC[,i+2],nclass=75,xlab=Santa Catarina,ylab=Freqüência,col=antiquewhite4,main=) hist(RS[,i+2],nclass=75,xlab=Rio Grande do Sul,ylab=Freqüência,col=antiquewhite4,main=) dev.off() } The problem is the name of the file, I want to do something like grafi.jpg where i goes from 1 to 250. Thanks a lot for the help. Best Regards, Leandro Marino __ 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] Loading an S-Plus object, database
Hi I am changing my databases from S-plus to R. I want to know how can I use that? May I only attach the folder _Data equal I do in S-plus? Thanks! Best Regards, Leandro Marino __ 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] Read sas7bdat
Hi, I was reading e-mail about one doubt that you were when you read files .sas7bdat in R. Now, I am with the same problem. But I don´t know how can i do that. I have download de Sas Viewer and i am using this sintax in r: read.ssd(X:\\users\\Anresc07,que0411.sas7bdat) SAS failed. SAS program at C:\DOCUME~1\leandro\CONFIG~1\Temp\RtmpXR1Tid\file3d6c4ae1.sas The log file will be file3d6c4ae1.log in the current directory NULL Warning messages: 1: In system(paste(sascmd, tmpProg)) : sas não encontrado 2: In read.ssd(X:\\users\\Anresc07, que0411.sas7bdat) : SAS return code was -1 Do you know what i can do to solve that? Thanks a lot! Best regards, Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 ( (21) 2103-9600 R.:236 ( (21) 8777-7907 * [EMAIL PROTECTED] Aquele que suporta o peso da sociedade é precisamente aquele que obtém as menores vantagens. (SMITH, Adam) P Antes de imprimir pense em sua responsabilidade e compromisso com o MEIO AMBIENTE __ 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.