similar to: combine many .csv files into a single file/data frame

Displaying 20 results from an estimated 10000 matches similar to: "combine many .csv files into a single file/data frame"

2010 Mar 05
3
How to match vector with a list ?
Dear list, I have a vector of characters and a list of two named elements : i <- c("a","a","b","b","b","c","c","d") j <- list(j1 = c("a","c"), j2 = c("b","d")) I'm looking for a fast way to obtain a vector with names, as follows : [1] "j1" "j1"
2004 Nov 13
3
density estimation: compute sum(value * probability) for given distribution
Dear R users, This is a KDE beginner's question. I have this distribution: > length(cap) [1] 200 > summary(cap) Min. 1st Qu. Median Mean 3rd Qu. Max. 459.9 802.3 991.6 1066.0 1242.0 2382.0 I need to compute the sum of the values times their probability of occurence. The graph is fine, den <- density(cap, from=min(cap), to=max(cap), give.Rkern=F)
2007 Mar 09
1
Applying some equations over all unique combinations of 4 variables
#I have a data set that looks like this. A bit more complicated actually with # three factor levels but these calculations need to be done on one factor at a #I then have a set of different rates that are applied #to it. #dataset cata <- c( 1,1,6,1,1,2) catb <- c( 1,2,3,4,5,6) doga <- c(3,5,3,6,4, 0) data1 <- data.frame(cata, catb, doga) rm(cata,catb,doga) data1 # start rates #
2004 Dec 23
3
combination of scatterplot and image graph
Dear R users, I'm interested in a combination of a scatterplot and an image graph. I have two large vectors. Because in the scatterplot some areas are sparsely and others densely populated, I want to see the points, and I also want their color to be changed based on their density (similar to a heat map). Is there a function that can do that? Thank you, b.
2006 Jun 07
2
help with combination problem
hello: I have 3 data.frame objects. First df object: Of dim (149,31). Columns 2:31 are marked as T1..T14 and N1..N16. Name T1 T2 N1 T3 N2 N3 N4 T4 mu1 10 10 9 10 9 9 8 10 mu2 11 11 9 11 9 9 9 11 ... muN 12 12 9 11 9 9 8 12 Second df object: of Dim (50000,31). Columns 2:31 are maked as T1...T14 and N1..N16.
2004 Nov 04
3
keep dimension of a sub matrix
Hi, is there any way to keep a sub matrix dimension? exemple : i1<-1; i2<-1 j1<-2; j2<-3; ret <-matrix(1,4,4)[i1:i2,j1:j2] ; dim(ret) is NULL because the submatrix single col or single row is coerce to a vector automaticaly. How can i bypass this cast : submatrix->vector ??????? Thank you. --------------------------------- [[alternative HTML version
2005 Jan 11
5
global objects not overwritten within function
Dear useRs, I have a function that creates several global objects with assign("obj",obj,.GlobalEnv), and which I need to run iteratively in another function. The code is similar to f <- function(...) { assign("obj",obj,.GlobalEnv) } fct <- function(...) { for (i in 1:1000) { ... f(...) ...obj... rm(obj) #code fails without this line } } I don't understand
2007 Jan 04
3
export many plots to one file
Dear useRs, I have a few hundred plots that I'd like to export to one document. pdf() isn't an option, because the file created is prohibitively huge (due to scatter plots with many points). So I have to use png() instead, but then I end up with a lot of files (would prefer just one). 1. Is there a way to have pdf() embed images, instead of vector instructions? (What would have to be
2002 Feb 22
3
Cent. Mov. Ave
Dear R People: Here is an interesting question(I think) Suppose I want to calculate Centered Moving Averages; i.e. x[1] <- ( sum(y[1:12]) )/12 x[2] <- ( sum(y[2:13]) )/12 and so on. Of course, this is easily done through loops. However, I have been trying to do this more elegantly, but have failed. I have tried things like j1 <- 1:109 j2 <- 12:120 x[1:109] <- ( sum( y[j1:j2])
2006 Nov 22
1
how to merge these dataframes
Hi, Having 3 dataframes with different row numbers, but equal column names (see below) I want to merge them by Var1 so I've tried: merge(j1,j2,j3,by="Var1") merge(j,j1,j2,by=names("Var1")) But always got the same message: Erro en fix.by(by.x, x) : 'by' must specify column(s) as numbers, names or logical What I'm doing wrong? Thanks, Antonio j1
2005 Apr 06
3
looking for a plot function
Dear useRs, I have a data frame and I want to plot all rows. Each row is represented as a line that links the values in each column. The plot looks like this: dfr <- data.frame(A=sample(1:50,10),B=sample(1:50,10), C=sample(1:50,10),D=sample(1:50,10)) xa <- 10*1:4 plot(c(10,40),c(0,50)) for (i in 1:nrow(dfr)) { lines(xa,dfr[i,],pch=20,type="o") } Things get more complicated
2005 Jul 21
3
Rprof fails in combination with RMySQL
Dear R community, I tried to optimized my R code by using Rprof. In my R code I'm using MySQL database connections intensively. After a bunch of queries R fails with the following error message: Error in .Call("RS_MySQL_newConnection", drvId, con.params, groups, PACKAGE = .MySQLPkgName) : RS-DBI driver: (could not connect mylogin@mydatabase on dbname "myDB"
2011 Aug 31
2
Classifying values by interval
Greetings All! As is often the case on this list, the answer may well be under my nose but I can't see it! I am looking for a "smart" way to do the following. Say I have a vector of values, X. I set up bins" for X, say with breaks at B = c(b1,b2,...,b11) covering the range of X, i.e. bins numbered 1:10. The value x is in bin i if B[i] < x <= B[i+1] What I seek is a
2015 Jan 20
6
[LLVMdev] Basic AliasAnalysis: Can GEPs with the same base but different constant indices into a struct alias?
Hi all, This is covered by (struct-path aware) TBAA, but BasicAA disagrees. See the attached testcase, where it prevents us from removing the redundant load. For arbitrary GEPs, we can't decide based on constant indices (because of e.g., &A[0][1] and &A[1][0], with *A a one-element array). BasicAA has some logic to "try to distinguish something like &A[i][1] against
2008 Sep 16
1
Car.proper C[] matrix
I am hoping someone can help translate some WinBUGS code into R code. I would like to use R to create the C[] matrix required for a car.proper model in WinBUGS, but I am having a difficult time negotiating the coding. The C matrix provides normalized weights for each pair of spatial areas. So the WinBUGS example is as follows: # of the weight matrix with elements Cij. The first J1 elements
2004 Oct 11
5
read "4-jan-02" as date
Dear R users, I have a column with dates (character) in a data frame: 12-Jan-01 11-Jan-01 10-Jan-01 9-Jan-01 8-Jan-01 5-Jan-01 and I need to convert them to (Julian) dates so that I can sort the whole data frame by date. I thought it would be very simple, but after checking the documentation and the list I still don't have something that works. 1. as.Date returns the error below. What am I
2004 Oct 13
4
incomplete function output
Dear R users, I have a function (below) which encompasses several tests. However, when I run it, only the output of the last test is displayed. How can I ensure that the function root(var) will run and display the output from all tests, and not just the last one? Thank you, b. root <- function(var) { #---Phillips-Perron PP.test(var, lshort = TRUE) PP.test(var, lshort = FALSE)
2005 Jun 08
2
get level combinations from "by" list
Dear useRs, Given this code I end up with a list of class "by": a <- sample(1:5,200,replace=TRUE) b <- sample(c("v1","v2","v3"),200,replace=TRUE) c <- sample(c(11,22,33),200,replace=TRUE) data <- runif(200) grouped <- by(data,list(a,b,c),function(x) {c(min=min(x),max=max(x), median=round(median(x),digits=2),mean=round(mean(x),digits=2))})
2016 Sep 17
7
Benchmark LNT weird thread behaviour
Hi James/Chris, You guys have done this before, so I'm guessing you can help me understand what's going on. If my buildbot config is: jobs=2, nt_flags=['--cflag', '-mcpu=cortex-a15', '--use-perf', '--threads=1', '--build-threads=4'] It uses -j4 for build, -j2 for running the tests:
2005 Feb 10
3
question about sorting POSIXt vector
Dear useRs, How come the first attempt to sort a POSIXt vector fails (Error: non-atomic type in greater), while the second succeeds? (Code inserted below.) The documentation says that POSIXt is used to allow operations such as subtraction, so I'd expect sorting to work. Is this perhaps an OS issue? (I run R 2.0.1 on Win xp.) Thank you, b. #------------code test <- c("2005-02-08