Displaying 20 results from an estimated 6000 matches similar to: "Selecting rows that are the same in separate data frames"
2008 Oct 23
1
save an object of class "im"
I have created various "im" objects, but can't seem to save and load them. I
can save them, but as small files of less than 1Kb. Therefore, when they are
re-loaded, they cannot be plotted as images.
Any ideas please.
Thankyou.
Simon Parker
Imperial College
--
View this message in context: http://www.nabble.com/save-an-object-of-class-%22im%22-tp20134567p20134567.html
Sent from
2008 Apr 25
4
Equivalent of Excel pivot tables in R
Can somebody tell me how to do the equivalent of a pivot table in R ?
For example, if I have :
var1 var2 var3
a x 10
b y 20
a z 10
b z 20
a z 10
b z 20
I could have :
x y z
a 1 0 2
b 0 1 2
where entries in the table are counts of var3.
2009 Jan 13
2
Re ad a text file from a directory in which an R script finds itself
Is it possible for an R script to read a text file, say, from the directory
in which the script is located ?
I don't think I can use setwd(), because I can't specify the directory.
--
View this message in context: http://www.nabble.com/Read-a-text-file-from-a-directory-in-which-an-R-script-finds-itself-tp21434236p21434236.html
Sent from the R help mailing list archive at Nabble.com.
2008 Feb 07
1
How do you refer to the row above in a data frame ?
You have a two-dimensional data frame.
Columns is easy, say
col4 <- col3 - col2
How do you do
row3 <- row2 +1
for example.
--
View this message in context: http://www.nabble.com/How-do-you-refer-to-the-row-above-in-a-data-frame---tp15336933p15336933.html
Sent from the R help mailing list archive at Nabble.com.
2008 Nov 29
2
Using grep() to subset lines of text
I have two vectors, a and b. b is a text file. I want to find in b those
elements of a which occur at the beginning of the line in b. I have the
following code, but it only returns a value for the first value in a, but I
want both. Any ideas please.
a = c(2,3)
b = NULL
b[1] = "aaa 2 aaa"
b[2] = "2 aaa"
b[3] = "3 aaa"
b[4] = "aaa 3 aaa"
2008 May 02
2
expand.grid using a repeated vector as a parameter
Hello.
I'm trying to do this (not necessarily 0:1) :
expand.grid ( 0:1, 0:1, 0:1, 0:1, 0:1)
etc..etc.
but I want to have control over how many 0:1 are included.
Any ideas please ?
Thankyou.
Simon Parker
Imperial College
---------------------------------
A Smarter Email.
[[alternative HTML version deleted]]
2008 Jan 16
3
using an element of an array as a new object
I have an array called filesBox. I want to take each element of the first
column and assign a dataset to it.
For example :
filesBox[4,1] returns
[1] "fileR"
Then I want to assign "fileR" which exists as a text file to the R object
"fileR" like this :
filesBox[4,1] <- read.table(paste(dir2, filesBox[4,1], sep=""), header =
FALSE)
But this doesn't
2007 Aug 28
1
subcripts on data frames (PR#9885)
I'm not sure if this is a bug, or if I'm doing something wrong.
=20
=46rom the worms dataframe, which is at in a file called worms.txt at
=20
http://www.imperial.ac.uk/bio/research/crawley/therbook
<http://www.imperial.ac.uk/bio/research/mjcraw/therbook/index.htm>=20
=20
the idea is to extract a subset of the rows, sorted in declining order
of worm density, with only the maximum
2012 Mar 06
3
Label rows of table by factor level for groups of factors
Dear useRs,
I am sure this is a fairly simple problem, but I just cannot get my head around it.
I have a dataframe which contains several factor variables. I can use table() to tell me how many different combinations there are of these variables. What I should like to do is to add a column to my original dataframe which labels each row according to the unique combination of factors.
E.g. in
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
2005 Mar 26
3
Multi-plot figures with different numbers of plots in different rows
Dear all,
I have 5 plots that I would like to include in a single figure, spread over two rows. If I use mfrow=c(2,3), and produce my plots one after the other, I will end up with three plots in the first row, and 2 in the second row, which is what I want. However, I would like the two plots in the second row to be moved to the centre of that row, rather than occupying the two left-most cells.
2011 Sep 01
4
readBin fails to read large files
Posting for a friend
Begin forwarded message:
From: "Geier, Florian" <florian.geier08@imperial.ac.uk<mailto:florian.geier08@imperial.ac.uk>>
Subject: Fwd: readBin fails to read large files
Date: September 1, 2011 4:10:53 PM GMT+01:00
To:
Begin forwarded message:
Date: 1 September 2011 16:01:45 GMT+01:00
Subject: readBin fails to read large files
Dear all,
I am trying
2016 Apr 27
3
Create a new variable and concatenation inside a "for" loop
Hello,
Suppose the you need a loop to create a new variable , i.e., you are not reading data from outside the loop. This is a simple example in Matlab code,
for i=1:5
r1=randn
r2=randn
r=[r1 r2]
c(i,:)=r; % creation of each row of c , % the ":" symbol indicates all columns. In R this would be [i,]
end
The output of interest is c which I'm creating inside the "for" loop
2009 Jun 17
3
tiff() woes
Hello all,
a friend has a problem with tiff() which I was unable to help about. I
searched the error messages to no avail. When he tries:
tiff(filename = "FedeWhyDoesntThisBloodyWork.tif", width = 5, height =
5, units = "cm", bg = "white", res = 1200)
Error in tiff(filename = "FedeWhyDoesntThisBloodyWork.tif", width =
5, :
unable to start device
2011 Jul 08
3
Making a new package: licence
HI All,
I have written and succesfully uploaded a new package. The licence it is under is 'GPL' --no version. My assumption is, since all the code is written in R the licence R used for R would affect the code (hence my "GPL" stands for "whatever version of the GPL R is under")
I am happy with the licencing I used, but I'd like to ask if there is any transitive
2010 Feb 11
1
Sweve/cacheSweave
Hi there
I have a problem with using Sweave in combination with the option driver = cacheSweave.
Whichever code I try to run - when it comes to converting the tex file into pdf it comes up with the same errors (\csname \endcsname errors). Does anybody have an idea what it going wrong?
> Sweave("pgfSweave-example.Rnw",driver = cacheSweaveDriver)
Writing to file
2012 Jan 28
3
logical subsetting, indexes and NAs
Dear All,
just a quick example:
> x = 1:25
> x[12] = NA
> x
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14 15 16 17 18 19 20 21 22 23 24 25
> y = x[x<10]
> y
[1] 1 2 3 4 5 6 7 8 9 NA
Is there any way of NOT getting NA for y = x[x<10]? Similarly
> y = x[x<15]
> y
[1] 1 2 3 4 5 6 7 8 9 10 11 NA 13 14
How do I get rid of the NA (not post
2013 May 02
3
Minimal build of R ...
Hi,
I'm trying to cross-compile R to javascript so that it can run in a web-browser. Take as long as you need to stop laughing. So, as I was saying - I want to try and get a build of R running in the browser. [If you're not familiar with it already, you might enjoy looking at emscripten.org. It's a remarkably capable tool for translating LLVM bitcode to javascript. Check out some of
2007 Nov 26
4
writing summary() to a text file
Hi All,
I would like to output the results of a function into a text file,
legible as a such. The function produces a summary quite like:
summary(lm(x ~ y + w * z))
[for instance]
and I am not clear how to save this summary into a text file
'automagically', because I need to be able to do it in a for() loop.
Cheers,
Federico
--
Federico C. F. Calboli
Department of Epidemiology
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