Displaying 20 results from an estimated 10000 matches similar to: "Check results between two data.frame"
2012 May 25
4
Reading a bunch of csv files into R
Dear R users
I am struggling from a data importing issue:
I have some hundreds of csv files needed to be read into R for futher
analysis. All those csv files are named in one of the three formats:
(1) strings: e.g. London_Oxford street
(2) Integer: e.g. 1234_5678
(3) combined: e.g. London_1234
I intend to use read.csv("xxxx_xxx.csv") but I only dealt with
sigle documents before and
2013 Jan 23
1
hyphen replaced by period in header when using read.table
To Whom It May Concern:
I have noticed that all of the hyphens ("-") are changed to periods (".") when I try to read.table() and the headers contain "-"
I am using R 2.13 on a RedHat system.
Here is the situation:
I have the following a tab-delimited text file saved as test.txt
File1-a.txt
File1-b.txt
File2-a.txt
File2-b.txt
1
1
2
1
1
2
3
2
1
1
2
3
2012 Jan 20
2
rbind()
Hello there,
Much thanks in advance for any help. I have a few questions:
1) Why do I keep getting the following error:
File1 <- read.csv("../RawData/File1.csv",as.is=TRUE,row.names=1)
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file '../RawData/File1.csv': No such file or
2012 Jul 09
2
Read vector as multi-dimensional data in R by row
Dear R users
Say I wanted to read a vector into R as multi-dimensional array by row,
e.g.
a<-c(1:20)
> b<-array(a,dim=c(2,5,2))
> b
, , 1
[,1] [,2] [,3] [,4] [,5]
[1,] 1 3 5 7 9
[2,] 2 4 6 8 10
, , 2
[,1] [,2] [,3] [,4] [,5]
[1,] 11 13 15 17 19
[2,] 12 14 16 18 20
But actually I wanted...
[,1] [,2] [,3] [,4] [,5]
2013 Mar 06
2
How to combine conditional argument and logical argument in R to create subset of data...
Dear R user
I have data created using code below
b<-matrix(2:21,nrow=4)
b[,1:3]=NA
b[4,2]=5
b[3,1]=6
Now the data is
> b
[,1] [,2] [,3] [,4] [,5]
[1,] NA NA NA 14 18
[2,] NA NA NA 15 19
[3,] 6 NA NA 16 20
[4,] NA 5 NA 17 21
I want to keep data in column 4 greater than 15 and the value in column 1 &
2 either greater than 4
2012 Mar 13
4
Converting factor data into Date-time format
Dear R-user,
I have read a dataset from .csv file into R. This dataset includes one
column containing some data in 'date and time' format, e.g. 'dd/mm/yyyy
hh:mm'.
These data were automatically read and saved as 'factor' in R. When I was
trying to produce some plots (such as time series) with the above 'date and
time' on x-axis, it caused some disodering problem,
2012 Mar 15
2
Importing multiple worksheets from one Excle/ csv file into R
Dear R experts,
I am trying to import some data from some Excle files into R. My Excle file
contains about 50 sheets.
One solution I can think about is to convert my Excle file into csv file
first and then load data into R using 'read.csv'.
But it seems to me that 'read.csv' only supports reading one sheet (or 'one
file') each time, so that seems I have to create 50 csv
2010 Mar 14
3
range and intersection
Hi:
I have a two large files (over 300K lines).
file 1:
Name X
UK 199
UK 230
UK 139
......
UAE 194
UAE 94
File 2:
Name X Y
UK 140 180
UK 195 240
UK 304 340
....
I want to select X of File 1 and search if it falls in range of X and
Y of File 2 and Print only those lines of File 1 that are in range of
File 2 X and Y
How can it be done it
2008 Dec 16
2
Syncing file with reference to another one
I have the following situation: file2 on remote host and file1 on
localhost. file1 and file2 are mostly the same. Simply running
rsync remotehost:file2 file2
will actually transfer the entire file. But I would like to use the
factt that I have local file1 that is mostly similar to file2. I.e.
how can I make rsync to use file1 as a reference while transferring
file2? (cp file1 file2 locally and
2015 Sep 03
1
Doubts on incremental backup and command repetition
Hi,
I am trying to use rsync for incremental backup and I am facing some issues. I would like to ask your help to understand what is going on and have the proper command line.
1) my goal is
I the following folders:
./dest:
file3.txt
./orig:
file1.txt file10.txt file2.txt file20.txt
And I would like to have as incremental backup
./dest:
backup file1.txt file2.txt file3.txt
2008 Apr 23
3
[LLVMdev] Compile units in debugging intrinsics / globals
I have a question about the llvm debugging records, especially wrt compile
units.
In the non-LLVM sense, a compile unit is essentially everything contained
within a single .o file, and it is derived from one or more source and
header files. Included in a compile unit are functions and global data.
Dwarf records refer to compile units in the same way: a compile unit record
has children which
2009 Sep 15
2
Building R package with .c sub-routine files
Lets say I have two source files file1.c and file2.c
The latter just contains sub-routines to be used by the first. i.e. in file1.c I
have the line
#include "file2.c"
Let's say "R CMD SHLIB file1.c" runs perfectly and I want to include the code in
a package, "R CMD build" also runs fine but R CMD check" gives
* checking whether package
2012 Mar 16
1
R merge two dataframes with different row?
Hi everyone,
I have a question for R code to merge.
Say I have two dataframes:
File1 is:
V1 V2 V3 V4
1 100 101 name1
2 200 201 name2
2 300 301 name3
3 400 401 name4
3 500 501 name5
4 600 601 name6
4 700 701 name7
File2 is:
V1 V2 V3 V4
1 50 55 p1
3 402 449 p2
4 550 650 p3
4 651 660
2012 Aug 15
2
to remove columns and rows
Dear,
I am using R I'm trying to identify and remove columns and rows in a data
frame that are has elements equals. For example in dataframe below. The
columns 1, 2,3,4,5 ,6 and 10 (file1) has elements equal then should be
removed. How can I ask R to remove those columns with same elements in new
dataframe (file2) to result a matrix as follows:
file1
1 0 2 2 1 1 5 1 1 1
1 0
2016 Jun 09
1
for loop example
> From: Indunil Jayasooriya <indunil75 at gmail.com>
> > >
> > > [root at centos67 loop]# cat file1
> > > firstname1
> > > firstname2
> > >
> > > [root at centos67 loop]# cat file2
> > > lastname1
> > > lastname2
> > >
> > > I need a OUTPUT like this
> > >
> > >
> > >
2011 Jul 19
1
list.files recursively to find files in a specific way...
Hi, all:
My folders are organized in such a way:
root
----branch1
---------------A
-----------------------file1.txt
-----------------------file2.txt
---------------B
-----------------------file1.txt
-----------------------file2.txt
----branch2
---------------A
-----------------------file1.txt
-----------------------file2.txt
---------------B
-----------------------file1.txt
2008 Apr 24
0
[LLVMdev] Compile units in debugging intrinsics / globals
Hi,
> Suppose I have the following source:
>
> file1:
> #include "file2"
> #include "file3"
> int fn1(void) ...
>
> file2:
> int a;
>
> file3:
> int fn2(void) ...
>
> then fn1, along with all the base types etc appear to be in compile unit
> "file1", the variable a appears to be in compile unit
2012 Dec 03
4
How to calculate the spatial correlation of several files?
dir1 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor", "*.bin",
full.names = TRUE)
dir2 <- list.files("C:\\Users\\aalyaari\\Desktop\\cor2", "*.bin",
full.names = TRUE)
results <- list()
for (.files in dir1){ # read in the 365 files as a vector of
numbers for dir1
file1 <- do.call(rbind,(lapply(.files, readBin ,
2002 Dec 17
4
Quick tip please!
I have two CSV files (exported from Excel), say file1 and file2.
The have the same number of rows, and each has several columns,
with names on the first line; and some of the columns in file1
are repeated in file2.
Using the "foreign" package, I can read these in separately
to dataframes say d1 and d2 with
> d1<-read.csv("file1")
>
2007 Jul 16
2
Source inside source
Is there a way to know where is the source, so as to make a source call
inside another source smarter?
As an example:
file1.R is in directory /files/dir1/
file2.R is in directory /files/dir1/dir2/
In file1.R, there is this line:
source("dir2/file2.R")
So, if I setwd to /files/dir1/, and then I call source("file1.R"),
it will run correctly. However, if I setwd to /files,