[R] Exporting objects plotted with plot3d() - rgl package

Duncan Murdoch murdoch at stats.uwo.ca
Wed Apr 22 18:40:21 CEST 2009


On 4/22/2009 12:18 PM, Alejandro González wrote:
> Dear all,
> Can anybody tell me how to export a 3d figure made with the plot3d 
> function? I'm careless about whether it's still interactive or not in 
> another format, as long I can get it out of R.

snapshot3d() gets a bitmap in .png format.

rgl.postscript() creates a Postscript or other vector format file.  Some 
features of OpenGL aren't supported, so the quality varies quite a bit.

Duncan Murdoch

> Thanks!
> 
> Alejandro González
> Departamento de Biodiversidad y Conservación
> Real Jardín Botánico
> Consejo Superior de Investigaciones Científicas
> 
> Claudio Moyano, 1
> 28014 Madrid, Spain
> 
> Tel +0034 914203017
> 
> 
> 
> r-help-request at r-project.org escribió:
>> Send R-help mailing list submissions to
>> 	r-help at r-project.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> 	https://stat.ethz.ch/mailman/listinfo/r-help
>> or, via email, send a message with subject or body 'help' to
>> 	r-help-request at r-project.org
>>
>> You can reach the person managing the list at
>> 	r-help-owner at r-project.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of R-help digest..."
>>
>>
>> Today's Topics:
>>
>>    1. line wrap in R console under windows (William Simpson)
>>    2. lme for between-within anova (William Simpson)
>>    3. Re: joined R-today (Liviu Andronic)
>>    4. Package or packages for randomization in a clinical trial
>>       (John Sorkin)
>>    5. Re: joined R-today (Bala subramanian)
>>    6. Sampling in R (Seyit Ali Kayis)
>>    7.  search through a matrix (onyourmark)
>>    8. Re: bug when subtracting decimals? (Duncan Murdoch)
>>    9. Re: search through a matrix (Uwe Ligges)
>>   10. Re: Sampling in R (Uwe Ligges)
>>   11. Odp:  Sampling in R (Petr PIKAL)
>>   12. Re: search through a matrix (Dimitris Rizopoulos)
>>   13. Re: line wrap in R console under windows (Duncan Murdoch)
>>   14. Re: Sampling in R (Mike Lawrence)
>>   15. Re: Sampling in R: Please read my email from attached text.
>>       (David Winsemius)
>>   16. Re: Question on binomial data (David Winsemius)
>>   17. Fix/Edit Error (Bronagh Grimes)
>>   18. Re: joined R-today (Dimitri Liakhovitski)
>>   19. Re: Random Forests: Question about R^2 (Liaw, Andy)
>>   20. Re: Random Forests: Predictor importance for Regression Trees
>>       (Liaw, Andy)
>>   21. Re: joined R-today (Bala subramanian)
>>   22. Re: Sampling in R (Jorge Ivan Velez)
>>   23. Re: joined R-today (Bala subramanian)
>>   24. rmysql fetch issues (Albert Vilella)
>>   25. Re: search through a matrix (onyourmark)
>>   26. Help with R 2.9.0 and XML (Luis Orlindo Tedeschi)
>>   27. Re: search through a matrix (David Winsemius)
>>   28. Re: search through a matrix (Kushantha Perera)
>>   29. Re: search through a matrix (onyourmark)
>>   30. Re: bug when subtracting decimals? (Marc Schwartz)
>>   31. Re: automatic exploration of all possible  loglinear models?
>>       (Frank E Harrell Jr)
>>   32. Re: Matrix package,solve() errors and crashes (Martin Maechler)
>>   33. OT: Strange bootstrap approach to significance testing
>>       (Mike Lawrence)
>>   34. Re: search through a matrix (Dimitri Liakhovitski)
>>   35. Re: Package or packages for randomization in a clinical trial
>>       (Marc Schwartz)
>>   36. Re: search through a matrix (David Winsemius)
>>   37. Re: bug when subtracting decimals? (ivan valencia)
>>   38. ncdf,RNetCDF (Bala subramanian)
>>   39. Re: what is R best for?  Evidence please. (John C Nash)
>>   40. Re: Cross-Correlation function (CCF) issues (manta)
>>   41. Re: ncdf,RNetCDF (Andris Jankevics)
>>   42. Re: automatic exploration of all possible  loglinear models?
>>       (Ben Bolker)
>>   43. Re: bug when subtracting decimals? (John C Nash)
>>   44. broken example: lme() + multcomp() Tukey on repeated measures
>>       design (William Simpson)
>>   45. Re: joined R-today (Peter Dalgaard)
>>   46. Re: broken example: lme() + multcomp() Tukey on repeated
>>       measures	design (Dieter Menne)
>>   47. Re: broken example: lme() + multcomp() Tukey on repeated
>>       measures design (David Winsemius)
>>   48. Re: ncdf,RNetCDF (Bala subramanian)
>>   49. Re: Cross-Correlation function (CCF) issues (David Winsemius)
>>   50.  ggplot2 - boxplot of variables / columns (Andreas Christoffersen)
>>   51. Re: joined R-today (Marc Schwartz)
>>   52. Re: joined R-today (Bala subramanian)
>>   53. Re: Cross-Correlation function (CCF) issues (manta)
>>   54. plotting with R (Bala subramanian)
>>   55. Re: joined R-today (Marc Schwartz)
>>   56. Re: ggplot2 - boxplot of variables / columns (ONKELINX, Thierry)
>>   57. Re: Fitting linear models (Vemuri, Aparna)
>>   58. Re: ggplot2 - boxplot of variables / columns (David Winsemius)
>>   59. Re: Cross-Correlation function (CCF) issues (David Winsemius)
>>   60. Re: plotting with R (David Winsemius)
>>   61. Re: Fitting linear models (Dimitri Liakhovitski)
>>   62. Re: plotting with R (Stephen J. Barr)
>>   63. Re: Fitting linear models (Vemuri, Aparna)
>>   64. Re: Fitting linear models (Dimitri Liakhovitski)
>>   65. Re: Fitting linear models (Vemuri, Aparna)
>>   66. Re: Fitting linear models (Dimitri Liakhovitski)
>>   67. Re: Fitting linear models (David Winsemius)
>>   68. Re: ggplot2 - boxplot of variables / columns
>>       (Andreas Christoffersen)
>>   69. Re: Fitting linear models (Vemuri, Aparna)
>>   70. My surprising experience in trying out REvolution's R (Jason Liao)
>>   71. Blanchard Quah/Impulse Response Functions (Laura Carvalho)
>>   72. fitting assimptotic decaing with - and + on X (milton ruser)
>>   73. Polyspline Integration (Denney, William S.)
>>   74.  DNAcopy package in R (Selena Niu)
>>   75. Re: Fitting linear models (Dimitri Liakhovitski)
>>   76. Re: Fitting linear models (Marc Schwartz)
>>   77. Re: Fitting linear models (Vemuri, Aparna)
>>   78. Re: bug when subtracting decimals? (hadley wickham)
>>   79. Re: Fitting linear models (Dimitri Liakhovitski)
>>   80. Re: Fitting linear models (Vemuri, Aparna)
>>   81. Re: DNAcopy package in R (David Winsemius)
>>   82. Re: Fitting linear models (David Winsemius)
>>   83. Re: bug when subtracting decimals? (Sarah Goslee)
>>   84. how to inspect content of save file (Benno P?tz)
>>   85. Re: joined R-today [SELinux] (William Dunlap)
>>   86. Re: how to inspect content of save file (Dimitri Liakhovitski)
>>   87. Re: My surprising experience in trying out REvolution's R
>>       (Bert Gunter)
>>   88. Changing the binning of collected data (Lorenzo Isella)
>>   89. Re: automatic exploration of all possible  loglinear models?
>>       (Christopher W. Ryan)
>>   90. Re: My surprising experience in trying out REvolution's R
>>       (David M Smith)
>>   91. Re: Changing the binning of collected data (Luc Villandre)
>>   92. Signed-Binary transform test (Fisher.test??) (Jorge Cornejo)
>>   93. multiple plots in same graph window (BARRES-DE-ALMEIDA U.)
>>   94. Re: Polyspline Integration (Denney, William S.)
>>   95. Re: automatic exploration of all possible  loglinear models?
>>       (Dimitris Rizopoulos)
>>   96. Re: multiple plots in same graph window (David Winsemius)
>>   97.  Quality control and possible QC in R book? (Erin Hodgess)
>>   98. Re: Cross-Correlation function (CCF) issues (manta)
>>   99. Re: create objects in a loop and adding sqlQuery content to
>>       them (Katharina May)
>>   100. plot with 2 y axes (Christophe Dutang)
>>   101. Re: multiple plots in same graph window (William Dunlap)
>>   102. Deleting rows or cols that do not meet cut off (Crosby, Jacy R)
>>   103. Re: Cross-Correlation function (CCF) issues (David Winsemius)
>>   104. Re: Deleting rows or cols that do not meet cut off
>>       (Stephan Kolassa)
>>   105. Re: Deleting rows or cols that do not meet cut off (Rolf Turner)
>>   106. Re: plot with 2 y axes (Ben Bolker)
>>   107. Re: Cross-Correlation function (CCF) issues (manta)
>>   108. Re: Question on binomial data (ehud cohen)
>>   109. Re: Cross-Correlation function (CCF) issues (David Winsemius)
>>   110. Re: Deleting rows or cols that do not meet cut off
>>       (Wacek Kusnierczyk)
>>   111. Re: Cross-Correlation function (CCF) issues (manta)
>>   112. Re: Deleting rows or cols that do not meet cut off
>>       (Wacek Kusnierczyk)
>>   113. Re: Deleting rows or cols that do not meet cut off
>>       (Stephan Kolassa)
>>   114. Re: Cross-Correlation function (CCF) issues (David Winsemius)
>>   115. sas.get() exit (Nirav Mehta)
>>   116. Re: Question on binomial data (David Winsemius)
>>   117. Re: sas.get() exit (Nordlund, Dan (DSHS/RDA))
>>   118. Re: sas.get() exit (Nirav Mehta)
>>   119. Re: sas.get() exit (Nordlund, Dan (DSHS/RDA))
>>   120. Re: sas.get() exit (Nirav Mehta)
>>   121. anova table with lmer (Julien Beguin)
>>   122. How to extract integer in a data frame (Gundala Viswanath)
>>   123.  error when using vcovHC() (oliviax)
>>   124. Re: How to extract integer in a data frame (Marc Schwartz)
>>   125. Re: How to extract integer in a data frame (Duncan Murdoch)
>>   126. Re: How to compare parameters of non linear fitting curves
>>       (spencerg)
>>   127. using Rmath in c-functions of R packages (Volodymyr Melnykov)
>>   128. Re: using Rmath in c-functions of R packages (Duncan Murdoch)
>>   129. Re: Quality control and possible QC in R book? (C.H.)
>>   130. Re: plotting with R (Erik Iverson)
>>   131. memory.limit (Derek Stephen Elmerick)
>>   132. Finding and moving files (Daniel Bradley)
>>   133. Re: using Rmath in c-functions of R packages (Volodymyr Melnykov)
>>   134. Re: Finding and moving files (Bill.Venables at csiro.au)
>>   135. Color coded 3D plot (mauede at alice.it)
>>   136. Re: Question on binomial data (ehud cohen)
>>   137. Subsetting a vector of numerics such that standard deviation
>>       is	less than 0.5 ? (Daren Tan)
>>   138. Re: search through a matrix (onyourmark)
>>   139. Re: Color coded 3D plot (Kingsford Jones)
>>   140. Re: Finding and moving files (Stephen J. Barr)
>>   141. Re: My surprising experience in trying out REvolution's R
>>       (Dieter Menne)
>>   142. integrate lgamma from 0 to Inf (Andreas  Wittmann)
>>   143.  Merging data frames, or one column/vector with a data frame
>>       filling out empty rows with NA's (joe1985)
>>   144. Copula package (Roslina Zakaria)
>>   145. Re: automatic exploration of all possible  loglinear models?
>>       (bartjoosen)
>>   146. Re: Copula package (Pfaff, Bernhard Dr.)
>>   147. Re: Generate bivariate binomial data (ONKELINX, Thierry)
>>   148.  Intervention Time Series Analyis Tutorial/Package
>>       (Dominik Hattrup)
>>   149. Re: DNAcopy package in R (Ramon Diaz-Uriarte)
>>   150. R:  Color coded 3D plot (mauede at alice.it)
>>   151. Better 'documenting' R? (Was: Re: bug when	subtracting
>>       decimals?) (Gavin Simpson)
>>   152. converting histogram to barchart (Thomas Fr?jd)
>>   153. Gee with nested desgin (ONKELINX, Thierry)
>>   154. Re: how to inspect content of save file (Benno P?tz)
>>   155. Re: broken example: lme() + multcomp() Tukey on repeated
>>       measures design (William Simpson)
>>   156. Re: plotting with R (baptiste auguie)
>>   157. Re: Gee with nested desgin (Dimitris Rizopoulos)
>>   158. Re: bug when subtracting decimals? (Martin Maechler)
>>   159. Re: graph with 15 combinations (Jim Lemon)
>>   160. Re: using Rmath in c-functions of R packages (Martin Maechler)
>>   161. Re: SEM package (Jim Lemon)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Tue, 21 Apr 2009 11:03:52 +0100
>> From: William Simpson <william.a.simpson at gmail.com>
>> Subject: [R] line wrap in R console under windows
>> To: r-help at r-project.org
>> Message-ID:
>> 	<21ce39b20904210303h34a95282q122dc554cb7ca0de at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> I would like the R console to wrap lines at 80 cols.
>> It does not do so, even though I have used the Rgui Configuration
>> Editor to set the Console cols at 80 and the Pager cols at 80.
>>
>> Please tell me how to set it up so I have word wrap.
>>
>> Just to be clear: in older/other R versions, console input is wrapped
>> at 80 cols and so you have something that looks like
>>   
>>> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah
>>>     
>>  blah blah blah blah blah blah blah blah blah blah blah blah blah blah
>> blah blah blah blah
>> Instead of what I see, which is
>>   
>>> blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah$
>>>     
>> and I need to scroll sideways to see the rest of the stuff past $
>>
>> I checked the archives and saw no postings on this.
>>
>> Thanks very much for any help.
>>
>> Bill
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Tue, 21 Apr 2009 11:10:10 +0100
>> From: William Simpson <william.a.simpson at gmail.com>
>> Subject: [R] lme for between-within anova
>> To: r-help at r-project.org
>> Message-ID:
>> 	<21ce39b20904210310i139a53berd38642cddd13038a at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> I have the following between-within anova:
>> aovn1 <- aov(amplitude ~ stereo*site*stimulus +
>> Error(subject/(site*stimulus)), stereon1)
>>
>> This works fine. BUT I need to do Tukey HSD multiple comparisons, and
>> the aov() approach won't work. So I am trying the method posted on
>> r-help:
>> lmen1 <- lme(amplitude ~ stereo*site*stimulus, random =
>> ~1|subject/(site*stimulus), stereon1)
>>
>> This doesn't work:
>>   
>>> lmen1 <- lme(amplitude ~ stereo*site*stimulus, random = ~1|subject/(site*stimulus), stereon1)
>>>     
>> Error in getGroups.data.frame(dataMix, groups) :
>>         Invalid formula for groups
>>
>> Please tell me what to do to get the lme() fit to work.
>>
>> After I get lmen1, I will do:
>> anova(lmen1)
>>
>> summary(lmen1)
>> summary(glht(lmen1, linfct=mcp(V="Tukey")))
>>
>> Please tell me if that sounds right.
>>
>> Thanks very much for any help!
>>
>> Bill
>>
>> ============= This is the example I am following (with modifications
>> for my expt design)
>> You want to use lme() in package nlme, then glht() in the multcomp
>> package.  This will give you multiplicity adjusted p-values and
>> confidence intervals.
>>
>> ## Example
>> require(MASS)         ## for oats data set
>> require(nlme)         ## for lme()
>> require(multcomp)  ## for multiple comparison stuff
>>
>> Aov.mod <- aov(Y ~ N + V + Error(B/V), data = oats)
>> Lme.mod <- lme(Y ~ N + V, random = ~1 | B/V, data = oats)
>>
>> summary(Aov.mod)
>> anova(Lme.mod)
>>
>> summary(Lme.mod)
>> summary(glht(Lme.mod, linfct=mcp(V="Tukey")))
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Tue, 21 Apr 2009 12:12:34 +0200
>> From: Liviu Andronic <landronimirc at gmail.com>
>> Subject: Re: [R] joined R-today
>> To: Bala subramanian <bala.biophysics at gmail.com>
>> Cc: r-help at r-project.org
>> Message-ID:
>> 	<68b1e2610904210312g651337b6v3c4d0d29d0bd41df at mail.gmail.com>
>> Content-Type: text/plain; charset=UTF-8
>>
>> On Tue, Apr 21, 2009 at 11:57 AM, Bala subramanian
>> <bala.biophysics at gmail.com> wrote:
>>   
>>> Dear Simon,
>>> I installed the ncdf package in the way you suggested but still i got the
>>> same error i got before. I haves pasted below the installation log and
>>> errors.
>>>
>>>     
>> Does ncdf depend on netcdf [1]? If so, perhaps it is missing, or is
>> not up-to-date. Also, it's a good habit to install.packages('ncdf',
>> dep=TRUE).
>> Regards,
>> Liviu
>>
>> [1] http://www.unidata.ucar.edu/software/netcdf/
>>
>>
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Tue, 21 Apr 2009 06:12:32 -0400
>> From: "John Sorkin" <jsorkin at grecc.umaryland.edu>
>> Subject: [R] Package or packages for randomization in a clinical trial
>> To: <r-help at r-project.org>
>> Message-ID: <49ED63CE.91DF.00CB.0 at grecc.umaryland.edu>
>> Content-Type: text/plain; charset=US-ASCII
>>
>> Can anyone recommend a package that can be used to randomize subjects? I am looking for a generalized package, or several packages that can accomplish 
>> unrestricted randomization (i.e. simple random assignment)
>> restricted randomization including stratified randomization, blocked randomization, and adaptive randomization.
>> Thanks,
>> John
>>
>> John David Sorkin M.D., Ph.D.
>> Chief, Biostatistics and Informatics
>> University of Maryland School of Medicine Division of Gerontology
>> Baltimore VA Medical Center
>> 10 North Greene Street
>> GRECC (BT/18/GR)
>> Baltimore, MD 21201-1524
>> (Phone) 410-605-7119
>> (Fax) 410-605-7913 (Please call phone number above prior to faxing)
>>
>> Confidentiality Statement:
>> This email message, including any attachments, is for th...{{dropped:6}}
>>
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Tue, 21 Apr 2009 12:21:09 +0200
>> From: Bala subramanian <bala.biophysics at gmail.com>
>> Subject: Re: [R] joined R-today
>> To: Liviu Andronic <landronimirc at gmail.com>
>> Cc: r-help at r-project.org
>> Message-ID:
>> 	<288df32a0904210321l64d25470yea9aef47c5859221 at mail.gmail.com>
>> Content-Type: text/plain
>>
>> Hi,
>> Yes ncdf needs netcdf, netcdf is already installed in my fedora10. I
>> reinstalled ncdf with the following option
>>   
>>> install.packages('ncdf',dep=TRUE)
>>> library(ncdf)> library(ncdf)
>>>     
>> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>>   unable to load shared library '/usr/lib/R/library/ncdf/libs/ncdf.so':
>>   /usr/lib/R/library/ncdf/libs/ncdf.so: cannot restore segment prot after
>> reloc: Permission denied
>> Error in library(ncdf) : .First.lib failed for 'ncdf'
>>
>> Again the same error,
>> Bala
>>
>>
>> On Tue, Apr 21, 2009 at 12:12 PM, Liviu Andronic <landronimirc at gmail.com>wrote:
>>
>>   
>>> On Tue, Apr 21, 2009 at 11:57 AM, Bala subramanian
>>> <bala.biophysics at gmail.com> wrote:
>>>     
>>>> Dear Simon,
>>>> I installed the ncdf package in the way you suggested but still i got the
>>>> same error i got before. I haves pasted below the installation log and
>>>> errors.
>>>>
>>>>       
>>> Does ncdf depend on netcdf [1]? If so, perhaps it is missing, or is
>>> not up-to-date. Also, it's a good habit to install.packages('ncdf',
>>> dep=TRUE).
>>> Regards,
>>> Liviu
>>>
>>> [1] http://www.unidata.ucar.edu/software/netcdf/
>>>
>>>     
>>
>> 	[[alternative HTML version deleted]]
>>
>>
>>
>> ------------------------------
>>
>> Message: 6
>> Date: Tue, 21 Apr 2009 22:25:01 +1200
>> From: Seyit Ali Kayis <s_a_kayis at hotmail.com>
>> Subject: [R] Sampling in R
>> To: <r-help at r-project.org>
>> Message-ID: <BAY105-W34886F283B2E531D6C5844B4770 at phx.gbl>
>> Content-Type: text/plain
>>
>>
>> Dear R users, 
>>
>> I need to do sampling without replacement (bootstraps). I have two variables (Xvar, Yvar). 
>> I have a correlation from original data set cor(Xvar, Yvar)=0.6174221. I am doing 50000 sampling, 
>> and in each sampling  calculating correlations, saving, sorting and  getting 95% cutt off point (0.1351877). 
>> I am getting maximum value as 0.3507219 (much smaller than correlation of my original data). 
>> I repeated the sampling a  couple of time and none of them produced a correlation 
>> coefficient higher than my original data set. However, if I sort out my Xvar and Yvar and 
>> obtain correlation it is 0.9657125 which is much higher than correlation for my original data. 
>> I am doing sampling in another program and getting at least 1% higher correlation than mine. 
>> Now I am getting confused with sampling(random data) in R. My data and codes for the scenario above are below
>>
>>
>> Xvar<-c(0.1818182,0.5384615,0.5535714,0.4680851,0.4545455,0.4385965,0.5185185,0.4035088,0.4901961,0.3650794,0.462963,0.4,0.56,0.3965517,0.4909091,
>>         0.4716981,0.4310345,0.2,0.1509434,0.2647059,0.173913,0.1914894,0.1914894,0.1489362,0.1363636,0.2244898,0.2325581,0.1333333,0.1818182,0.1702128,
>>         0.2173913,0.2380952,0.1632653,0.5614035,0.3396226,0.4909091,0.3770492,0.5,0.5185185,0.5,0.4666667,0.4464286,0.362069,0.4285714,0.4561404,
>>         0.4736842,0.4545455,0.4166667,0.4181818,0.4590164,0.5166667,0.5423729,0.4833333,0.5454545,0.4393939,0.5172414,0.4098361,0.4745763,0.4754098,
>>         0.5166667,0.5,0.4603175,0.42,0.4038462,0.4897959,0.3148148,0.3673469,0.4,0.4583333,0.3877551,0.4375,0.4117647,0.4313725,0.5333333,0.3962264,
>>         0.3548387,0.5272727,0.4137931,0.3928571,0.4666667,0.4210526,0.4363636,0.4545455,0.4310345,0.4237288,0.4814815,0.4912281,0.4333333,0.4,0.4285714,
>>         0.4516129,0.5090909,0.4464286,0.4642857,0.4166667,0.4098361,0.4909091,0.3809524,0.5272727,0.4814815,0.5254237,0.627451,0.5,0.5471698,0.5454545,
>>         0.5925926,0.5769231,0.5818182,0.4444444,0.4915254,0.4727273,0.4107143,0.4285714,0.4310345,0.4237288,0.4285714,0.440678,0.4237288,0.4807692,
>>         0.4150943,0.4615385,0.4107143,0.4814815,0.4074074,0.4210526,0.5263158,0.440678,0.4576271,0.5344828,0.5,0.5636364,0.4677419,0.5,0.5192308,
>>         0.4642857,0.5090909,0.58,0.4482759,0.5098039,0.4035088,0.4210526,0.5098039,0.4385965,0.5283019,0.5471698,0.625,0.4310345,0.4912281,0.5283019,
>>         0.4576271,0.5471698,0.4745763,0.4821429)
>>
>> Yvar<-c(0.2553191,0.4107143,0.5660377,0.3888889,0.3606557,0.2898551,0.3818182,0.4,0.4,0.3278689,0.2903226,0.4074074,0.4181818,0.3,0.2238806,0.3728814,
>>         0.3709677,0.2307692,0.2830189,0.2244898,0.2142857,0.2131148,0.22,0.2258065,0.2321429,0.2,0.2264151,0.22,0.2115385,0.2459016,0.1166667,0.1785714,
>>         0.2068966,0.6,0.4285714,0.3134328,0.4461538,0.3965517,0.4769231,0.6181818,0.4827586,0.3709677,0.3965517,0.4821429,0.4545455,0.359375,0.4576271,
>>         0.4516129,0.5272727,0.4603175,0.4,0.4912281,0.5384615,0.5,0.4516129,0.4126984,0.4655172,0.5263158,0.4925373,0.358209,0.4285714,0.4920635,
>>         0.4482759,0.3235294,0.4,0.4375,0.440678,0.3898305,0.35,0.4528302,0.58,0.4153846,0.3174603,0.5185185,0.3870968,0.2894737,0.3709677,0.369863,
>>         0.3676471,0.3636364,0.3088235,0.328125,0.4032258,0.4084507,0.3188406,0.3636364,0.3823529,0.2816901,0.4722222,0.5,0.3521127,0.4393939,0.3787879,
>>         0.453125,0.4324324,0.4057971,0.4545455,0.4492754,0.5,0.4098361,0.4067797,0.3666667,0.3928571,0.4285714,0.5,0.2923077,0.4561404,0.45,0.5538462,
>>         0.4626866,0.4057971,0.3676471,0.5322581,0.5428571,0.375,0.4411765,0.4571429,0.4,0.3846154,0.3870968,0.4915254,0.530303,0.4375,0.4918033,0.4179104,
>>         0.4032258,0.3606557,0.5178571,0.4848485,0.390625,0.375,0.4375,0.3666667,0.4,0.4477612,0.2571429,0.4032258,0.3382353,0.4814815,0.4090909,0.3548387,
>>         0.4821429,0.5,0.557377,0.4333333,0.5454545,0.4590164,0.3943662,0.5076923,0.5,0.3283582,0.3676471,0.559322)
>>
>> my.cor<-cor(Xvar, Yvar)
>> print(my.cor)
>>  
>> nperm<-49999
>> Perm.Cor<-NULL
>>
>> for (iperm in 1:nperm)  {
>> XvarNew<-sample(Xvar, size=length(Xvar), replace=FALSE)    
>> YvarNew<-sample(Yvar, size=length(Yvar), replace=FALSE)     
>> perm.cor<-cor(XvarNew, YvarNew)
>> Perm.Cor<-c(Perm.Cor, perm.cor)
>>                         }
>> print(max(Perm.Cor))
>> XvarSorted<-sort(Xvar, decreasing=TRUE)
>> YvarSorted<-sort(Yvar, decreasing=TRUE)
>> max.cor<-cor(XvarSorted, YvarSorted)
>> print(max.cor)
>> if(mat.cor>0) Perm.Cor.Sorted<-sort(Perm.Cor, decreasing=TRUE)                        
>> if(mat.cor<0) Perm.Cor.Sorted<-sort(Perm.Cor, decreasing=FALSE)                        
>> T95<-Perm.Cor.Sorted[(nperm+1)*0.05]    # 95% treshold value
>> T99<-Perm.Cor.Sorted[(nperm+1)*0.01]    # 99% treshold value
>>
>>  
>>
>> I want to understand where I am making a mistake. Any comment is deeply appreciated.
>>
>> Kind Regards
>>
>> Seyit Ali
>>
>>
>> ------------------------------------------------------------------------------------------------------------------ 
>> Dr. Seyit Ali KAYIS
>> Selcuk University
>> Faculty of Agriculture
>> Kampus, Konya, TURKEY
>>
>>             s_a_kayis at yahoo.com,    s_a_kayis at hotmail.com
>> Tell: +90 332 223 2830  Mobile: +90 535 587 1139  Fax: +90 332 241 0108
>>
>>                    Greetings from Konya, TURKEY
>>                 http://www.ziraat.selcuk.edu.tr/skayis/
>> ---------------------------------------------------------------------------------------------------------------------- 
>>
>>
>>
>>
>>
>>
>>
>> _________________________________________________________________
>> Earning enough? Find out with SEEK Salary Survey
>>
>> %2Eco%2Enz%2F%3Ftracking%3Dsk%3Atl%3Asknzsal%3Amsnnz%3A0%3Ahottag%3Aearn%5Fenough&_t=757263783&_r=Seek_NZ_tagline&_m=EXT
>> 	[[alternative HTML version deleted]]
>>
>>
>>
>> ------------------------------
>>
>> Message: 7
>> Date: Tue, 21 Apr 2009 03:52:57 -0700 (PDT)
>> From: onyourmark <william108 at gmail.com>
>> Subject: [R]  search through a matrix
>> To: r-help at r-project.org
>> Message-ID: <23153538.post at talk.nabble.com>
>> Content-Type: text/plain; charset=us-ascii
>>
>>
>> Hi. I have a 925 by 925 correlation matrix corM. I want to identify all
>> variables that have correlation greater than 0.9.  Can anyone suggest an "R
>> way" of doing this?
>>
>> Thank you.
>>
> 
> ______________________________________________
> R-help at 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.




More information about the R-help mailing list