On 01 Jul 2014, at 21:03 , John McKown john.archie.mck...@gmail.com wrote:
Basically, a wash. For a stress, I took in all 136 of my files in a
single execution. Output was 22,823 elements in the data.frame.
Yours:
real3m32.651s
user3m26.837s
sys 0m2.292s
Mine:
real
Is there a better way to do the following? I have data in a number of tab
delimited files. I am using read.delim() to read them, in a loop. I am
invoking my code on Linux Fedora 20, from the BASH command line, using
Rscript. The code I'm using looks like:
arguments -
...@r-project.org] On
Behalf Of John McKown
Sent: Tuesday, July 1, 2014 7:07 AM
To: r-help@r-project.org
Subject: [R] combining data from multiple read.delim() invocations.
Is there a better way to do the following? I have data in a number of tab
delimited files. I am using read.delim() to read
-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of John McKown
Sent: Tuesday, July 1, 2014 7:07 AM
To: r-help@r-project.org
Subject: [R] combining data from multiple read.delim() invocations.
Is there a better way to do the following? I have data in a number of tab
]
Sent: Tuesday, July 1, 2014 12:33 PM
To: David L Carlson
Cc: John McKown; r-help@r-project.org
Subject: Re: [R] combining data from multiple read.delim() invocations.
Maybe, David, but this isn't really it.
Your code just basically reproduces the explicit for() loop with the
lapply. Maybe
Hi,
You can try ?merge() or ?join() from library(plyr)
merge(tempr, pr, by=date,all=TRUE)
A.K.
Hi, all!
I have a problem. I have 2 data frame. Each contains column: date and one
unique column (temperature and pressure correspondingly). But dates are not a
same. First one since 1st Jan 2012
Try this storing them to a list with the j,k,l,m as an index:
result - list()
for(j in 1:2){
for(k in 1:6){
for(l in 1:2){
for(m in 1:2){
fsumstatZINB=paste(/Users/chris/Dropbox/phd/analysis/Simulation/zinbmodels/summaries/zinbsumstat-,j,k,l,m,.rdata,
sep=)
load(fsumstatZINB)
Thanks Jim. That'll work for me!
Chris
On Mon, Feb 4, 2013 at 11:17 AM, jim holtman jholt...@gmail.com wrote:
Try this storing them to a list with the j,k,l,m as an index:
result - list()
for(j in 1:2){
for(k in 1:6){
for(l in 1:2){
for(m in 1:2){
I have 2 data tables. Each hold information categorized into Date and
Price. What I need to do is combine the two to get 2 columns of Date and
Price, by continuing the table downwards with the new rows supplied from the
second table. So, for example I have
5/1/12 2
5/2/12 5
As data table 1
?rbind
On Mon, Jul 16, 2012 at 1:17 PM, Lauren Vogric
lvog...@grahamcapital.com wrote:
I have 2 data tables. Each hold information categorized into Date and
Price. What I need to do is combine the two to get 2 columns of Date and
Price, by continuing the table downwards with the new rows
?rbind
HTH,
Jorge.-
On Mon, Jul 16, 2012 at 1:17 PM, Lauren Vogric wrote:
I have 2 data tables. Each hold information categorized into Date and
Price. What I need to do is combine the two to get 2 columns of Date
and Price, by continuing the table downwards with the new rows supplied
from
Thanks for the reply. Two things - I must have something missing because
copying and pasting your example gave me an error
... your definitions of nn
Output = do.call(as.data.frame(rbind),nn)
Error in as.data.frame.default(rbind) :
cannot coerce class 'function' into a data.frame
The
David
1. The last line of the code should have been ...
Output = as.data.frame(do.call(rbind,nn))
# Output
Node Connect.up Connect.down
11 NULL 2, 3
22 1 4, 5
33 NULL 2, 3
44 1 4, 5
Apologies for any confusion
2.
Group
It's unlikely I'm trying this the best way, but I'm trying to create a
data structure from elements like
nNode = 2
nn = vector(list,nNode)
nn[[1]] = list(Node = 1, Connect.up = c(NULL), Connect.down = c(2,3))
nn[[2]] = list(Node = 2, Connect.up = c(1), Connect.down = c(4,5))
#(
Not entirely sure why you would want a data.frame that has multiple entries
in one of the columns (Connect.down) but leaving that aside is the following
of any use?
nn=list()
nn[[1]] = list(Node = 1, Connect.up = c(NULL), Connect.down = c(2,3))
nn[[2]] = list(Node = 2, Connect.up = c(1),
Hi all;
It seemed to be easy at first, but I didn't manage to find the answer
through the google search. I have a set of data for every second of the
experiment, but I don't need such a high resolution for my analysis. I want
to replace every 30 row of my data with their average value. And then
There is no single command to do all of what you want.
Read the posting guide for advice on how to ask questions that are more
likely to receive helpful answers.
The mean() function is a command for combining certain number of data
into their average value.
The write.csv() function will create
Well, for
What is the command for combining certain number of data into their
average value?
one way would be (calling the data vector, x)
colMeans(matrix ( x[ seq_len(30 * floor(length(x)/30))], nrow=30))
Note that this will leave out the mean of any values with indices
beyond the largest
On Nov 17, 2011, at 10:37 AM, Nasrin Pak wrote:
Hi all;
It seemed to be easy at first, but I didn't manage to find the answer
through the google search. I have a set of data for every second of
the
experiment, but I don't need such a high resolution for my analysis.
I want
to replace
Here it is...
str(Males$BMXHT)
num [1:2801] 168 161 180 182 169 ...
str(Females$BMXHT)
num [1:3440] 162 159 164 165 159 ...
str(Males$yourWeight)
num [1:2801] 1148 788 10298 25115 8691 ...
str(Females$myWeight)
num [1:3440] 9169 4964 2608 2806 907 ...
I want to combine Males$BMXHT with
Sorry,
Rather, it should be:
wtd.quantile(Everybody$BMXHT, weights=Everybody$ourWeight, 0.05)
Thanks again,
Brian.
--
View this message in context:
http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2543998.html
Sent from the R help mailing list archive at Nabble.com.
Good News!
I think I figured out my problem.
The command I was looking for was append().
Thank you for your help,
Brian
--
View this message in context:
http://r.789695.n4.nabble.com/Combining-Data-Sets-w-Weights-tp2543167p2544125.html
Sent from the R help mailing list archive at
On Sep 17, 2010, at 11:15 AM, btpagano wrote:
Here it is...
str(Males$BMXHT)
num [1:2801] 168 161 180 182 169 ...
str(Females$BMXHT)
num [1:3440] 162 159 164 165 159 ...
str(Males$yourWeight)
num [1:2801] 1148 788 10298 25115 8691 ...
str(Females$myWeight)
num [1:3440] 9169 4964 2608
On Sep 17, 2010, at 12:42 PM, btpagano wrote:
Good News!
I think I figured out my problem.
The command I was looking for was append().
Er, maybe.
It does appear that you could use append() but c() is much more the
typical R way of concatenating objects like vectors and lists. The
only
Hello All,
I am still a beginner with R, and I only have a week or two under my belt so
far.
I'm working with NHANES anthropometric data on stature. I have two sets of
data that have different statistical weights. I'm trying to combine those
two data sets into one mega-set while retaining each
On Sep 16, 2010, at 8:33 PM, btpagano wrote:
Hello All,
I am still a beginner with R, and I only have a week or two under my
belt so
far.
I'm working with NHANES anthropometric data on stature. I have two
sets of
data that have different statistical weights. I'm trying to combine
I'm a week-old R user, and have become stuck trying to create usable CSV
outputs for post-processing. I am using the package Rioja, which provides
small datasets of results. I am running several analyses in a loop and
iteratively adding the results to a *list* (combined). Within each
iteration I
How about posting your complete set of code that is manipulating the
list. Normally when I am using a list, each list element is the
result from a test/iteration and then I can use something like 'rbind'
at the end. I would not expect the output you are getting with the
results extending to the
I have several questions on your goals.
Why are you planning to post-processing outside of R?
Why use CSV files when there are usually better ways to maintain
the structure of the data?
Why do you want to flatten your tables? It looks like a three-dimensional array
would better capture the
With Jim's help, the solution is as follows...
-Original Message-
From: jim holtman [mailto:jholtman * at sign * gmail.com]
Sent: Sunday, January 31, 2010 5:41 PM
To: Euan Reavie
Subject: Re: [R] combining data frames in a list - how do I add breaks?
Your 'combined' was a 'list
Yes, it does. Thanks.
el
On 25 Oct 2008, at 03:32 , Steven McKinney wrote:
If you are using regular R graphs
(i.e. not lattice or other library
graphics) try setting the margins
with the mar argument to par()
e.g.
par(mar = c(5, 10, 5, 1))
The four numbers specify the amount
of margin room
Hi,
I have two tables:
iso
continent code code3 codenum country
1 EU AD AND 20 Andorra, Principality of
2 AS AE ARE 784 United Arab Emirates
3 AS AF AFG 4 Afghanistan, Islamic Republic of
4
Here are two solutions. The first uses the R merge command
and the second uses the R sqldf package. See ?merge
and http://sqldf.googlecode.com
Note that alter is an sql keyword so I have changed it
to alt for the second example:
merge(iso, rawdata)[c(alt, sex, country)]
alter sex country
1
Gabor,
Thank you,
On 24 Oct 2008, at 17:16 , Gabor Grothendieck wrote:
Here are two solutions. The first uses the R merge command
and the second uses the R sqldf package. See ?merge
and http://sqldf.googlecode.com
Note that alter is an sql keyword so I have changed it
to alt for the second
On Fri, Oct 24, 2008 at 11:37 AM, Dr Eberhard W Lisse [EMAIL PROTECTED] wrote:
This looks very cool.
But I must still make a plan with regards to country = NA (Namibia)
or continent = NA (North America)
But there are the vignettes.
el
NA and NA are not the same:
DF - data.frame(x =
2008/10/24 Gabor Grothendieck [EMAIL PROTECTED]:
NA and NA are not the same:
DF - data.frame(x = c(a, NA, NA))
DF
x
1a
2 NA
3 NA
is.na(NA)
[1] TRUE
is.na(NA)
[1] FALSE
Yes, but unless you tell it otherwise, read.table will think Namibia
is an NA, even in a column of
: Friday, October 24, 2008 11:02 AM
An: R-help Mailing List
Cc: Dr Eberhard W Lisse
Betreff: [R] combining data from different datasets
Hi,
I have two tables:
iso
continent code code3 codenum country
1 EU AD AND 20 Andorra, Principality
It's Complicated® :-)-O
I pull the data from a postgresql table, but I am getting
there, thank you the help.
Another question, I am barplotting the continents horizontally,
ie the more participants the lrger the bars are. I have managed
the make the labels (names of the nontinents) to be
Daniel,
the parameter all.x=TRUE is required.
greetings, el
On 24 Oct 2008, at 21:24 , Daniel Malter wrote:
?merge.
It looks though that your iso has no identifier variable whereas the
rawdata has, so you probably cannot merge it unless/until you have
an
identifier in iso.
1L3
Canada
-Original Message-
From: [EMAIL PROTECTED] on behalf of Dr Eberhard W Lisse
Sent: Fri 10/24/2008 2:44 PM
To: R-help Mailing List
Cc: Dr Eberhard W Lisse
Subject: Re: [R] combining data from different datasets
It's Complicated® :-)-O
I pull the data from a postgresql table
stephen sefick wrote:
I have two dataframes in R that were tab seperated .txt files
y-read.table(foo.txt, header=T)
x-read.table(foo.txt, header=T)
these are set up like this:
Datetime Temp
01/01/07 00:01 11.5
01/01/07 00:16 11.6
etc etc to 66000
I have two dataframes in R that were tab seperated .txt files
y-read.table(foo.txt, header=T)
x-read.table(foo.txt, header=T)
these are set up like this:
Datetime Temp
01/01/07 00:01 11.5
01/01/07 00:16 11.6
etc etc to 66000 rows in y and 33000 rows in x
The
Try this:
x
Datetime Temp
1 01/01/07 00:01 11.5
2 01/01/07 00:16 11.6
y
Datetime Temp
1 01/01/07 00:01 10
2 01/01/07 00:163
merge(x, y, by=Datetime)
Datetime Temp.x Temp.y
1 01/01/07 00:01 11.5 10
2 01/01/07 00:16 11.6 3
On 22/02/2008, stephen
You could do it with zoo:
DF1 - data.frame(Datetime = ISOdate(2000, 1:2, 1), Temp = 1:2)
DF2 - data.frame(Datetime = ISOdate(2000, 2:3, 1), Temp = 3:4)
library(zoo)
# convert to zoo
z1 - zoo(DF1[,2], DF1[,1])
z2 - zoo(DF2[,2], DF2[,1])
# merge
z - merge(z1, z2, all = TRUE)
# take rowmeans
zz
44 matches
Mail list logo