similar to: Assignment to variables fails to loop

Displaying 20 results from an estimated 1000 matches similar to: "Assignment to variables fails to loop"

2009 Mar 31
0
Row/columns names within 'assign' command
Dear all, I am attempting to add row and column names to a series of tables (120 in total) which have 2 variable parts to their name. These tables are created as follows: # Create table indexes index <- expand.grid(year = sprintf("%04d", seq(1986, 1995)), month = sprintf("%02d", 1:12)) # Read in and assign file names to individual objects with variable name components
2009 Mar 31
1
Reshape: 'melt' numerous objects
Dear R Users, I'm trying to use the reshape package to 'melt' my gridded data into column format. I've done this before on individual files, but this time I'm trying to do it on a directory of files (with variable file names) - therefore I have to also use the 'assign' command. I have come up against a couple of problems however and am therefore seeking advice... >
2009 Mar 23
2
Looping of read.table and assignment
Dear all, I am trying to read in and assign data from 50 tables in an automated fashion. I have the following code, which I created with the help of textbooks and the internet, but it only seems to read in the final data file over and over again. For example, when I type:> table_1951 I get the same values in the table as when I type> table_2000 despite the values in the source tables
2004 Apr 21
2
Resizing a ListCtrl
Hi Guys, I''m having serious troubles resizing a dialog with a ListCtrl. The ctrl will not resize horizontally no matter what I''m doing. I''ve attached a sample code below. Any help will be greatly appreciated, as I really like wxRuby :) I''ve also tried to copy from the example from listtest.rbw, but that also doesn''t seem to work. Another thing
2009 May 01
1
Problems with 'valid columns' when using merge
Dear all, I am trying to use 'merge' within a loop, however, I receive an error relating to the 'by' argument of the command, as follows: > merge_year <- 1986 > > for (i in 1:10) { # Number of file pairs + assign(paste("merged_arunfek_", merge_year, sep=""), merge(x=paste("arunoff_",start_arunoff, sep=""),
2012 Jun 18
1
Changing many csv files using apply?
Dear all, I have many csv files whose contents I want to change a bit en masse. So far, I've written code that can change them in a for loop, like so: # Subset of files in the folder I want to change subset = "somestring" # Retrieve list of files to change filelist=list.files() filelist = filelist[grep(subset, filelist)] for(i in 1:length(filelist)){ setwd(readdir)
2009 Feb 19
2
read.table : how to condition on error while opening file?
Hi, I'm using read.table in a loop, to read in multiple files. The problem is that when a file is missing there is an error message and the loop is broken; what I'd like to do is to test for the error and simply do "next" instead of breaking the loop. Anybody knows how to do that? Example: filelist <- c("file1.txt", "file2.txt",
2003 Feb 12
2
Filelist caching
Hi, I've noticed every time someone does an rsync-request on my ftp-site (which also provides rsync as mirror method), rsyncd creates a filelist. This is a quite IO and CPU intensive procedure, especially for things mirrors like FreeBSD with lots of little files. I was wondering... is there a way to cache that filelist? Our mirrors are updated once, or twice a day, it could speed up
2009 Mar 26
4
Reading in files with variable parts to names
Dear all, I'm trying to read in a whole directory of files which have two variable parts to the file name: year and month. E.g. comp198604.asc represents April of 1986 - 'comp' is fixed in each case. Years range between 1986 to 1995 and months are between 1 and 12. Just to be clear, there are 12 files associated with each year: e.g. comp198601, comp198602, ... comp198612 through to
2010 Feb 19
3
Plotting multiple table automatically
Hi All, I have a slight issue getting R to plot a series of tables automatically. Essentially I have a series of tables that I wish to plot. They are named on_2, on_3 etc. based on the file name when they were read in. I have filelist <- list.files() to give me list of the table names. I wish to plot each table, so I was thinking along some kind of for loop as below: for (i in 1:Number_Files)
2007 Dec 26
1
scope of plugns
After more than one hour of countless tries, I ask myself a simple question : On what items are plugins supposed to execute ? I''ve tried to create a filelist plugin which, for a page, displays all file in the same directory (a rather old school view of website, where each directory contains an entry point). But, whatever I try, my plugin code is never invoked, and my page content is never
2011 Apr 23
1
rake spec fails where rake spec:(models|controllers|views) pass
I''m still trying to work into Ruby 1.9.2 and am now experiencing something that makes no sense to me. Using rspec 1.3.2 and rspec-rails 1.3.4 with rails 2.3.11 on ruby 1.9.2-p180, when I $ rake spec:models they all pass. When I $ rake spec:controllers they all pass. When I $ rake spec:views they all pass. But when I $ rake spec I get <path to
2009 Dec 28
1
accessing members of a data.frame
I have the following code fileList <-list.files(path = ".", pattern = "[^a-z].txt$", all.files = FALSE, full.names = FALSE, recursive = FALSE, ignore.case = FALSE) for (x in 1:length(fileList)){ fileLines <- data.frame(read.table(fileList[x])) print(string) } the lines of the file all have the following format... AB,20091224,156,156,154,154,55,1198 Can I access
2005 May 23
3
filelist caching optimization proposal
Hi, As a gentoo-user i frequently run the emerge sync command, which in turn does a rsync with the mainserver. The 'problem' is that the portage directory tree contains about 19.000 directories and 96.000 files. So building the filelist takes a pretty long time, because of the many disk accesses that are neccesary. On the server side the disk-io problem is probably less worse since
2003 Sep 12
1
Using the system command
Hello, I am currently taking a statistics course and we are to do a project producing a graph using multiple input files. In R, I'm trying to build a filelist based on a pattern. For some reason, if I do the command interactively and not assign it to an array variable I get what I thought I should, but if I do this inside my R program it chops off some file names and thinks there are two.
2007 May 09
1
Including data when building an R package in windows
I've done this before, but when I tried the same thing this time, it didn't work. I'm using R 2.4.1 on windows. I have 6 data frames that I want to include in a package I am building. Instead of making users issue six different "data(...)" commands, I want to wrap them all up in one file so that users issue one "data(...)" command and have access to all six data
2009 Dec 30
1
seg-fault... but on what
I got the following after running succesfully through this loop 28 million times... the loop opens text files in a directory and inserts line by line into a database... *** caught segfault *** address 0xc0000010, cause 'memory not mapped' Traceback: 1: .getGeneric(f, where, package) 2: getGeneric("coerce", where = where) 3: as(obj, "integer") 4:
2023 Dec 21
1
rsync over ssh fails with --files-from
Hi, On Wed, Dec 20, 2023 at 11:03?AM Kevin Korb via rsync <rsync at lists.samba.org> wrote: > What is the error? I assume you know that with that syntax the > filelist.txt is local rather than remote. > Yes, I do know it refers to the list of local files. There is no error - it just hangs indefinitely until some timeout period. This is what it looks like on the remote side: $
2023 Dec 20
1
rsync over ssh fails with --files-from
What is the error? I assume you know that with that syntax the filelist.txt is local rather than remote. On 12/20/23 09:50, Alex via rsync wrote: > Hi, I've been using rsync on fedora over ssh to sync directories for > decades, but suddenly having a problem with transferring multiple files > at a time to one specific host using --files-from. I can't think of what > might
2008 Jul 06
3
Lots of huge matrices, for-loops, speed
Hello, we have 80 text files with matrices. Each matrix represents a map (rows for latitude and columns for longitude), the 80 maps represent steps in time. In addition, we have a vector x of length 80. We would like to compute a regression between matrices (response through time) and x and create maps representing coefficients, r2 etc. Problem: the 80 matrices are of the size 4000 x 3500 and we