Hello,
Suppose that you have a data frame 'df' with variables 'V1', 'V2', 'V3',
etc.
Is there any (performance) difference (except the difference of the return
types)
between the following two computations?
subset(df, V1 0, V2)
and
df$V2[df$V1 0]
Best Regards,
hyunjo
On Sep 26, 2009, at 11:40 AM, John Kane wrote:
?subset
problems - c( Water damage, Water off, water pipes damaged,
leaking water)
damaged - subset(house_info, house_info[,1]==problems[1]
| house_info[,1]==problems[2]
| house_info[,1]==problems[3]
Thanks.It works
--
View this message in context:
http://www.nabble.com/Nested-select-tp25608506p25622242.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
Conditionally, when Ind of a certain row is 1, want to get sum or delta of Val
in that row and 1 row
above.
Val Ind Val Ind Del
10 010 0NA
11 011 0NA
13 1 --- 13 124 or 2
16 0
See the check.names argument in the help file for read.table.
On Sat, Sep 26, 2009 at 1:58 AM, Derek Foo kc.de...@gmail.com wrote:
Hello,
I am trying to read in a csv file with column such as
\\LS01\Processor(_Total)\% Processor Time with the command
read.csv(file). However, the column name
I created separate text files for the 2 data sets. I enter the
following comands:
library(zoo)
library(chron)
z1-read.zoo(textConnection(/path/to/test1.txt),header=FALSE,sep=,,FUN=times)
z2-read.zoo(textConnection(/path/to/test2.txt),header=FALSE,sep=,,FUN=times)
Hello, all R-users!
I am working on fitting a survival analysis model using the coxph
function for Cox proportional hazards regression model. Data look like
usual:
==
group blockdeathcensor
Group1 1 4 1
Group1 1 12 1
On Sat, 26 Sep 2009 15:26:12 +0900 You Hyun Jo youhyu...@gmail.com
wrote:
YHJ Is there any (performance) difference (except the difference of
YHJ the return types)
YHJ between the following two computations?
Try it yourself.
?system.time
is useful for that purpose.
Stefan
Dear All,
To load a previously saved workspace, one can do the following:
load(/path/to/the/saved/workspace/file)
However, if the path to the saved workspace file is a web address, one
gets the following error:
«Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In
On Sat, 26 Sep 2009 01:58:38 -0400 Derek Foo kc.de...@gmail.com wrote:
DF I am trying to read in a csv file with column such as
DF \\LS01\Processor(_Total)\% Processor Time with the command
DF read.csv(file). However, the column name in the resulted data
DF frame is changed to
Hi,
For very large matrices, is this the most efficient way to add two
variables together?
#
attach(attenu)
new-rowSums(cbind(mag, station))
#
Also, could I be directed to some resources for working with very
large datasets?
Thanks
Dear Rafael,
first of all, your simulation works, at least in a technical sense, so I
don't understand what you mean with can't simulate it properly.
Second, your SIR-based model is a quite different from the SIR models I
know (e.g. http://en.wikipedia.org/wiki/SIR_Model).
The R code,
Hi all, can anyone suggest a reason as mto why my xlab is plotting this text
at oposite ends of axis. I would like to represent my lable like this:
Moran's I ...but with the I in italics. For some reason they seperate and
position at oposite ends of the axis??
Thank you
library(lattice)
dat -
On Sep 26, 2009, at 11:46 AM, jiangrm wrote:
Conditionally, when Ind of a certain row is 1, want to get sum or
delta of Val in that row and 1 row
above.
Val Ind Val Ind Del
10 010 0NA
11 011 0NA
13 1
Your files do not have data appropriate to your commands. Since you
did not provide the data (see last line of every message to r-help)
there is not much more that can be said.
On Sat, Sep 26, 2009 at 4:24 AM, e-letter inp...@gmail.com wrote:
I created separate text files for the 2 data sets. I
Dear R-helpers,
I have been inquired about the possibility of developing a web
distributed scoring system: a model is created in a central location,
users fill a form in their browsers, and the central server calls this
model and returns a YES/NO answer to them.
I am tempted into using R for
Dear R-users,
I'd like to place an xyplot() at the top of a page and a levelplot() at the
bottom of the same page, and have the x-axes be the same.
I've come close to finding a solution through Rarchive, and can produce an
upside-down version of what I'd like (levelplot() on the top - see code
Test1 file contained data set 1, test2 contained data set 2
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal,
Hi! All
I am trying to merge very large data sets. Here fullset1 contains 13
data sets. Each data set has columns which I need to merge.
Here I am trying to merge columns 2,6,10,14till end for all 13
data sets in fullset1. But I am only getting 2nd column here.
Rchan1 =
Hi,
I just tried a fourth variant, closer to what ggplot2 uses (I think):
to each grob is assigned a viewport with row and column positions (in
my example during their construction, with ggplot2 upon editing), and
they're all plotted in a given grid.layout. The timing is poor
compared to pushing
On Sat, Sep 26, 2009 at 9:08 AM, e-letter inp...@gmail.com wrote:
Test1 file contained data set 1, test2 contained data set 2
Its not clear to me what you are referring to. The data in your
initial post do not exhibit this problem and there is no data in any
of your subsequent posts in this
the colsplit function in the reshape package does this really easily.
--ista
-- Forwarded message --
From: Dry, Jonathan R jonathan@astrazeneca.com
To: r-help@R-project.org
Date: Fri, 25 Sep 2009 15:01:46 +0100
Subject: [R] Spliting columns, strings or reg exp returning
Hi Jim,
I might be missing something but your command gives the error:
Error in rowSums(mag) : 'x' must be an array of at least two dimensions
#
data(attenu)
attach(attenu)
rowSums(mag) + rowSums(station)
attenu$new-rowSums(cbind(mag, station))
Hi,
We've been calling the function source (package base) from Tinn-R editor to
send files, marked blocks and selections to R interpreter because it avoids a
lot of problems related with input/output synchronization in the Rgui output.
The new RGedit plugin is also using this function in this
On Sep 26, 2009, at 12:52 PM, David Winsemius wrote:
On Sep 26, 2009, at 11:46 AM, jiangrm wrote:
Conditionally, when Ind of a certain row is 1, want to get sum or
delta of Val in that row and 1 row
above.
Val Ind Val Ind Del
10 010 0NA
Check out Simon Wood's Generalized Additive Models: An Introduction
with R. Its actually a lot more than its title suggests with linear
model theory and related use of R in chapter 1 (and GLMs, GAMs, mixed
models and GAMMs in subsequent chapters plus an appendix on matrix
algebra). Google for
?subset
problems - c( Water damage, Water off, water pipes damaged, leaking
water)
damaged - subset(house_info, house_info[,1]==problems[1]
| house_info[,1]==problems[2]
| house_info[,1]==problems[3]
|
Hi,
I think you are feeding two expressions to xlab instead of one.
Try this instead,
xyplot(y ~ x, dat,xlab=expression(Moran's * italic(I)))
HTH,
baptiste
2009/9/26 Andrewjohnclose a.j.cl...@ncl.ac.uk:
Hi all, can anyone suggest a reason as mto why my xlab is plotting this text
at
Depends on the graphing system.
For basic graphics have a look at
?points
?line
?par(new)
for varous options
ggplot2 is designed pretty much to do this so you might want to have a look at
its documentation.
Not sure about lattice as don't use it.
--- On Thu, 9/24/09, Natalie Wong
Hello,
Thanks for your suggestion. It works in my simplified example. However, it
didn't work in my real code. It is probably because I neglected to include
the group argument in the example. I apologize for that.
Below is the real code, if you need the actual data I can include it too.
# this
All,
On p.52 of Deepayan Sarkar's Lattice book there is a nice plot of showing
residuals with median lines superimposed or various groups:
library(lattice)
stripplot(sqrt(abs(residuals(lm(yield~variety+year+site ~ site,
data = barley, groups = year, jitter.data = TRUE, type = c(p, a),
Bogaso wrote:
Thanks Duncan for your input. However I could not install the package
RHTMLForms, it is saying as not not available :
install.packages(RHTMLForms, repos = http://www.omegahat.org/R;)
Warning in install.packages(RHTMLForms, repos =
http://www.omegahat.org/R;) :
argument
Duncan Temple Lang wrote:
However, you can use the source form of the package as a Windows
user; you just have to install it. That involves finding out how to do
this
(either with Uwe's Windows package building service or by installing the
tools
that Brian Ripley and Duncan Murdoch
Hi,
I know this is a little bit offtopic on this list. But I can't find a
more appropriate forum that I can ask. If there is a high quality
forum on statistics textbook discussion, please let me know.
I am reading Applied Linear Statistical Models. One drawback that I
feel about this book is
Thanks, Stefan.
I tested the expressions over a set of various size of data frames.
The result shows 2) and 3) are faster than 1) especially over a data frame
with a large number of columns. The third one is probably the best.
1) subset(df, V1 0, V2) or subset(df, V1 0, V2)$V2
2) df[df$V1
Hi,
Is there any official way to determine the colClasses of a data.frame?
Why has POSIXct such a strange class structure?
Why is colClasses ordered not allowed (and doesn't work)?
Background
==
I am writing a chunked csv reader that provides the functionality of read.table
for large
I assumed (since you did not provide reproducible code) that 'mag' was
a matrix. If 'station' is a matrix, then
mag + rowSums(station)
will work. If that does not work, then you need to tell us what your
data objects are.
On Sat, Sep 26, 2009 at 11:39 AM, tzygmund mcfarlane
Hi,
I run multiclass SVM for iris data, which contains 3 classes (manual page
52). Based on manual, the implementation uses one-against-one approach:
k*(k-1)/2 binary classifiers trained. However, I am getting only two models
instead of three (only two columns of support vectors and
Here are three different approaches:
1. Using the first link as an example, on Windows you can copy the
data and headers from IE (won't work in Firefox) to Excel and from
there to clipboard again and then in R:
library(zoo)
DF - read.delim(clipboard)
z - zooreg(c(t(DF[5:1, 2:13])), start =
2009/9/26 Jens Oehlschlägel oehl_l...@gmx.de:
Hi,
Is there any official way to determine the colClasses of a data.frame?
Why has POSIXct such a strange class structure?
Why is colClasses ordered not allowed (and doesn't work)?
Background
==
I am writing a chunked csv reader that
Carlos J. Gil Bellosta wrote:
Dear R-helpers,
I have been inquired about the possibility of developing a web
distributed scoring system: a model is created in a central location,
users fill a form in their browsers, and the central server calls this
model and returns a YES/NO answer to
Dear R users,
Does anyone has implemented the inverse of the matrix exponential (expm in the
package Matrix)?
In Matlab, there're logm and expm, there's only expm in R.
Cheers
Mimosa
[[alternative HTML version deleted]]
__
At 1:58 AM -0400 9/26/09, Derek Foo wrote:
Hello,
I am trying to read in a csv file with column such as
\\LS01\Processor(_Total)\% Processor Time with the command
read.csv(file). However, the column name in the resulted data frame is
changed to X..LS01.Processor._TotalProcessor.Time.
?any
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
project.org] On Behalf Of zubin
Sent: Friday, September 25, 2009 6:00 PM
To:
Try:
expm( - M)
On Sat, Sep 26, 2009 at 5:06 PM, Mimosa Zeus mimosa1...@yahoo.fr wrote:
Dear R users,
Does anyone has implemented the inverse of the matrix exponential (expm in
the package Matrix)?
In Matlab, there're logm and expm, there's only expm in R.
Cheers
Mimosa
Hi zubin,
Try also
tname = VIX
checkticker = c(VIX, TYX, TNX, IRX)
is.element(tname, checkticker)
# [1] TRUE
HTH,
Jorge
On Fri, Sep 25, 2009 at 8:00 PM, zubin binab...@bellsouth.net wrote:
Hello, writing some R code to cleanse a data set, if the following set of
symbols are identified then
On Sat, 26 Sep 2009, Gabor Grothendieck wrote:
Try:
expm( - M)
Mimosa probably meant say 'the inverse function'.
I do not see one in R.
Chuck
On Sat, Sep 26, 2009 at 5:06 PM, Mimosa Zeus mimosa1...@yahoo.fr wrote:
Dear R users,
Does anyone has implemented the inverse of the matrix
OK. Try this:
library(Matrix)
M - matrix(c(2, 1, 1, 2), 2); M
[,1] [,2]
[1,]21
[2,]12
# log of expm(M) is original matrix M
with(eigen(expm(M)), vectors %*% diag(log(values)) %*% t(vectors))
[,1] [,2]
[1,]21
[2,]12
On Sat, Sep 26, 2009 at 6:24 PM,
On Sat, 26 Sep 2009, Gabor Grothendieck wrote:
OK. Try this:
library(Matrix)
M - matrix(c(2, 1, 1, 2), 2); M
[,1] [,2]
[1,]21
[2,]12
Right. expm( M ) is diagonalizable.
But for
M - matrix( c(0,1,0,0), 2 )
you get the wrong result.
Maybe I should have added that I
Often one uses matrix logarithms on symmetric positive definite
matrices so the assumption of being symmetric is sufficient in many
cases.
On Sat, Sep 26, 2009 at 7:28 PM, Charles C. Berry cbe...@tajo.ucsd.edu wrote:
On Sat, 26 Sep 2009, Gabor Grothendieck wrote:
OK. Try this:
Sylvester's formula (http://en.wikipedia.org/wiki/Sylvester%27s_formula)
applies to a square matrix A = S L solve(S), where L = a diagonal matrix and S =
matrix of eigenvectors. Let f be an analytic function [for which f(A) is well
defined]. Then f(A) = S f(L) solve(S).
We can
Is there a method that I can use to convert 3D coordinates into 2D? I was
looking at persp and trans3d. Are those the ones I should be looking at ?
Thanks ../Murli
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
On Sep 26, 2009, at 10:07 PM, Nair, Murlidharan T wrote:
Is there a method that I can use to convert 3D coordinates into 2D?
Yes.
I was looking at persp and trans3d. Are those the ones I should be
looking at ?
Yes.
Thanks ../Murli
--
David Winsemius, MD
Heritage Laboratories
West
Can anyone tell me what I might be doing incorrectly for an ordinal
logistic regression for lrm?
I cannot get R(2.9.1)to run either summary nor will it let me bootstrp to
validate.
### Y is a 5 value measure with a range from 1-5, the independent
variables are the same. N=75 but when we knock
Hello, all:
I have twenty datasets named as: data1.csv, data2.csv, …, data20.csv. I am
trying to read all of them into R by using loop and function read.table(),
but I don't know how to handle the name of datasets. Has anybody have
encountered a similar problem? Or do you have any suggestions?
input - lapply(1:20, function(.file) read.csv(paste('data', .file,
'.csv', sep='')))
This will create a list of 20 with the dataframe from each file in the list.
On Sat, Sep 26, 2009 at 11:47 PM, legen lege...@gmail.com wrote:
Hello, all:
I have twenty datasets named as: data1.csv,
I am contemplating bringing in and merging three NHANES-III datasets
from the National Center for Health Statistics that are fixed format
with record length=3348, line counts around 20,000 and described by
SAS DATA steps. I have downloaded and linked similar datasets from the
Continuous
On Sep 26, 2009, at 5:11 PM, kkr...@uci.edu wrote:
Can anyone tell me what I might be doing incorrectly for an ordinal
logistic regression for lrm?
I cannot get R(2.9.1)to run either summary nor will it let me
bootstrp to
validate.
### Y is a 5 value measure with a range from 1-5, the
*Hum*
bbb=t(as.matrix(data2)) ?
good luck
milton
On Sun, Sep 27, 2009 at 12:39 AM, Hyo Lee totem...@gmail.com wrote:
Hi guys,
I need your help!!
My goal is to make a csv file from ncdf file.
This is the code i've used :
hyo=open.ncdf(C:/CRUTEM3.nc)
hyo
[1] file C:/CRUTEM3.nc has
59 matches
Mail list logo