Displaying 13 results from an estimated 13 matches for "rowindex".
Did you mean:
rawindex
2016 Mar 29
2
Filtering based on the occurrence
Hello,?
I have a data set similar to below and I wanted to keep the observations after the first occurrence of these department: "B", "D", "F".For example for ID=2, the observation with deps=B and anything after will be kept in the data. For ID=3, observations with deps=D and anything after will be included.
Subject<- c("2", "2", "2",
2016 Mar 31
0
Filtering based on the occurrence
...sh
On Wednesday, March 30, 2016 1:13 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
Hi Farnoosh,
Despite my deep suspicion that this answer will solve a useless
problem, try this:
last_subject<-0
keep_deps<-c("B","D","F")
keep_rows<-NULL
for(rowindex in 1:dim(df)[1]) {
if(df[rowindex,"Subject"] != last_subject) {
? last_subject<-df[rowindex,"Subject"]
? start_keeping<-0
}
if(df[rowindex,"deps"] %in% keep_deps) start_keeping<-1
if(start_keeping) keep_rows<-c(keep_rows,rowindex)
}
final<-matrix(unl...
2011 Jun 14
3
Read in from multiple Excel wksheets
...test files ? e.g. suppose I?m trying to read from the
test_file workbook on my desktop. The following code extracts rows 1
and 2 from worksheet = ?johnny?.
setwd("C:\\Documents and Settings\\dmenezes\\Desktop")
info<-
read.xlsx("test_file.xlsx",sheetName="johnny",rowIndex=1:2,header=FALSE)
info
However, when I try to apply this to my real, large workbook, things
go wrong, with the following error message. Any ideas/workarounds?
Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod",
cl, :
java.lang.OutOfMemoryError: Ja...
2009 Oct 26
1
Creating a sparse matrix from a file
Hi all,
I am new to R and learning the same. I would like to create a sparse matrix
from an existing file whose contents are in the format
"rowIndex,columnIndex,value"
for ex:
1,2,14
2,4,15
I would like to create a sparse matrix by taking the above as input.
However, I couldn't find an example where the data was being read from a
file. I tried searching in R tutorial and also searched for the same in web
but in vain. Could some one k...
2009 May 15
2
transposing/rotating XY in a 3D array
...ensions (row,col,fileN) . (
Converting the data into 3D cannot simply done by:
array(x, c(2,3,2))
because breaks the structure (e.g. 1,3,5 is type mismatch)
array(1:12,c(2,3,2))
, , 1
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
...
Of course following R's indexing order (rowIndex is the fastest)
retains the structures, but X and Y dimensions are transposed. (note, c
(2,3,2) => (3,2,2))
array(1:12, c(3,2,2))
, , 1
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
Its like converting into Japanese vertical reading.
It is not that I cannot get used to it, but I...
2009 Dec 11
2
Why a list of NULL's are reduced to NULL?
The following examples are confusing to me. It is OK, to assigned NULL
to one element in a list. The result is still a list. However, a list
of NULL's are reduced to NULL. I don't understand how this conversion
occurs. Could somebody let me know what is going on?
> X=matrix(1:8, nr=4)
> apply(X,1, function(x) {if(x[[1]]==3){NULL}else{x[[1]]}})
[[1]]
[1] 1
[[2]]
[1] 2
[[3]]
NULL
2012 May 13
4
write data using xlsReadWrite
Hai, I'm trying to write these var output data from these codes inside excel
file. My directory to store the data is
/D:\FYP\image /
but receive an error message :
/Error in write.xls(mydata, "D:\\FYP\\image.mydata.xls") :
object 'mydata' not found/
these are my codes, can you help give an advice or idea with my problem:
/library("biOps")
2013 Apr 12
0
kNNimpute error
...ted means of closest 30
non-NA neighbours and I got the following message back:
[1] "imputing on 270 missing values with matrix size 7304"
[1] "Computing distance matrix..."
[1] "Distance matrix complete"
[1] "Imputing row 70"
Error in which(missing.matrix[rowIndex, ]) : subscript out of bounds
In addition: Warning message:
In dist(x, upper = T) : NAs introduced by coercion
What syntax do I need to impute the precipitation data? Failing that, do
you have another recommendation of a method to use? Statistics is not my
strong point.
thank you for any help yo...
2017 Oct 22
0
Test set and Train set in Caret package train function
...red, Resample == "Fold1")
str(first_holdout)
'data.frame': 90 obs. of 5 variables:
$ pred : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1
$ obs : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1
$ rowIndex: int 2 3 9 11 25 29 35 36 41 50 ...
$ mtry : num 2 2 2 2 2 2 2 2 2 2 ...
$ Resample: chr "Fold1" "Fold1" "Fold1" "Fold1" ...
Are these 90 observations in Fold1 used as training set? If yes then where is the test set for this fold?
thanks for any help!...
2014 Mar 21
0
Wine release 1.7.15
...ght/width in GdipDrawImagePointsRect.
gdiplus: Fix an overzealous optimization.
tapi32: Stub lineOpenW.
Zhenbo Li (5):
mshtml: Added IHTMLTableRow::align property implementation.
mshtml: Added IHTMLTableRow::vAlign property implementation.
mshtml: Added IHTMLTableRow::rowIndex property implementation.
mshtml: Added IHTMLTableRow::sectionRowIndex property implementation.
mshtml: Added IHTMLTable::align property implementation.
--
Alexandre Julliard
julliard at winehq.org
2013 Jan 10
1
how to generate a matrix by an my data.frame
...ta on the bottom and the attachment.Maybe some
one could tell me an appropriate way
to show it.I'm sorry for the inconvenience.
Q:How to generate a 53*53 diagonal matrix by my data
Some problems confused me are that:
1.Since it is a diagonal matrix,I have tried to transform col1 and
col2 to rowindex and colindex ,but I don't know how to generate matrix
by its value's index
2. As you see, the number of 2353 corresponding to other ids in col2
is 53,however,the number of 2409 corresponding to other ids in col2 is
52 and 2500 corresponding to 51 values and so on,so it is hard to use
matri...
2005 Sep 14
13
table sorting/manipulation library?
I have a library I''ve developed that I believe is the most flexible and
useful table sorting/striping/row-selecting library around.
Big features:
Single and multiple-level sort
Arbitrary sort criteria (IP address, date, etc.)
Works with table headers that are > 1 row or column large
Stripe tables and/or enable row selecting
Row selecting supports drag-select and SHIFT-click
No extra
2013 Nov 15
1
Inconsistent results between caret+kernlab versions
I'm using caret to assess classifier performance (and it's great!). However, I've found that my results differ between R2.* and R3.* - reported accuracies are reduced dramatically. I suspect that a code change to kernlab ksvm may be responsible (see version 5.16-24 here: http://cran.r-project.org/web/packages/caret/news.html). I get very different results between caret_5.15-61 +