Displaying 3 results from an estimated 3 matches for "rowindx".
Did you mean:
lowindx
2011 Aug 12
1
Details of subassignment (for vectors and data frames)
...,102,103)is functionally the same as indx <- c(1,5,25) for (i in 1:length(indx)) vec[indx[i]] <- c(101,102,103)[i]
And in the case of a data frame, df <- data.frame(d1=1:10,d2=11:20,d3=21:30), df[c(1,5,10),c(1,3)] <- data.frame(a=101:103,b=104:106)is functionally the same as rowindx <- c(1,5,10) colindx <- c(1,3) for (i in 1:length(rowindx)) { for (j in 1:length(colindx)) df[rowindx[i],colindx[j]] <- data.frame(a=101:103,b=104:106)[i,j] } Obviously I've verified that these examples work and I realize that my loops also contain subassignments; what I'...
2007 Oct 12
3
Anybody has ever met the problem to add a legend to a figure generated by image()?
Dear friends,
Anybody has ever met the problem to add a legend to a figure generated by
image()? I have three variables,x,y and z.
x and y are the coordinates, and z is the third values. we can use image(x,
y, z,...) to generate a figure according to the z-values, but the problem is
the figure legend. How can the legend be added to a figure generated
by image()? Note that filled.contour() can
2008 Oct 03
1
Splitting a file into multiple files based on the column name
Hi,
I have a txt file here I want to split it into different files based on the
column name if it contains a specific word or part of a word. For example,
If the header looks like
A001_Sick A015_SB K99_Sick L913_BB
I would like to split the data , one file contains the data with column
names containing the words ?Sick? or ?SB? and have the rest of the data in
another file.
I