similar to: data formatting: from rows to columns

Displaying 20 results from an estimated 700 matches similar to: "data formatting: from rows to columns"

2006 Sep 26
5
putting stuff into bins...
Hi All, I have a vector of data, a vector of bin breakpoints and I want to put my data in the bins and then extract fanciful informations like the mean value of each bin. I know I can write my own function, but I would have thought that R should have somewhere a function that took as arguments something like (data, breaks, what to do with the data in the bins). I surey could not find it
2008 Aug 27
2
r-base-core issue
Hi All, I cannot upgrade r-base and r-recommended because the latest (latest as in it was not listed as 'upgradable' yesterday but today is) r-base-cose is 2.7.1-2hardy0 not hardy1: r-base: Depends: r-base-core (>=2.7.2-1hardy1) but 2.7.1-2hardy0 is to be installed Depends: r-recommended (=2.7.2-1hardy1) but 2.7.1-2hardy0 is to be installed r-base-core: r-recommended:
2007 Feb 19
1
memory management uestion
Hi All, I would like to ask the following. I have an array of data in an objetct, let's say X. I need to use a for loop on the elements of one or more columns of X and I am having a debate with a colleague about the best memory management. I believe that if I do: col1 = X[,1] col2 = X[,2] ... colx = X[,x] and then for(i in whatever){ do something using col1[i], col2[i] ... colx[i] }
2006 Oct 30
1
memory management
Hi All, just a quick (?) question while I wait my code runs... I'm comparing the identity of the lines of a dataframe, doing all possible pairwise comparisons. In doing so I use identical(), but that's by the way. I'm doing a (not so) quick and dirty check, and subsetting the data as data[row.numb,] and data[a different row,] I suspect the problem there is that I load into
2008 Feb 18
2
predicting memory usage
Hi All, is there a way of predicting memory usage? I need to build an array of 86000 by 2500 numbers (or I might create a list of 2 by 2500 arrays 43000 long). How much memory should I expect to use/need? Cheers, Fede -- 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 +44
2005 Apr 18
1
Rd.sty problems.
Hi All, I am trying to build a new R package to submit, but it's failing to create a tex manual: R CMD check Biodem * checking for working latex ... OK * using log directory '/home/greatsage/Fede/R-packages/temp/Biodem.Rcheck' * checking for file 'Biodem/DESCRIPTION' ... OK * checking if this is a source package ... OK * Installing *source* package 'Biodem' ... ** R
2007 Feb 07
1
spss file import
Hi All, does anyone ever import old SPSS files in a sl3 format? read.spss('file.sl3') does not seem to work... it's not recognised as a supported SPSS format at all. Best, Fede -- 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 +44 (0)20 75943193 f.calboli
2007 Mar 23
1
plotting symbol
Hi All, can I have a plot where the symbol for the dots is smaller than pch =20 but bigger than pch = '.'? Best, Fede -- 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 +44 (0)20 75943193 f.calboli [.a.t] imperial.ac.uk f.calboli [.a.t] gmail.com
2007 Feb 14
1
problems apt-getting from CRAN
Hi there, I hope that's not been asked ad nauseam (but I could not find it in the archives...) but, if I put a CRAN mirror in my sources.list and I try to install the latest R version for 'testing' I get the warning that the packages cannot be autenticated. I tried to figure out how to get a GPG key from the mirror I'm using (the austrian one) in case that's the solution,
2007 Jun 20
1
non permanent change of vector values
Hi All, I have the following problem: I have a vector x = rep(0,15) x[1:2] = 1 x [1] 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 I need to be able to call that vector 'x' so that if condition 'A' is true, only the first value is kept 'as is' and all the others are put to 0 if(A == T) function(x) with x returning 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 and if 'A' is false the
2006 Oct 13
1
cannot load MASS in Etch
Hi All, I hate to do this (because I always found the R/Debian combo exceptional and I never had the time to ontribute --sorry about that--), BUT, the latest r-cran-vr for Etch (testing) is dpkg -l | grep r-cran-vr ii r-cran-vr 7.2.29-1 GNU R package accompanying the Venables and Ripley book on S and I get the following error if I try to load MASS
2006 Feb 28
4
subsetting a list of matrices
Hi All, I have a list of matrices: > x [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 > y [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18 21 24 27 30 33 [2,] 19 22 25 28 31 34 [3,] 20 23 26 29 32 35 > z =list(x,y) I want to create a second list that is has a subset each matrix in the list subsetting so I get the 2nd and 3rd row of each (and
2005 Mar 08
5
removing message: [Previously saved workspace restored]
Dear All, I saved by mistake the environment I was working in after typing q(), and now I get the annoying message: [Previously saved workspace restored] I have already deleted all the objects in the environment, saving it as an empty environment, so it's just a matter of nitpicking I suppose. The message does not appear if I start R from any other place in the directory tree. I am
2007 Jun 26
2
fisher information matrix
Hi All, a colleague wants to calculate the Fisher information matrix for a model he wrote (not in R). He can easily get the neg-log-likelihood and the best fit parameters at the minimum. He can also get negLLs for other parameter values too. Given these data, is there a way in R to calculate the Fisher information matrix? Best, Federico -- Federico C. F. Calboli Department of Epidemiology
2006 Mar 28
2
as.matrix and one row
Hi All, I have the following problem: x = c(1,2) x [1] 1 2 as.matrix(x) [,1] [1,] 1 [2,] 2 BUT, if I add: y = c(3,4) as.matrix(rbind(x,y)) [,1] [,2] x 1 2 y 3 4 It does not transpose. Since I will need as.matrix() for a list of data that is in one or more lines, I need as.matrix to behave in a consisten fashions, so I get as.matrix(x, whatever) [,1] [,2] x 1
2006 Mar 08
3
'less' for R?
Hi All, is there an equivalent of the Unix command 'less' (or 'more'), so I can look at what's inside a data.frame or a matrix without having it printed out on console? I am using R on Debian Linux and Mac OS 10.4.5 Cheers, F -- Federico C. F. Calboli Department of Epidemiology and Public Health Imperial College, St Mary's Campus Norfolk Place, London W2 1PG Tel +44
2006 Feb 08
2
logical condition in vector operation
HI All, I have a data frame such as: > test x y p d [1,] 1 0 10 21 0 [2,] 2 3 11 12 0 [3,] 3 4 12 23 0 [4,] 3 5 13 24 0 and I want to perfor some operations on the first two coulums, conditional on the uneqaulity values on the 3rd and 4th columns. For instance: j = 3 test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1] gives me the result: test: x y p d
2006 Jun 07
3
smoothing plot(x, type ='l')
Hi All, I am using plot(x, type = 'l') for some plotting, but I would like rounded edges rather than jagged edges in the plot (purely for aestetic reasons). How could I achieve that? 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 7594 1602 Fax (+44) 020
2006 Oct 26
2
pairs matchning
Hi You could try to find an equivalent representation as a string and try to match those. > (A <- cbind(sample(1:2, 10, rep=TRUE), sample(1:2, 10, rep=TRUE))) [,1] [,2] [1,] 1 2 [2,] 1 2 [3,] 1 2 [4,] 2 2 [5,] 1 1 [6,] 1 2 [7,] 1 2 [8,] 1 1 [9,] 1 2 [10,] 1 1 > (B <- unique(A)) [,1] [,2] [1,] 1 2
2005 Apr 12
2
R as programming language: references?
Hi All, I am looking for references on R as a programming language (apart form the standard R-lang.pdf and the other manuals), reference that would cover _in_depth_ things like loops, code optimisation, debugging tools etc... and is as up-to-date as possible. Can anyone suggest any book or other reference apart from the "green book" and the V&R "S-programming"? Cheers,