Displaying 20 results from an estimated 2000 matches similar to: "rearranging data frame rows"
2006 Jun 23
0
R: rearranging data frame rows
Have a look at merge.
Ciao
Vittorio
>----Messaggio originale----
>Da:
f.calboli at imperial.ac.uk
>Data: 23-giu-2006 18.10
>A: "r-help"<r-
help at stat.math.ethz.ch>
>Ogg: [R] rearranging data frame rows
>
>Hi
All,
>
>I have two data frames. The first contains data about a number
of individuals,
>coded in the first column with a name, in an order
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:
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
2007 Aug 28
3
data formatting: from rows to columns
Hi All,
I have some data I need to write as a file from R to use in a different program.
My data comes as a numeric matrix of n rows and 2 colums, I need to transform
each row as a two rows 1 col output, and separate the output of each row with a
blanck line.
Foe instance I need to go from this:
V2 V3
27 2032567 19
28 2035482 19
126 2472826 19
132 2473320 19
136 2035480 135
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
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
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
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
2007 Jun 02
3
Updating R version
A quick question. I am trying to understand how I could move the installed
packages in my R 2.3 version to the newly installed R 2.5 version, without
having to install all the packages again. I copied the files under the old
library subdirectory to the new library subdirectory. But still the newer
version is not recognizing the packages that were copied over.
Thanks.
[[alternative HTML version
2006 Jun 23
2
problem with hist() for 'times' objects from 'chron' package
Hello dear useRs and wizaRds,
I encountered the following problem using the hist() method for the
'times' classes
from package 'chron'. You should be able to recreate it using the code:
library(chron)
# pasted from chron help file (?chron)
dts <- dates(c("02/27/92", "02/27/92", "01/14/92", "02/28/92",
"02/01/92"))
class(dts)
2007 Jul 25
2
initalizing and checking validity of S4 classes
Dear useRs and wizaRds,
I am currently developing a set of functions using S4 classes. On the way I encountered the problem exemplified with the code below. For some reason the 'validity' method does not seem to work, i.e. does not check for errors in the specification of the slots of the defined class. Any hints?
My understanding of the whole S4 system was that validity checks are made
2007 Mar 13
4
'substitute' question
# I use this code to label a graph with the R2:
# graph
x <- rnorm(100)
y <- x + rnorm(100)
lm1 <- lm(y~x)
plot(x,y)
# label
R2text <- substitute(paste(R^2," = ",r2),list(r2=r2))
text(1,-3,R2text, col="red")
# i have modified this a bit, so that i have a vector with other labels,
each of which
# will be labelled on the graph. Example:
texts <- c("And the
2008 Jan 22
1
deparse, substitute and S4 generics
Hello everyone,
I encountered the following confusing behavior of 'deparse' and
'substitute' while programming with S4 classes (see example below). It
seems like the presence of '...' argument in the definition of the
generic generates the problem. I have no clue why, can anyone explain
that to me? Are there any "workarounds"?
Thanks a lot for your time!
2007 Mar 08
1
sink with R-code
I have the same question that Eusebio had:
Is there a function similar to "sink" that redirect also R code to a
file that
is:
sink("R001")
x <- c(2,-6,-4,8,5,4,1,3,4,-9,0,1)
A <- matrix(x, ncol=3)
A
A.prima <- t(A)
A.prima
dim(A)
dim(A.prima)
sink()
create a file "R001" with contents:
------------------------------------------
[,1] [,2] [,3]
[1,]
2007 Mar 08
1
Searching and deleting elements of list
Hi,
I have a problem. Please, look at example and try to help me!!
> A<-c("aaa","bbb","ccc","ddd","eee")
> B<-c("vvv","ooo","aaa","eee","zzz","bbb")
> C<-c("sss","jjj","ppp","ddd")
> D<-c("bbb","ccc")