Displaying 20 results from an estimated 8000 matches similar to: "Merging two datasets"
2008 Aug 13
1
Installing R in Ubuntu
Hi,
I am running Ubuntu on my Windows OS through VMware.
I am trying to install R in Ubuntu, but not getting with those commands,
which are there on the site.
Can anyone please tell me how to install it, stepwise, with commands to be
used.
As I m new to Ubuntu as well, I am not aware of the commands very well.
Thanks,
Shreyasee
[[alternative HTML version deleted]]
2009 Jan 26
1
Plotting graph for Missing values
Hi,
I have imported one dataset in R.
I want to calculate the percentage of missing values for each month (May
2006 to March 2007) for each variable.
Just to begin with I tried the following code :
*for(i in 1:length(dos))
for(j in 1:length(patientinformation1)
if(dos[i]=="May-06" && patientinformation1[j]=="")
a <- j+1
a*
The above code was written to calculate
2008 Oct 30
1
Creating Vignettes
Hi,
I want to create a new vignette and include it in an already existing
package.
That package has already many vignettes which are related to the chapters
from the book on which the package is built.
It would be a great help if anyone could help to understand how to create
vignette for a statistical test like Chi-Square test.
Thanks,
Shreyasee
[[alternative HTML version deleted]]
2013 Feb 26
2
merging or joining 2 dataframes: merge, rbind.fill, etc.?
#I want to "merge" or "join" 2 dataframes (df1 & df2) into a 3rd
(mydf). I want the 3rd dataframe to contain 1 row for each row in df1
& df2, and all the columns in both df1 & df2. The solution should
"work" even if the 2 dataframes are identical, and even if the 2
dataframes do not have the same column names. The rbind.fill function
seems to work. For
2009 Jan 21
3
merging several dataframes from a list
Hi there,
I have a list of dataframes (generated by reading multiple files) and all
dataframes are comparable in dimension and column names. They also have a
common column, which, I'd like to use for merging. To give a simple example of
what I have:
df1 <- data.frame(c(LETTERS[1:5]), c(2,6,3,1,9))
names(df1) <- c("pos", "data")
df3 <- df2 <- df1
df2$data
2012 Jun 03
2
merging single column from different dataframe
Hi all,
probably really simple to solve, but having no background in programming I
haven't been able to figure this out: I have two dataframes like
df1 <- data.frame(names1=c('aa','ab', 'ac', 'ad'), var1=c(1,5,7,12))
df2 <- data.frame(names2=c('aa', 'ab', 'ac', 'ad', 'ae'),
var2=c(3,6,9,12,15))
Now I want merge
2009 Mar 24
2
Calculating percentage Missing value for variables using one object
Hi,
I have a dataset in which there are in all 250 variables and for each
variable the data is entered over the months.
I need to calculate the percentage of missing values for each variable over
each month and then plot a graph for that.
I am running the following code for doing the same
*ds <- read.csv(file="filepath", header=TRUE)
attach(ds)
may <-
2009 Apr 09
2
failed when merging two dataframes, why
Hi, R-listers,
Failed, when I tried to merge df1 and df2 by "codetot" in df1 and "codetoto"
in df2. I want to know the reason and how to merge them together. Data
frames and codes I have used were listed as followed. Thanks a lot in
advance.
df1:
popcode codetot p3need
BCPy01-01 BCPy01-01-1 100.0000
BCPy01-01 BCPy01-01-2 100.0000
BCPy01-01 BCPy01-01-3 100.0000
BCPy01-02
2009 Sep 18
1
merging data frames with matrix objects when missing cases
Hi,
I have faced a problem with the merge() function when trying to merge
two data frames that have a common index but the second one does not
have cases for all indexes in the first one. With usual variables R
fills in the missing cases with NA if all=T is requested. But if the
variable is a matrix R seems to insert NA only to the first column of
the matrix and fill in the rest of the columns by
2010 Nov 03
2
biding rows while merging at the same time
Hello!
I have 2 data frames like this (well, actually, I have 200 of them):
df1<-data.frame(location=c("loc 1","loc 2","loc
3"),date=c("1/1/2010","1/1/2010","1/1/2010"), a=1:3,b=11:13,c=111:113)
df2<-data.frame(location=c("loc 1","loc 2","loc
2010 Dec 16
2
Compare two dataframes
Hello,
I have two dataframes DF1 and DF2 that should be identical but are not
(DF1 has some rows that aren't in DF2, and vice versa). I would like
to produce a new dataframe DF3 containing rows in DF1 that aren't in
DF2 (and similarly DF4 would contain rows in DF2 that aren't in DF1).
I have a solution for this problem (see self contained example below)
but it's awkward and
2013 Jan 11
2
Merging list of dataframes with reshape merge_all
Hi,
I'd like to merge mutliple dataframes from a list of dataframes by some common
columns. The approach for simply merging 2 dataframes is working with:
merge(df1,df2,by=c("col1","col2","col3"),all=TRUE)
For mutliple dataframes in a list I try to use the merge_all command
from the package reshape.
The documentation states that the command takes a list of
2009 Oct 07
1
merging dataframes with an unequal number of variables
Hallo Everyone
I have the kind of problem that one should never have because one must
always plan well and communicate with your team. But now I haven't so here
is my problem.
I have data coming in on a daily basis from surveys in 10 towns. The
questionnaire has 62 variables but some of the regions have used older
versions of the questionnaire that have a few variables less. I want to
combine
2010 Apr 06
2
Merging data frames on two conditions
Hi Guys
I have two data frames which I would like to merge on two conditions.
I am doing the following (abstract form)
new.data.frame <- merge(df1,df2, by=c("Col1","Col2"))
It is giving me a null result.
Basically I need to apply two conditions.
I also tried sqldf but it is running forever. Will indexing help ?
temp <- sqldf("select
2009 Nov 10
1
merge data
df1 -- dataframe with column date and several other columns. #rows >40k Several of the dates are repeated.
df2 -- dataframe with two columns date and index. #rows ~130 This is really a map from date to index.
I would like to create a column called index in df1 which has the corresponding index from df2.
The following works:
index <- NULL
for(wk in df1$week){
index <-
2010 Aug 21
3
problems with merge() - the output has many repeated lines
Hi everyone,
I have been merging many big dataframes (about 80000 rows
each) and I never had this problem, but now it happened to
me and I want to know if someone knows what could be
happening.
The final dataframe has many rows, an impossible number! I
have done edit(dataframe) and I saw that there are many
repeated rows (all equal).
Thanks for any help,
Cec?lia Carmo
Universidade de
2012 Mar 14
3
merge bug fix in R 2.15.0
Is it intended that the first suffix can no longer be blank? Seems to be
caused by a bug fix to merge in R 2.15.0.
$Rdevel --vanilla
DF1 = data.frame(a=1:3,b=4:6)
DF2 = data.frame(a=1:3,b=7:9)
merge(DF1,DF2,by="a",suffixes=c("",".1"))
Error in merge.data.frame(DF1, DF2, by = "a", suffixes = c("", ".1")) :
there is already a column
2009 Feb 19
3
Multiple merge, better solution?
Hello,
My problem is that I would like to merge multiple files with a common
column but merge accepts only two
data.frames to merge. In the real situation, I have 26 different
data.frames with a common column. I can of course use merge many times
(see below) but what would be more sophisticated solution? For loop?
Any ideas?
DF1 <- data.frame(var1 = letters[1:5], a = rnorm(5))
DF2 <-
2011 Feb 02
1
Merging by factor variables
I'm wondering about the behavior of the merge function when using factors as by variables. I know that when you combine two factors using c() the results can be odd, as in:
c(factor(1:5),factor(6:10))
which prints: [1] 1 2 3 4 5 1 2 3 4 5
I presume this is because factors are actually stored as integers, with 6,7,8,9,10 stored internally as 1,2,3,4,5.
This concerns me somewhat, as I often
2017 Oct 09
3
Merge me agrega siempre las columnas
Buenas,
Tengo dos data.frames de la siguiente manera
library(data.table)
id<-c("a1","a2","a3","a4")
id2<-c("a2","a3","a1","a4")
y<-c(1,2,3,4)
z<-c(3,5,6,7)
k<-c(1,3,8,7)
df1<-data.table(id,y,z)
id<-c("a2","a3","a1","a4")
df2<-data.table(id,x,y)
Quiero