similar to: how to re-shape a matrix

Displaying 20 results from an estimated 3000 matches similar to: "how to re-shape a matrix"

2020 Jun 21
1
Possible bug in heatmap()?
Dear All, There might be a bug in heatmap(): x <- matrix(rnorm(10*5), 10, 5) heatmap(x, labCol=1:5) Error in axis(1, 1L:nc, labels = labCol, las = 2, line = -0.5, tick = 0, : 'at' and 'labels' lengths differ, 5 != 10 Works fine under 4.0.1. Looking at the code from 4.0.1 vs. Rdevel, esp. this part sticks out: labRow <- labRow[rowInd] %||% rownames(x) %||%
2012 May 22
3
pad leading zeros in front of strings
Dear All, This question sounds very simple but I don't know where I am wrong. I just want to pad leading zeros in some string, for example, "123" becomes "00123". What is wrong if I do following? > sprintf("%05s", "123") [1] " 123" It didn't return "00123", instead it padded with 'blank'. Thank you for your help
2012 Nov 06
2
R and SPSS
Hi group: I have a data set, which has severe colinearity problem. While running linear regression in R and SPSS, I got different models. I am wondering if somebody knows how to make the two software output the same results. (I guess the way R and SPSS handling singularity is different, which leads to different models.) Thanks. [[alternative HTML version deleted]]
2011 Feb 25
7
R in different OS
Hi All, I have two Rs, one has been installed in Windows system and another one has been installed under UNIX system. Is there any environmental variable or function to tell me which R I am using? The reason that I need to know it is under different system, the data path could be different. I want to do something like if it is R under Windows path =
2007 Apr 25
1
heatmap and phylogram / dendogram ploting problem, ape package
I am having trouble displaying a dendrogram of evolutionary relationships (a phylogram imported from the ape package) as the vertical component of a heatmap, but keeping the hierarchical clustering of the horizontal component. The relationships of the vertical component in the generated heatmap are not that of the dendrogram, although the ordering is. In more detail, I am attempting to generate
2011 Aug 30
1
locate the needed columns
Hi All, I have a data frame, whose colnames like "A.x, B.x, C.x, A.y, B.y, C.y". There could be many columns like this pattern. I want to compare data in columns A.x with A.y, B.x with B.y and C.x with C.y etc. Suppose my data frame is d, names(d) = c("A.x", "B.x", "C.x", "A.y", "B.y", "C.y"); If I want to D1 =
2012 Apr 10
1
re-install a package
Hi All, I have a self-cooked package and save it to a zip file after running make, say named xxx.zip. After installing it to R by running "Install packages from local zip files" under Packages menu in R (Windows), I realized I needed to change some source codes and re-make it. My question is that if I need re-install that package or R would automatically update the R
2012 Jul 09
1
install.packages
Hi All, I have two questions regarding install.packages(). Q1: may I run it in non-interactive mode, which means just install the packages I want rather than letting me to choose which mirror etc? Q2: I ran a R code in batch mode, for example, R CMD BATCH a.r In a.r, I have some statements like packages = library()$result[, "Package"]; f(! "plyr" %in% packages) {
2012 Oct 26
1
backward stepwise model selection
Hi All, I know in R there is function named 'step', which does the stepwise regression and choose the model by AIC. However, if I want to choose a model per this logic: 1. Run a full model (linear regression, f = lm(y ~., data = ZZZ), for example) 2. Pick up the variable with biggest p value, delete it from the module and get a new regression model. 3. Repeat step 2
2011 Mar 10
1
aggregate by part of a field
Hi All, I have a data frame like a = data.frame(date = c(20081201, 20081202, 20081201), product = c("a b c d e", "a b c g h t", "d e h a c e h g"), sales = c(1, 2, 3)) Now I want to aggregate the sales by part of the a$product. 'Product' is the product name, a string separated by a space. The key in my aggregate function is
2011 Feb 10
2
Repeaded sampling
Hi all, I have a dataset. Each time I want to sample N(i) elements from it and I want to repeated sampling M times. N(i) is varied from time to time. For example, dataset = 1:50; a = list(); M = 1000; I want to do something like for(i in 1:M) { a[[i]] = sample(dataset,
2003 Jun 20
6
How can convert user expired days in human readable ?
Hello all, On my system, some users have expire day user settings. I write a (python) script then parse the: 7.th selection in the master.passwd blabla:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:1064005200:xxxx:xxxx:xxxx:xxxx How can I conver the number like 1064005200 to human readable date format ? Or, there is a way to collect the information from a command interactively ? Regards, Murat Ustuntas
2009 Jul 21
1
problem with heatmap.2 in package gplots generating non-finite breaks
I have written a wrapper for heatmap.2 called heatmap.w.row.and.col.clust which auto-generates breaks using breaks<-round((c(seq(from=(-20 * stddev), to=(20 * stddev))))/20, digits = 2) #(stddev in this case = 2.5) This has always worked well in the past but now I am getting an error that non-finite breaks are being generated. Drilling down, it seems that my wrapper is generating finite
2012 Aug 06
2
[LLVMdev] Question about llvm JIT
I have a function in llvm ir as follows: def [2 x [3 x double]] @fun() { return [ ... ]; // a [2 x [3 x double]] constant } I would like to JIT this function in C. I first get the void pointer using: void *FPtr = TheExecutionEngine->getPointerToFunction( func ); Then I need to conver this void pointer to the corresponding C function pointer type, and then call the function
2006 Feb 11
2
heatmap.2 in gplots (PR#8587)
Full_Name: Shane Neph Version: 2.2.1 OS: mac os x Submission from: (NULL) (71.113.43.247) While I found the names of the package authors and maintainer, I was unsuccessful in finding any contact information. The preliminary documentation for heatmap.2 is inconsistent in at least a couple of places when discussing the suppression of one or more dendrograms (and column/row ordering in general).
2009 Jan 26
2
Getting data from a PDF-file into R
Hello I have around 200 PDF-documents, containing data i want organized in R as a dataframe. The PDF-documents look like this; http://www.nabble.com/file/p21667074/PRRS-billede%2Bmed%2Bfarver.jpeg or like this; http://www.nabble.com/file/p21667074/PRRS-billede%2Bmed%2Bfarver%2B2.jpeg So i want to pull out the data in coloured boxes it become organized like this (just in R instead of
2012 Aug 06
0
[LLVMdev] Question about llvm JIT
On Mon, Aug 6, 2012 at 9:35 AM, Peng Cheng <gm4cheng at gmail.com> wrote: > I have a function in llvm ir as follows: > > def [2 x [3 x double]] @fun() > { > return [ ... ]; // a [2 x [3 x double]] constant > } > > I would like to JIT this function in C. > > I first get the void pointer using: > > void *FPtr =
2008 Jul 25
1
Plink bed files
Hi All, does anyone know how to import binary .bed files generated by Plink (http://pngu.mgh.harvard.edu/~purcell/plink/ ) into R? the Plink FAQ explains how to conver other types of files, not the .bed. Cheers, Federico -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St. Mary's Campus Norfolk Place, London W2 1PG Tel +44 (0)20 75941602 Fax
2009 Sep 18
1
problem regarding the data
Hi, This is Meghana Kulkarni. I have a problem regarding the data I am working with. I have a data frame as follows: > x V1 V2 V3............V10 414 A 416 A 417 A 417 B 418 A 421 A 421 B 421 C 422 A I want to conver this data frame in the following format. > x V1 V2 V3............V10 414 A 416
2012 Aug 08
3
help, please! matrix operations inside 3 nested loops
hello, this is my script: #1) read in data: daten<-read.table('K:/Analysen/STRUCTURE/input_STRUCTURE_tab_excl_5_282_559.txt', header=TRUE, sep="\t") daten<-as.matrix(daten) #2) create empty matrix: indxind<-matrix(nrow=617, ncol=617) indxind[1:20,1:19] #3) compare cells to each other, score: for (s in 3:34) { #walks though the matrix colum by colum, starting at