Displaying 20 results from an estimated 3000 matches similar to: "variable driven summary of one column"
2006 Dec 14
5
Nicely formatted tables
If I use latex(summary(X)) where X is a data frame with four
variables I get something like
Rainfall Education Popden Nonwhite
Min. :10.00 Min. : 9.00 Min. :1441 Min. : 0.80
1st Qu.:32.75 1st Qu.:10.40 1st Qu.:3104 1st Qu.: 4.95
Median :38.00 Median :11.05 Median :3567 Median :10.40
Mean :37.37 Mean :10.97 Mean :3866
2012 Apr 25
1
recommended way to group function calls in Sweave
Dear all
When using Sweave, I'm always hitting the same bump: I want to group
repetitive calls in a function, but I want both the results and the
function calls in the printed output. Let me explain myself.
Consider the following computation in an Sweave document:
summary(iris[,1:2])
cor(iris[,1:2])
When using these two calls directly, I obtain the following output:
> summary(iris[,1:2])
2009 Dec 19
3
DROP and KEEP statements in R
What is equivalent to DROP or KEEP statements of SAS in R?
--
This message was sent on behalf of sarjinder at yahoo.com at openSubscriber.com
http://www.opensubscriber.com/messages/r-help at r-project.org/topic.html
2006 Mar 22
2
has_many, belongs_to
I have one table(profiles) where each row has many rows in another
table(carriers).
If I write profile.carriers I get a collection containing all carriers
that belong to the current profile.
My question is: how do I sort the collection profile.carriers? I would
like to sort it on one of the columns (found in the table carriers). Can
I override some method in the carrier model or somewhere
2010 Feb 05
2
total summary of matrix
Hi,
is there a way to receive a total summary of a numerical matrix?
I'm trying to get a total overview of numerical matrix. Using
summary(nummat) only hands back the Min, 1st Qu, Median, Mean, 3rd Qu
and Max for each column. What I actually need is all the Information
for the whole matrix. Anyone an idea how to do it?
Thanks in advance,
--
Anne Skoeries
2012 Oct 10
2
Summary using by() returns character arrays in a list
I use by() to generate a summary statistics like so:
Lbys <- by(dat[Nidx], dat$LipTest, summary)
where Nidx is an index vector with names picking out the columns in the
data frame dat.
This returns a list of character arrays (see below for str() output) where
the columns are named correctly but the rownames are empty strings and the
values are strings prepended with the summary
2009 Sep 14
1
summary of rpart-Object in tktext window?
Hi,
is it possible to put a summary of an rpart-Object into a tktext-window?
Here is what I'm trying to do:
fit <- rpart(Kyphosis ~ Age + Number + Start, data=kyphosis)
tt <- tktoplevel()
tex <- tktext(tt)
tkpack(tex)
tkinsert(tex, "end", summary(fit))
But since the summary of an object is a list, I always get back the
following error-message:
cannot handle object of
2007 Nov 07
1
Shortcut to refer to an attached dataframe?
When I attach data frames I often want to be able to refer to the whole
data frame rather then one of its components. For example:
attach (my.data.frame)
summary(my.data.frame)
That's fine but often the frame has a very long name so I'd prefer some
shorthand way of referring to it by its position on the search list.
This applies especially to cases where I have a nested data frame
2003 Feb 17
1
R environment advice?
Hello,
My questions are meant to be not necessarily specific...I am looking for
advice and best practices for setting up an R environment. Here's my
situation:
I am one of perhaps three or four individuals who will be analyzing the
same data through the use of R. I would like to set up a "base"
environment for our project, basically some scripts that connect to a
database, load
2009 Jul 23
4
remove multiple columns by name from dataframe
Hi there,
I'm trying to remove multiple columns by name from a data.frame. As a
result I need to get back the modified data.frame without the removed
columns. My columns I want to delete are listed in a vector called
"delete".
data <- read.csv2("data.csv")
delete <- c("col1", "col2", "col3")
newData <- subset(data, select =
2011 Jul 27
1
Referencing a column using a function argument
Hi all,
I've been having trouble with something that seems like it should be
fairly straight forward. Any help at all from more experienced users is
appreciated!
I'd like to write a function that uses a column name as an argument.
However, I run into problems when I try to reference this column within
the function.
For example,
findCutoff <- function(tableName, columnName) {
2007 Apr 22
1
names( d$columnname )
dear R wizards --- would it make sense for names(d$columnname) to be
"columnname"? I can preserve the columnname through x=subset(dataset,
select="columnname"), of course, but it would seem that x=d$columnname
could also do this. No? Sincerely, /iaw
2009 Aug 20
2
boxplot with log="y" and values starting at 0
Hi,
I'm working with a data.frame containing values between 0 and 22000.
Most of the values are actually between 0 and 50 and the high ones are
outliers.
I want to generate a boxplot and since the outliers are extremely
high, I need to scale the y scale logarithmically. Otherwise one
wouldn't really see the boxes of the boxplot.
boxplot(dat, log="y", ylim=c(0,
2005 Aug 05
3
Latex error with Sweave example
I created a tex file following the example in the Sweave help which
produced the following files in my working directory.
Sweave-test-1-006.eps
Sweave-test-1-006.pdf
Sweave-test-1-007.eps
Sweave-test-1-007.pdf
Sweave-test-1.tex
When I run latex on this, I get a latex error, log file below. I am
running R 2.1.1 on Windows XP. I have installed "small MiKTeX" and I
have added
2012 Jan 13
2
question: how to select a column from a dataframe in a function
Hi,
I am creating a function and ran into the problem of selecting a column
from a dataset. It seems as though the $ function (as in data$columnname)
does not apply in the function. In simplified version:
This works:
testf2<-function(data,columnnumber){print(data[,columnnumber])}
But this doesn't:
testf<-function(data,column){print(data$column)}
Even though the first solution works,
2009 Apr 29
1
RweaveHTML (R2HTML) Help
I have found Sweave() to be great for producing PDF documents. I have
been experimenting with RweaveHTML (from the R2HTML) package and have
had moderate success. My main issue has been that I simply want the R
output to be shown verbatim in the HTML document but RweaveHTML tends to
convert most output to a table, for example. So, is there a way to
force the RweaveHTML driver to simply provide
2010 Jul 26
4
using string variable as order() function argument
Hello,
In my script I would like to use a loop, which sorts the dataframe
according to different columns, pointed by the string variable.
id col1 col2 col3
1 10 0 4 8
2 11 1 2 2
3 12 0 8 3
4 13 0 5 5
Usually the order() function can be used like this:
sorted = mytable**[order(column3) , ]
which results in properly sorted table:
**
2006 Jul 03
1
difficult data manipulation question
hi everyone :
suppose i have a matrix in which some column names are identical so,
for example, TEMP
"AAA", "BBB", "CCC", "DDD","AAA", "BBB"
0 2 1 2 0 0
2 3 7 6 0 1
1.5 4 9 9 6 0
1.0 6 10 11 3 3
I didn't even check yet
2009 Aug 12
1
calling a function with dynamically generated buttons
Hallo,
I'm dynamically generating buttons depending on the number of rows of
my dataframe. Every button is supposed to call a function which
generates a plot with the values of one of my dataframe rows.
My code looks like this:
base <- tktoplevel()
plotten <- function(mat, namen, titel) {
midpts <- barplot(height=mat, names.arg = namen, main =
titel, las=2)
2012 Aug 07
2
What is this called? lapply(datum,"[[","ColumnName")
Hello R users
I recently learned how to use this command:
lapply(datum,"[[","ColumnName")
Unfortunately, I don't know how exactly it works, what it's called (in
particular the "[[" part], and what other things you can do with it
(retrieve multiple columns?).
Given datum is a list of dataframes with the same column, but different
number of rows,