Displaying 20 results from an estimated 16793 matches for "rowe".
Did you mean:
powe
2011 Sep 09
3
Read a list of files into named R data.frames
I have a collection of .csv files in a directory, and want to read them
into R data.frames whose names
are the same as the file names, without the .csv extension
e.g., from
> (files <- list.files(pattern="*.csv"))
[1] "Allstar.csv" "AllstarFull.csv"
[3] "Appearances.csv" "AwardsManagers.csv"
[5]
2009 May 09
2
a general way to select a subset of matrix rows?
Dear fellow R users,
I can't figure out how to do a simple thing properly: apply an operation
to matrix columns on a selected subset of rows. Things go wrong when
only one row is being selected. I am sure there's a way to do this
properly.
Here's an example:
# define a 3-by-4 matrix x
> x <- matrix(runif(12),ncol=4)
> str(x)
num [1:3, 1:4] 0.568 0.217 0.309 0.859
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster
for subscripting rows of large data frames; it avoids calling
duplicated(rows)
if there is no need to check for duplicate row names, when:
i is logical
attr(x, "dup.row.names") is not NULL (S+ compatibility)
i is numeric and negative
i is strictly increasing
"[.data.frame" <-
function (x, i, j,
2011 May 25
1
rake task: uninitialized constant
I have this rake taks:
CUSTOM_MONTHS = [nil, "GEN", "FEB", "MAR", "APR", "MAG", "GIU", "LUG",
"AGO", "SET", "OTT", "NOV", "DIC"]
def parse_date_string(date_string)
begin
day, month, year = date_string.split("-")
Time.mktime(year, CUSTOM_MONTHS.index(month),
2013 Jan 22
2
Creating a Data Frame from an XML
Hello,
I'm attempting to read information from an XML into a data frame in R using
the "XML" package. I am unable to get the data into a data frame as I would
like. I have some sample code below.
*XML Code:*
Header...
Data I want in a data frame:
<data>
<row BRAND="GMC" NUM="1" YEAR="1999" VALUE="10000" />
<row
2018 Apr 21
2
Check if row of dataframe is superset of any row in another dataframe.
Hi,
I am looking for a way in which I can check if rows in 1 dataframe are
present in another data frame in a unique way. A row in dataframe should be
super set of any row in another dataframe.
I can write a for loop for it, however, that will be inefficient. So, I am
looking for an efficient way to do this in R.
I have explained it with an example below:
I want to check if a row in dataframe
2007 May 01
5
duplicate key violates unique constraint
I''ve run into an interesting issue. When setting up a table with data
from a file (I''m doing this in a block). I find that I can''t create
separate entries manually after the import. It complains about a
duplicate primary key. I''ve tried Schedule.id += 1 but id= either
isn''t defined or accessible in the class
Here is my code:
2008 Jan 11
3
Date range queries return zero results
Hello,
I am having trouble getting data ranges to work correctly. I am using
the following command to load the db:
index << {:title => row[7].to_i,
:date => Date.strptime(row[3], ''%Y-%m-%d''),
:page_id => row[5].to_i,
:page => row[6].to_i,
:content_type => row[1].to_i,
2008 Oct 30
1
row.names(data.frame(matrixWithDimnames)) depends on first rowname being "" or not. (PR#13230)
Full_Name: Bill Dunlap
Version: R version 2.9.0 Under development (unstable) (2008-10-29 r46795)
OS: Linux
Submission from: (NULL) (76.28.245.14)
When data.frame() is given a matrix with rownames, then the type of the output
row names depends on whether the first element of the input row names is "" or
not. The other elements of the input row names don't affect things. E.g.,
2005 Oct 07
2
Some Ruby code help?
Hi,
This isn''t related to Rails itself, but rather to Ruby. I''m trying to
import a file into a database. The fields are separated by a ''|''.
Everything seems to work fine, but after 64 rows are inserted, it starts
mangling the field values. Would you take a look at the following code?
require ''mysql''
def capitalize(str)
2015 Mar 13
2
[PATCH] part-list: add support for show partition type
We lack of showing parttition type for part-list command.
This patch will add support for this.
Also 'parted -m' did not provide partition type info,
remove code section for 'parted -m' process.
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
---
daemon/parted.c | 155 ++++++++++++++++++++++++++-------------------------
generator/structs.ml | 1 +
2008 Feb 16
2
NoMethodError... but its not a method!
Hi everyone,
I am putting together an application in which each part of it was
tested individually. Now that it is put together, I''m having problems...
The one giving me problems is my "ImportController" which parses a CSV
during post and puts it into my database. I have two separate CSV upload
actions (one is for a bill called "bes" and the other from the provider
2009 Mar 30
2
which rows are duplicates?
I would like to know which rows are duplicates of each other, not
simply that a row is duplicate of another row. In the following
example rows 1 and 3 are duplicates.
> x <- c(1,3,1)
> y <- c(2,4,2)
> z <- c(3,4,3)
> data <- data.frame(x,y,z)
x y z
1 1 2 3
2 3 4 4
3 1 2 3
I can't figure out how to get R to tell me that observation 1 and 3
are the same.
2009 Mar 30
2
which rows are duplicates?
I would like to know which rows are duplicates of each other, not
simply that a row is duplicate of another row. In the following
example rows 1 and 3 are duplicates.
> x <- c(1,3,1)
> y <- c(2,4,2)
> z <- c(3,4,3)
> data <- data.frame(x,y,z)
x y z
1 1 2 3
2 3 4 4
3 1 2 3
I can't figure out how to get R to tell me that observation 1 and 3
are the same.
2007 Apr 06
2
Reading a csv file row by row
Hi, my friends.
When a data file is large, loading the whole file into the memory all
together is not feasible. A feasible way is to read one row, process it,
store the result, and read the next row.
In Fortran, by default, the 'read' command reads one line of a file, which
is convenient, and when the same 'read' command is executed the next time,
the next row of the same file
2009 Jun 11
3
Matrix manipulation
Hello everyone,
I have a couple of fairly simple questions (I hope) the answers to which I cannot find through the documentation at the moment.
1. I would like to delete the a row from a matrix if a certain elimination criterion is met. I am familiar with x <- x[-7,] (to remove row 7, for example). Are there any other means of removing an entire row?
2. Is there a single command that
2007 Mar 02
5
extracting rows from a data frame by looping over the row names: performance issues
Hi,
I have a big data frame:
> mat <- matrix(rep(paste(letters, collapse=""), 5*300000), ncol=5)
> dat <- as.data.frame(mat)
and I need to do some computation on each row. Currently I'm doing this:
> for (key in row.names(dat)) { row <- dat[key, ]; ... do some computation on row... }
which could probably considered a very natural (and R'ish) way of
2006 Apr 14
1
row.names in data.frame
We know from the White Book p.57 that the row names of a data frame `are
never NULL and must be unique'. R documents that row.names() returns a
character vector, and in R (much more so than on S) a long character
vector of short unique strings is expensive to store (I saw 72 bytes/row
on a 64-bit machine for 1:1e6). [Incidentally, in the White Book the
index page nos are all off by one
2006 Mar 01
3
Optimization problem: selecting independent rows to maximize the mean
Dear R community,
I have a dataframe with 500,000 rows and 102 columns. The rows
represent spatial polygons, some of which overlap others (i.e., not
all rows are independent of each other).
Given a particular row, the first column contains a unique "RowID".
The second column contains the "Variable" of interest. The remaining
100 columns ("Overlap1" ...
2008 Dec 22
3
row sum question
Dear helpers,
I'm using R version 2.8.0.
Suppose that I have a small data set like below.
[,1] [,2] [,3] [,4]
a 1 1 0 0
b 0 1 1 0
c 1 1 1 0
d 0 1 1 1
First, I'd like to find row sum of values uniquely present in each row, but
only sequentially from the top row, meaning that if the value is shown in
the above row(s) already, the