similar to: Isolating a column within a loop

Displaying 20 results from an estimated 10000 matches similar to: "Isolating a column within a loop"

2010 Sep 09
3
Alignment of lines within barplot bars
Dear all, I have a barplot upon which I hope to superimpose horizontal lines extending across the width of each bar. I am able to partly achieve this through the following set of commands: positions <- barplot(bar_values, col="grey") par(new=TRUE) plot(positions, horiz_values, col="red", pch="_", ylim=c(min(bar_values), max(bar_values))) ...however this results
2009 Aug 17
3
Replacing NA values in one column of a data.frame
Dear all, I'm trying to replace NA values with -9999 in one column of a data frame. I've tried using is.na and the testdata[testdata$onecolumn==NA] <- 9999 approach, but whilst neither generate errors, neither result in -9999s appearing - the NAs remain there! I'd be grateful for any advice on what I'm doing wrong or any other suitable approaches. Many thanks, Steve
2007 Nov 15
1
read complicated file
Dear R experts, I have been given data files in the following configuration and have been puzzling about how to read them in. First I will give a snippet of the beginning of file: Data File: W Para File: GABOR_0.gor v 10.6, Date : 29/10/2007 Time : 13:33 3.00 5.000 Noise SD (deg): 15.000 1 -5.321 -5.321 2 -5.321 -3.991 3 -5.321 -2.661 4 -5.321 -1.330 5 -5.321 0.000 6 -5.321 1.330 7
2009 Mar 26
1
Column name assignment problem
Dear all, I'm trying to assign a name to the fourth column whilst using 'assign', but keep encountering errors. What have I done wrong?! > assign(colnames(c(paste("arunoff_",table_year, sep="")[4]), "COUNT")) Error in if (do.NULL) NULL else if (nc> 0) paste(prefix, seq_len(nc), : argument is not interpretable as logical Hope someone is able
2009 Mar 25
4
Manual sort in a for loop
Dear all, I am trying to manually re-sort rows in a number of tables. The rows aren't sorted on any particular values but are simply ordered by user choice (as shown by the row numbers in the code). I have been able to carry out each re-arrangement without the use of the 'for' loop, but cannot seem to successfully execute the statements when incorporated into the loop. The code I have
2008 Sep 05
2
Use of colour in plots
Dear all, I have 3 datasets all of which share the same longitude and latitude values, which I'm looking to plot onto a scattergraph. The third dataset has values which can only be either '1' or '2'. So to incorporate all three datasets onto two axes, I'm wondering if I can plot dataset1 and dataset2 as normal, but then use colour to determine whether these points are
2011 May 23
1
Help with isolating and comparing data from two files.
Hello, I was hoping that someone would be able to help me or at least point me in the right direction regarding a problem I am having. I am a new R user, and I've been trying to read tutorials but they haven't been much help to me so far. The problem is relatively simple as I've already created working solutions in Java and Perl, but I need a solution in R as well. I have two text
2011 Mar 16
2
Need to abstract changing name of column within loop
Hi, I'm struggling to figure out the way to change the name of a column from within a loop. The problem is I can't refer to the object by its actual variable name, since that will change each time through the loop. My xts object is A. > head(A) A.Open A.High A.Low A.Close A.Volume A.Adjusted A.Adjusted.1 2007-01-03 34.99 35.48 34.05 34.30 2574600 34.30
2009 May 04
4
Producing a legend successfullly
Dear all, I'm attempting to insert a legend into a line graph. I've sorted out the positioning, but I'm unable to display the sample line and associated colour to go within the legend box. Instead, under the variable names, the numbers 1, 2, 2, 3 are displayed in a column (with '2' repeated twice). This is the code I'm using: legend(80,1150, c("Simulation",
2009 May 18
8
Simple plotting errors
Dear R Users, I have 12 data frames, each of 12 rows and 2 columns. e.g. FeketeJAN MEAN SUM_ AMAZON 144.4997874 68348.4 NILE 5.4701955 1394.9 CONGO 71.3670036 21196.0 MISSISSIPPI 18.9273250 6511.0 AMUR 1.8426874 466.2 PARANA 58.3835497 13486.6 YENISEI 1.4668313 592.6 OB 1.4239179 559.6 LENA 0.9342164
2006 Oct 31
0
6316708 LD_DEBUG should provide a means of identifying/isolating individual link-map lists (fix unref)
Author: rie Repository: /hg/zfs-crypto/gate Revision: c8b1a957b6932793bf1ec075bba368e687c7fbca Log message: 6316708 LD_DEBUG should provide a means of identifying/isolating individual link-map lists (fix unref) Files: create: deleted_files/usr/src/cmd/sgs/liblddbg/common/_synonyms.h delete: usr/src/cmd/sgs/liblddbg/common/_synonyms.h
2015 May 04
1
Isolating a subnet on demand
I'm still confused, but in any case, there's nothing stopping "miou" from impersonating "apeliote"'s subnets in your case, unless you use StrictSubnets. Here's the easiest way to do the spoofing: In miou's own node file (on the miou machine itself), add apeliote's subnets with a Weight smaller than 10 (which is the default), so that it overrides them.
2010 Feb 09
2
Resampling a grid to coarsen its resolution
Dear all, I have a grid (data frame) dataset at 0.5 x 0.5 degrees spatial resolution (720 columns x 360 rows; regular spacing) and wish to coarsen this to a resolution of 2.5 x 2.5 degrees. A simple calculation which takes the mean of a block of points to form the regridded values would do the trick. Values which should be excluded from the calculation are -9999 (unless all points within a block
2008 Sep 07
3
Averaging 'blocks' of data
Dear all, I have a large dataset which I hope to reduce in size, to make it more useable. I hope to do this by taking an average of each 60 x 60 blockof values and forming a new data frame out of the averaged values. How would I go about taking averages of 60 x 60 'blocks' in R, and cycling through the whole dataset, recording each calculated value in a new table/data frame? Many thanks
2011 Nov 12
2
dev.new() within a loop
Hello, I have a loop where I iterate performance data files within a folder, parse and plot them in one shot (see below). However, when executing plot_raw which invokes dev.new(..) all windows come out blank whereas if I execute each file outside of a loop then I can see the plots properly. What's wrong here? Thanks in advance, Best regards, Giovanni # given a directory name, it will
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=""),
2009 Mar 27
2
Assignment to variables fails to loop
Dear all, I think I'm nearly there in writing R code which will read in files with two variable parts to the file name and then assigning these file names to objects, which also have two variable parts. I have got the code running without encountering errors, however, I receive 50+ of the same warnings: 1: In assign(paste("Fekete_", index$year, index$month, sep = ""),
2010 Jan 22
1
Looping multiple dimensions
Dear all, I have 30 arrays, each with dimensions 720,360,12. The naming format for each of these 30 objects is: mrunoff_5221, mrunoff_5222... mrunoff_5250. For example: > str(mrunoff_5221) ? num [1:720, 1:360, 1:12] NA NA NA NA NA NA NA NA NA NA ...? (the initial NA's are nothing to worry about) I am looking for a way by which I can extract each of the third dimension of these grids
2011 Jan 17
2
Summing data frame columns on identical data
Dear all, I have 9 data frames, and I'm simply trying to sum the values of column 3 (on a row-by-row basis). However, there are a slightly different number of rows in each data frame, so I'm receiving the following error: "Error in Ops.data.frame(mrunoff_207101[3], mrunoff_207102[3]) : ? + only defined for equally-sized data frames". Here is what I'm attempting to do:
1998 Aug 31
0
isolating R/S and operating system differences
Below is a revised version of my kernel of functions for isolating R/S and operating system differences. The main change is "date" which I've renamed "date.parsed" to avoid conflicts with the R and S date functions. The R call now uses system() rather than unix() to avoid warning messages in R 0.62.3. Paul Gilbert