Re: [R] Matrix

2017-03-06 Thread Richard M. Heiberger
## 1. ## This could be captured into a function tmp <- matrix(0, 7, 4) tmp diag(tmp) <- 1 diag(tmp[-1,]) <- 2 diag(tmp[-(1:2),]) <- 3 diag(tmp[-(1:3),]) <- 4 tmp ## 2. v <- 1:4 v2 <- c(v, rep(0, length(v))) ## this generates a warning that can safely be ignored (or turned off) matrix(v2,

Re: [R] FOR TAKING PERCENTAGES of OTUS in each column (n=2910 COLUMNs)

2017-03-06 Thread Jeff Newmiller
If your problem really requires genetics jargon to be expressed, then perhaps you should be asking it in a forum where more of the participants are likely to understand it... like the Bioconductor help forum? https://www.bioconductor.org/help/support/ The Posting Guide mentioned in the footer

[R] FOR TAKING PERCENTAGES of OTUS in each column (n=2910 COLUMNs)

2017-03-06 Thread Thilini Maddegoda Vidanelage
Hi, I am analyzing a huge excel table with OTUs. In the table, I have 2910 columns and 365 rows.Each column represents one individual (n=2910). Rows represent microbial species (n=365). I have the total of all OTUs of microbial species under each column. Then I need to get the percentages of each

[R] Revolutions blog: February 2017 Roundup

2017-03-06 Thread David Smith via R-help
Since 2008, Microsoft (formerly Revolution Analytics) staff and guests have written about R every weekday at the Revolutions blog (http://blog.revolutionanalytics.com) and every month I post a summary of articles from the previous month of particular interest to readers of r-help. In case you

Re: [R] Cannot create a visible Choropleth Legend - GISTools

2017-03-06 Thread Bert Gunter
Perhaps FAQ 7.16 ? (Are you sourcing the code?) -- Bert 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 ) On Mon, Mar 6, 2017 at 11:54 AM, Henry Cann

[R] Cannot create a visible Choropleth Legend - GISTools

2017-03-06 Thread Henry Cann
I have combined two layers to create a shapefile which I am colouring using the Choropleth function in GISTools. The problem I am having is that despite having no other problems with my code including with the actual mapping of the choropleth itself, nothing I can do, using choro.legend, actually

Re: [R] Matrix

2017-03-06 Thread Mathew Guilfoyle
Effectively you want a circulant matrix but filled by column. Example input vector and number of columns x = c(1:8,19:20) nc = 5 For the result you specifically describe, the following generalises for any vector and any arbitrary number of columns 'nc', padding with zeros as necessary.

Re: [R] Matrix

2017-03-06 Thread Bert Gunter
Well, of course, I *did* make a dumb error (again!!). Here's the corrected version: x <- c(1:5,10:12) ## generate vector of indices by outer and %% i <- seq_along(x) nc <- 4 ## number of columns desired Corrected statement indx <- (outer(i, rev(i-1),"+") %% length(x)) [,seq_len(nc)] +1

Re: [R] Help installing R-3.3.2

2017-03-06 Thread peter dalgaard
Try 3.3.3, it has INSTALLATION on a UNIX-ALIKE: * The configure check for the zlib version is now robust to versions longer than 5 characters, including 1.2.11. -pd > On 06 Mar 2017, at 16:12 , Adamo Dahmani wrote: > > Hi, > > I am trying to install R-3.3.2

Re: [R] Matrix

2017-03-06 Thread Bert Gunter
Clever, Don. Here's a more explicit approach that generalizes (if I haven't made any dumb errors): x <- c(1:5,10:12) ## generate vector of indices by outer and %% i <- seq_along(x) nc <- 4 ## number of columns desired ## get subscripting indices via outer() and %% indx <- outer(i,rev(i),"+") %%

[R] Any reason not to use RUnit any longer?

2017-03-06 Thread Hans-Peter Suter
Hello, I see that quite some packages nowadays use testthat and that RUnit doesn't have recent updates. On the other hand Rccp, fTrading and others (still) test with RUnit. My old code uses RUnit and I would prefer to keep it that way unless there is an important reason to switch to testthat. If

Re: [R] Matrix

2017-03-06 Thread Rui Barradas
Hello, Try the following. proj <- function(x){ n <- length(x) y <- numeric(n) z <- rep(c(x, y), times = n) z <- z[-((length(z) - n + 1):length(z))] matrix(z, ncol = n) } proj(1:4) proj(1:5) Hope this helps, Rui Barradas Em 06-03-2017 16:18, Peter

Re: [R] Matrix

2017-03-06 Thread MacQueen, Don
How about this: p0 <- 1:4 matrix( c( rep( c(p0, rep(0, 4)) , times=3) , p0) , 7, 4) Of course, it would take some effort to generalize it to different lengths for p0. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On

Re: [R] regarding trouble in installation of gdalutils package in R 3.3.2

2017-03-06 Thread MacQueen, Don
Probably should take this question to the R-sig-geo mailing list. And you will need to tell people exactly what command(s) you used, and the exact resulting error message. Possibly you will have to ask for help from Rstudio, if it turns out the cause somehow has to do with Rstudio; I have no

[R] Matrix

2017-03-06 Thread Peter Thuresson
Hello, Is there a function in R which can transform, let say a vector: c(1:4) to a matrix where the vector is repeated but "projected" +1 one step down for every (new) column. I want the output below from the vector above, like this:

[R] Help installing R-3.3.2

2017-03-06 Thread Adamo Dahmani
Hi, I am trying to install R-3.3.2 in my user account. I have already installed all needed libraries. I run this command : ./configure 'LDFLAGS=-R$HOME/software/bzip2-1.0.6/ -R$HOME/software/zlib-1.2.11 -L$HOME/software/bzip2-1.0.6 -L$HOME/software/zlib-1.2.11 -L$HOME/software/xz-5.2.3/bin/lib/

[R] [R-pkgs] new packages idendro and idendr0

2017-03-06 Thread Tomas Sieger
Dear all, let me please announce two new R packages for interactive dendrogram exploration: idendro and idendr0. idendro [1] enables useRs to inspect hierarchical clustering dendrograms interactively: to select and color clusters, to zoom and pan the dendrogram, and to visualize the clustered

[R] regarding trouble in installation of gdalutils package in R 3.3.2

2017-03-06 Thread srutisudha mohanty
Hello I am trying to install gdalutils package in R 3.3.2 and Rstudio 1.0.136 , but some error is happening and it is unable to install. can you help me out ? Thanks !! Regards Sruti [[alternative HTML version deleted]] __

Re: [R] Antwort: Re: xtable: Width of Columns

2017-03-06 Thread Michael Dewey
On 06/03/2017 07:45, g.maub...@weinwolf.de wrote: Hi Michael, thank for you answer. Where do I have to put the code snippet "p(3cm)"? Is it neither an official argument to xtable() nor to print.xtable(). From the help about the align argument: Character vector of length equal to the

[R] R 3.3.3 is released

2017-03-06 Thread Peter Dalgaard
The build system rolled up R-3.3.3.tar.gz (codename "Another Canoe") this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.3.3.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries

Re: [R] how to draw the confidence interval

2017-03-06 Thread Jim Lemon
Hi laomeng, If you know how to plot the means and calculate the standard deviations, perhaps look at the "dispersion" function in the plotrix package. Jim On Sat, Mar 4, 2017 at 5:39 PM, laomeng_3 wrote: > hi all > I have a question about drawing the confidence interval . >

Re: [R] [FORGED] how to draw the confidence interval

2017-03-06 Thread Rolf Turner
On 06/03/17 19:35, laomeng_3 wrote: this is not homework, just a case which I made by myself. Be that as it may, if you are going to use R you should learn something about using R, rather than treating it as a magical black box. There is, as far as I know (not really very far!) no

Re: [R] [FORGED] how to draw the confidence interval

2017-03-06 Thread Daniel Nordlund
On 3/5/2017 10:35 PM, laomeng_3 wrote: this is not homework,just a case which I made by myself. �ʦ On 2017-03-06 06:47 , Rolf Turner Wrote: On 04/03/17 19:39, laomeng_3 wrote: hi all I have a question about drawing the confidence interval . For instance,if I want to sample