similar to: Dynamic arguments in "rbind" function

Displaying 20 results from an estimated 20000 matches similar to: "Dynamic arguments in "rbind" function"

2010 Aug 18
1
syntax for batching rbind process
Dear helpeRs, I am attempting to read in a series of csv files so I can bind them into one large dataframe. I have written the following script: test <- list.files(".", pattern = "csv") #lline 1 imp <- list() #line 2 for (i in 1:length(test)) { #line 3 imp[i] <- read.csv(test[i]) #line 4 }
2018 May 02
8
Converting a list to a data frame
I suspect this is pretty easy, but I'm having trouble figuring it out. Basically, I have a list of data frames such as the following example: list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8)) I would like to turn this into data frame where the list elements are essentially rbind'ed together and the element name becomes a new variable. For example, I would like to turn the
2004 Aug 03
3
dots expansion
Hi list, I'm trying to write a function similar to rbind, except that needs to add a factor to each component array before rbinding them together so that the rows from different arrays are distinguishable. The problem that arose is how to loop through arguments in the dots "..." list. I need to get a hand on each of them but don't know how many of them there are and what
2018 May 02
0
Converting a list to a data frame
On Wed, 2 May 2018, Kevin E. Thorpe wrote: > I suspect this is pretty easy, but I'm having trouble figuring it out. > Basically, I have a list of data frames such as the following example: > > list(A=data.frame(x=1:2, y=3:4),B=data.frame(x=5:6,y=7:8)) > > I would like to turn this into data frame where the list elements are > essentially rbind'ed together and the
2010 Jun 16
1
"Write.table" problem
Hi all, I have imported csv file for processing and exported as txt file (using * "write.table"* with sep = "\t", row.names = FALSE options) However, when I import this txt file in R (*"read.delim"* with header = TRUE, sep = "\t" options) the dimension (i.e number of rows) is inconsistent with the original file. Any solution to this problem would be
2018 Jan 09
1
barplot_add=TRUE
Dear Gerrit Thanks a lot. "rbind" seems to be the right function. Unfortunately there is a shift in the x-axis (see pdf). There are 52 trapcatch values each, m and w, but m$trapcatch and w$trapcatch are shifted up to x-value 60. The follow-up lines for temp and humidity are fine. Thanks Sibylle setwd("~/Desktop/DatenLogger2017") # am Mac sks trap =
2009 Nov 02
1
Using processed objects as arguments of a function
Dear R users, I wish to utilise processed and saved objects as arguments of a function. Specifically, I have created objects using *"assign"* & *"paste"* functions with an incremental index i, the names of the objects are: fund1, fund2, fund3,....., fund80,..... (where the numerical value increments according to the index i & class of these objects are
2009 Sep 10
2
"Read.csv" in R with dynamic file (1st) argument
Dear R users, I have numerous data sets (csv files) saved in the folder which has the same name as individual data. (i.e data x1 saved in x1 folder, data x2 in x2 folder etc) I would like to read in the desired data set name using 'scan' function and assign this inputted value to an object so that it can be used in the 'read.csv' function. For example, x <- scan() 1: 0708
2014 Jul 01
1
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 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 <- commandArgs(trailingOnly=TRUE); # initialize the capped_data data.frame capped_data <- data.frame(lpar="NULL",
2018 Jan 09
0
barplot_add=TRUE
Hi, Sibylle, since you write '"mathematically" add', does barplot(rbind(m$trapcatch, w$trapcatch)) do what you want (modulo layout details)? Hth -- Gerrit --------------------------------------------------------------------- Dr. Gerrit Eichner Mathematical Institute, Room 212 gerrit.eichner at math.uni-giessen.de Justus-Liebig-University Giessen Tel:
2013 Mar 21
1
[mgcv][gam] Odd error: Error in PredictMat(object$smooth[[k]], data) : , `by' variable must be same dimension as smooth arguments
Dear List, I'm getting an error in mgcv, and I can't figure out where it comes from. The setup is the following: I've got a fitted GAM object called "MI", and a vector of "prediction data" (with default values for predictors). I feed this into predict.gam(object, newdata = whatever) via the following function: makepred = function(varstochange,val){ for
2008 Nov 18
2
sequencially merge multiple files in a folder
Dear all, If the question is too easy, please forgive me since I am only few weeks old in R. I have worked on this question a few days and still cannot figure it out. Here I have a folder with more than 50 tab-delimited files. Each file has a few hundreds of thousands rows/subjects, and the number of columns/variables of each file varies.The 1st row consists of all the variable names. Now I
2018 Jan 09
3
barplot_add=TRUE
Dear R users aim Barplot of insect trap catches (y variable trapcatch) at one specific station (variable FiBL_Hecke) from week 1-52 ( x variable week). It works well using the function tapply (sum trapcatch per week, males and females not separated), however, I intend to separate the y variable trapcatch in males and females (variable m_w: m and w) problem I used the function "add" to
2006 Feb 23
4
read file of EXCEL format
Hello sir: How can I read data file of EXCEL format from disk("d:\\data.XLS" for example)? I can only read data file of .txt format read.delim("d:\\data.txt",header=T,as.is=T),but only EXCEL format is available at present. Thanks a lot
2004 Mar 02
3
Margins on tables
It has long been a nuisance to me not being able to form margins on multiway tables in a simple fashion, so i wrote margins(). In my opinion it should go into the base package. The code and the documentation is in: http://www.biostat.ku.dk/~bxc/R/margins/ Please help yourself, and enhance and rename as you see fit. Bendix ---------------------- Bendix Carstensen Senior Statistician Steno
2009 Aug 27
5
Help on efficiency/vectorization
Dear R users, I am trying to extract the rownames of a data set for which each columns meet a certain criteria. (condition - elements of each column to be equal 1) I have the correct result, however I am seeking for more efficient (desire vectorization) way in implementing such problem as it can get quite messy if there are hundreds of columns. Arbitrary data set and codes are shown below for
2007 Mar 01
4
How to read in this data format?
Hi, I recieved an ascii file, containing following information: $$ Experiment Number: $$ Associated Data: FUNCTION 1 Scan 1 Retention Time 0.017 399.8112 184 399.8742 0 399.9372 152 .... Scan 2 Retention Time 0.021 399.8112 181 399.8742 1 399.9372 153 ..... I would like to import this data in R into a dataframe, where there is a column time, the first numbers as column names, and the
2006 Oct 30
4
for importing "data"
*I am a very new user of R. I've spent several hours trying to import data, so I feel okay asking the list for help. * *I had an Excel file, then I turned it into a "tab-delimited" file, as instructed by directions My filename is "lahore.txt" I amusing the following commands for read.delim but i am getting following mesages. Sir i am sending you my excel data file i
2008 Sep 03
2
[LLVMdev] Codegen/Register allocation question.
Hi LLVMers, I have finally sorted out licensing issues and found some time, so I'm trying to port my PBQP register allocator to 2.4 in order to contribute it (if you want it). I've run into a bug that has me confused though. I'm currently failing the following assertion: llc: VirtRegMap.cpp:1733: void<unnamed>::LocalSpiller::RewriteMBB(llvm::MachineBasicBlock&,
2008 Sep 04
0
[LLVMdev] Codegen/Register allocation question.
On Sep 3, 2008, at 5:58 AM, Lang Hames wrote: > Hi LLVMers, > > I have finally sorted out licensing issues and found some time, so I'm > trying to port my PBQP register allocator to 2.4 in order to Nice! We would definitely welcome your contribution. > > contribute it (if you want it). I've run into a bug that has me > confused though. > > I'm currently