Displaying 20 results from an estimated 5000 matches similar to: "Looping"
2006 Sep 13
2
recursive methods for concatenating sets of files
Hello,
I would like to read sets of files within a folder, perhaps using recursive
methods.
Right now, I rename the files before import.
It would be even better to do this without renaming files, without providing
explicit filenames, perhaps by importing files based on chronology,
and translating each filename into a header?
Please excuse my ignorance, and help cure my clunky programming
2010 Apr 30
1
gluster-volgen - syntax for mirroring/distributing across 6 nodes
NOTE: posted this to gluster-devel when I meant to post it to gluster-users
01 | 02 mirrored --|
03 | 04 mirrored --| distributed
05 | 06 mirrored --|
1) Would this command work for that?
glusterfs-volgen --name repstore1 --raid 1 clustr-01:/mnt/data01
clustr-02:/mnt/data01 --raid 1 clustr-03:/mnt/data01
clustr-04:/mnt/data01 --raid 1 clustr-05:/mnt/data01
clustr-06:/mnt/data01
So the
2012 Jan 22
2
Best practices?
Suppose I start building nodes with (say) 24 drives each in them.
Would the standard/recommended approach be to make each drive its own
filesystem, and export 24 separate bricks, server1:/data1 ..
server1:/data24 ? Making a distributed replicated volume between this and
another server would then have to list all 48 drives individually.
At the other extreme, I could put all 24 drives into some
2011 Apr 04
4
merging data list in to single data frame
Dear R community members
I did find a good way to merge my 200 text data files in to a single data
file with one column added will show indicator for that file.
filelist = list.files(pattern = "K*cd.txt") # the file names are K1cd.txt
.................to K200cd.txt
data_list <-lapply(filelist, read.table, header=T, comment=";", fill=T)
This will create list,
2013 Mar 29
1
multiple plots and looping assistance requested (single plot)
HI Irucka,
Please check this:
temp<- structure(list(`:Bostoncitydata` = structure(list(Month = c(1L,
2L, 3L, NA), Data1 = c(1.5, 12.3, 11.4, NA), Data2 = c(9.1342,
12.31, 3.5, NA)), .Names = c("Month", "Data1", "Data2"), class = "data.frame", row.names = c(NA,
-4L)), `:Chicagocitydata` = structure(list(Month = c(1L, 2L,
3L, 4L, 5L, NA), Data1 = c(1.52,
2013 Mar 07
5
multiple plots and looping assistance requested (revised codes)
Hi Irucka,
I tried it and was able to plot it without any errors.? Here, your code indicates you need two lines. temper[[i]][1]
?temper[[1]][1] # which is the column 1.
? Month
1???? 1
2???? 2
3???? 3
?temper[[1]][2]
#? Data1
#1?? 1.5
#2? 12.3
#3? 11.4
Suppose I use names(temper) instead of seq_along(temper)
pdf("irucka.pdf")
?lapply(names(temper),function(i)
2024 Feb 29
2
Initializing vector and matrices
You could declare a matrix much larger than you intend to use. This works with a few megabytes of data. It is not very efficient, so scaling up may become a problem.
m22 <- matrix(NA, 1:600000, ncol=6)
It does not work to add a new column to the matrix, as in you get an error if you try m22[ , 7] but convert to data frame and add a column
m23 <- data.frame(m22)
m23$x7 <- 12
The only
2011 Nov 16
3
plotting a double y axis when x and y lengths differ
Hello All,
Many thanks to the help I have received so far.
Here is an example data set I hope to plot
Data1
Year Data SE
1 2005 2 0.01
2 2006 4 0.01
3 2007 5 0.01
4 2008 2 0.01
5 2009 3 0.01
6 2010 6 0.01
Data2
Year Data SE
1 2006 32 1
2 2007 100 2
3 2008 60 4
4 2009 67 3
5 2010 8 1
Notice Data2 has one less years worth of data than Data1 (which is my
2024 Aug 11
3
Printing
Thanks. Will try it.
Have not tried it but I think the following may work:
out$results<-NULL
out$results$ei<-ap
out$results$vi<-vap
All I need is printing by returning out (unless I turn it off). And,
retrieve ap and vap as needed as shown above. Guess I need to read more
about invisible.
On 8/11/2024 10:09 PM, Rui Barradas wrote:
> ?s 09:51 de 11/08/2024, Steven Yen escreveu:
2013 Jun 10
4
Combining CSV data
Hello R community,
I am trying to combine two CSV files that look like this:
File A
Row_ID_CR, Data1, Data2, Data3
1, aa, bb, cc
2, dd, ee, ff
File B
Row_ID_N, Src_Row_ID, DataN1
1a, 1, This is comment 1
2a, 1, This is comment 2
3a,
2012 Dec 14
2
Manipulation of longitudinal data by row
I have a dataset of the form below, consisting of one unique ID per
row, followed by a series of visit dates. At each visit there are
values for 3 dichotomous variables. Of the 8 different possible
combinations of the three variables, 4 are "abnormal" and the
remaining 4 are "normal". Everyone starts out abnormal, and then
either continues to be abnormal at subsequent visits,
2010 Sep 06
1
combining collumns for data.frames
Hi
This question is far less simple than the title suggests, please read carefully, thanks.
I have 2 sets of data, both read into R
>data1<-read.table ("1.txt", header=T, sep="\t")
>data2<-read.table ("2.txt", header=T, sep="\t")
>data1
Taxon stage1 stage2 stage3 stage4
T1 0 0 1 1
T2 0
2008 May 14
4
Accessing items in a list of lists
Using R 2.6.2, say I have the following list of lists, "comb":
data1 <- list(a = 1, b = 2, c = 3)
data2 <- list(a = 4, b = 5, c = 6)
data3 <- list(a = 3, b = 6, c = 9)
comb <- list(data1 = data1, data2 = data2, data3 = data3)
So that all names for the lowest level list are common. How can I most
efficiently access all of the sublist items "a" indexed by the outer
2011 Oct 07
2
Merge dataframes
Hello,
I am having some problems to use the 'merge' function. I'm not sure if I got
its working right.
What I want to do is:
1) Suppose I have a dataframe like:
height width
1 1.1 2.3
2 2.1 2.5
3 1.8 1.9
4 1.6 2.1
5 1.8 2.4
2) And I generate a second
2003 Apr 10
6
How to plot several graphs in a single 2-D figure?
Hi, R-listers
I tried to plot several graphs in a sigle x-y coordinate settings, like the
following:
|(y) s
| ****** s
| ***** s
| sssssssssssssssssss
|_______________________________(x)
where "*" and "s" denote two diffrent plots.
However, when I used
plot(data1); % data1 is the data points of "*"
2006 May 30
3
Faster way to zero-pad a data frame...?
Hello List,
I am working on creating periodograms from IP network traffic logs using the Fast Fourier Transform. The FFT requires all the data points to be evenly-spaced in the time domain (constant delta-T), so I have a step where I zero-pad the data.
Lately I've been wondering if there is a faster way to do this. Here's what I've got:
* data1 is a data frame consisting of
2005 Feb 16
5
scaling axes when plotting multiple data sets
1) When adding additional data sets to a plot using "plot" followed by "lines",
is there a way to automate the scaling of the axes to allow for all data sets
to fit within the plot area?
2) I attempted to solve this by setting
xlim=c(min(c(data1,data2,data3)),max(c(data1,data2,data3)))
however, there are some NAs and Infs in these data sets, and min(data1) and
max(data1) both
2009 Nov 06
1
probem on merge data
Hi there,
data1<-matrix(data=c(1,1.2,1.3,"3/23/2004",1,1.5,2.3,"3/22/2004",2,0.2,3.3,"4/23/2004",3,1.5,1.3,"5/22/2004"),nrow=4,ncol=4,byrow=TRUE)
data1<-data.frame(data1)
names(data1)<-c("areaid","x","y","date")
data1
areaid x y date
1 1 1.2 1.3 3/23/2004
2 1 1.5 2.3 3/22/2004
3 2
2010 Dec 07
4
Creating binary variable depending on strings of two dataframes
Hi,
consider the following two dataframes:
x1=c("232","3454","3455","342","13")
x2=c("1","1","1","0","0")
data1=data.frame(x1,x2)
y1=c("232","232","3454","3454","3455","342","13","13","13","13")
2010 May 28
1
Match 2 vectors
Hi,
I have 2 dataframes of unequal length, and I would like to match a
factor to them so that both dataframes will have the same number of
rows.
example:
# create the 2 dataframes with unequal length
data1 <- data.frame(letters, 1:26)[-c(5,10,19:21),]
data2 <- data.frame(letters, 1:26)[-c(6,9,15:18),]
data2a <- match(data1[,1], data2[,1])
data2b <- data2[data2a,]
When I match