Displaying 20 results from an estimated 50000 matches similar to: "iterating over files in a directory with R"
2004 Feb 17
4
importing ascii grids (for gstat)
Hello,
Is there anyone who could give me an example of how to import an ascii grid (i.e. ArcGIS exported raster) into R. I want to use it with gstat but don't know the appropriate import routine.
Thanks very much for your help.
Regards,
femke
Femke Reitsma
Graduate Student (ABD)
Geography Department
2181 LeFrak Hall
University of Maryland
College Park, MD 20742
Phone: 301-405-4121
2004 Feb 18
5
overlay points on plot
Dear R-help list,
I'm trying to overlay a number of data objects in a plot. Following an earlier example on the list I've created an empty plot as follows
> xlim <- range(as.numeric(c("0","10000")))
> ylim <- range(as.numeric(c("0","25")) )
> plot(NA, xlim=xlim, ylim=ylim, xlab="distance", ylab="semivariance")
2004 Feb 18
2
using names() as a variable in a formula
Greetings List,
I'm having some trouble with the use of the names function in a formula. Below is an example of something that works (i.e first line), and the second line is the same formula which doesn't. I want to be able to reference the column of the dataC table so I can run the variogram iteratively with a loop.
> v<-variogram(A1~1,loc=~x+y, dataC)
>
2004 Feb 26
6
adding header info to write.table
Hello,
Could someone please tell if there is a way to append header info to the top of an exported dataframe (exported with write.table). I want to append the following, which are the defininitions for an asciigrid:
ncols 532
nrows 999
xllcorner 510465
yllcorner 4766375
cellsize 30
NODATA_value -9999
Thanks very much,
femke
[[alternative HTML version deleted]]
2009 Dec 21
2
Reading multiple Input Files
Dear R helpers,
Suppose I am dealing with no of interest rates at a time and the no of interest rates I am selecting for my analysis is random i.e. it can be 2, can be 10 or even higher. The R-code I had written (with the guidance of R helpers obviously and I am really grateful to all of you) as of now is sort of hard coding when it comes to reading interest rates as an input e.g.
## INPUT
2006 Apr 10
2
RJS newbie - need help with iterating / existence test
Greetings!
I''m new to Ajax and am trying to get a basic app working as a vehicle for learning it. The app is an extension of the cookbook tutorial. My intent is to be able to add a list of ingredients for a recipe. The page to add ingredients uses Ajax. As ingredients are added to the page they''re displayed in a "green-bar" format like that used in the Depot
2012 Feb 03
2
iterating through for loop
how to iterate two elements each through for loop?
e.g. x<-c(1,2,4,7,34,6)
y<-c(3,5,6,9,34,7)
for(z in x){
print(paste(z,y)) }
i want both element of vector iterate serially with same position
--
View this message in context: http://r.789695.n4.nabble.com/iterating-through-for-loop-tp4354101p4354101.html
Sent from the R help mailing list archive at Nabble.com.
2009 Nov 11
1
How to get the names of list elements when iterating over a list?
I need to get the names of the list elements when I iterate over a
list. I'm wondering how to do so?
alist=list(a=c(1,3),b=c(-1,3),c=c(-2,1))
sapply(alist,function(x){
#need to use the name of x for some subsequent process
})
2009 Dec 03
1
Iterating over array to create users and files
I want to do the following
declare variable:
$usernames = [ "chris", "bob", "tim" ]
How would I iterate over it to create something like:
user { "$username":
home => "/home/$username",
}
Also is it possible to create a more complex structure with $UID and
$Shell
I''m thinking of something like this:
$users
2009 Apr 21
4
[LLVMdev] Iterating over all uses of a Function
Hi,
I try to iterate over all uses of a Function with the following
code (simplified):
for (Value::use_iterator UI = F->use_begin(), UE = F->use_end();
UI != UE; ++UI) {
if (CallInst* I = dyn_cast<CallInst>(*UI)) {
// do something interesting
}
}
This works on Linux, but on Windows the dyn_cast fails, even
though the only use of F in that
2005 Apr 18
1
Storing vectors as vectors and iterating through them
Hi all,
I have a bunch of int vectors. Each vector holds a bunch of ints that
correspond to row numbers of an existing matrix. I use the int vectors to
pull out rows of data from a matrix, i.e.
data <- my_matrix[int_vector,]
I would like to store these int vectors in some sort of data structure that
will preserve them as-is and allow iteration. I guess what I'm looking for
would be
2009 Oct 13
1
Iterating over file lines
I am attempting to iterate over a file, processing it line by line.
In my function below, I am only getting the first item over and over
and over again from my test file rather than subsequent lines. How
can I modify this to read lines sequentially?
==
iteratefile <- function(file) {
f.con <- file(file)
on.exit(close(f.con))
while( length(readln <- readLines(f.con, 1)) > 0 ) {
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 Oct 16
3
Controller iterating through returned records and appending to each
I have a controller that gets a list of employees (which has an "include =>
[:salaries, :incentives, :billablegoals, :reviews]"). I then need it to
iterate through each employee and determine their current active goal based
on the "effective date."
After playing around with it a bunch, I got the following to work. Only
problem is that if I remove the "@employees.each {
2003 Jan 04
4
filelist calculation algoritm
HI all,
efficiency question for VERY low bandwith networks
Suppose I know the list of files that are changed
What is the most efficient way to make rsync sync this list.
Currently I use --include-from --exclude to generate a 'filelist' but I
suspect that client and/or server exchange the list of files in the module to
be synced. this traffic can be avoided since the include-from
2010 May 26
2
Avoiding Loops When Iterating Over Statement That Updates Its Input
Since `for' loops are slow in R, and since `apply' functions are
faster, I was wondering whether there were a way to use an apply
function?or to otherwise avoid using a loop?when iterating over a
statement that updates its input.
For example, here's some such code:
r.seq <- 2 * (1 / d$Dt[1] - 1)
for (i in 2:nrow(d)) {
rf <- uniroot(bdt.deviation, interval=c(0, 1),
2011 Jul 29
4
scripting/littler: How to call function named iteratively (`f1`, `f2`, …)?
Dear R folks,
wanting to compare different implementations of a solution I want to
script it to iterate over the different implementations. Is there a way
to do this in the R shell/command line?
$ more /tmp/iterf.r
f1 <- function(n = 100000,
l = 100000)
{
z = n + l
}
f2 <- function(n = 100000,
2005 Apr 05
4
lists: removing elements, iterating over elements,
I'm writing R code to calculate Hierarchical Social Entropy, a diversity
index that Tucker Balch proposed. One article on this was published in
Autonomous Robots in 2000. You can find that and others through his web
page at Georgia Tech.
http://www.cc.gatech.edu/~tucker/index2.html
While I work on this, I realize (again) that I'm a C programmer
masquerading in R, and its really
2006 Mar 16
32
iterating a partial with :collection
following AWDWR book - ''Partials and Collections'' (rather sparse info
there too) and I might add that the wiki page on this topic is entirely
devoid of any info...be that as it may...
I have hash of several arrays that I want to iterate though and display.
the first hashed element looks like this (greatly simplified)
- :facility: !ruby/object:Facility
attributes:
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