I was suggested to use
x = data.frame(string = c( x1, x2, x3))
x
apply(x,1,substr,1,4)
and it's worked good!
Thank you all
Wacek Kusnierczyk wrote:
calpeda wrote:
thank you,
but I m importing data from a txt file and I have a matrix of n*1
The function str seems to work
I had hoped that
plot(c(0,24),c(0,-6),xlab=Time,ylab=Day,
type=n, main=This Week,axes=FALSE)
axis(2,at=0:(-6), labels =
c(Sun,Mon,Tues,Wed,Thurs,Fri,Sat),hadj=TRUE)
axis(1,at=seq(0,24,4))
would give me horizontal tick labels.
It doesn't. What would?
Murray
--
Dr Murray Jorgensen
Dear R user,
I want to do sparse principal component analysis
(spca). I am using elastic net package for this and spca() and the code is
following from the example.
My question is How can I decide the *K =? *and *para=c(7,4,4,1,1,1)) . So,
here k=6 i.e the no of Principal
I want to forecaste the call number everyday for a call-center. Now I
have removed the influence of the fluctuation with some method, so
only thing left is to analyze the trend of the call number every day.
I have thought of two ways: regression and HoltWinters smooth. But
when I use regression, I
Murray Jorgensen wrote:
I had hoped that
plot(c(0,24),c(0,-6),xlab=Time,ylab=Day,
type=n, main=This Week,axes=FALSE)
axis(2,at=0:(-6), labels =
c(Sun,Mon,Tues,Wed,Thurs,Fri,Sat),hadj=TRUE)
axis(1,at=seq(0,24,4))
would give me horizontal tick labels.
It doesn't. What
Xiao-Jun Ma-2 wrote:
I'm trying to collapse a character vector to strings, but I am getting
unexpected behaviors in list context:
A - a
B - c(b,c)
xx - list(A=A, B=B)
lapply(xx, paste, collaplse=.)
Typing error in collapLse
Dieter
--
View this message in context:
Dear R community
I
have a question regarding the value of cost complexity parameter k
used in tree package for pruning purpose. In the example below i used k=0.
But if i take the value k=NULL, then it will not plot the resultant tree. Any
help in finding the
optimum value of k is requested.
Hello everybody,
I would like to carry out a discriminant analyse.I have two variables:
eye diameter and body length.
I have values for different areas and would like to separate those areas from
each other according to the variables.
Taking the raw data returns a cloud of points.The areas don't
Peter Dalgaard wrote:
Wacek Kusnierczyk wrote:
Stavros Macrakis wrote:
`-`
Error: object - not found
that's weird!
Why???
partly because it was april fools.
but more seriously, it's because one could assume that in any syntactic
expression with an operator involved, the
Wacek Kusnierczyk wrote:
and btw. the following is also weird:
quote(a=1)
# 1
not because '=' works as named argument specifier (so that the result
would be something like `=`(a, 1)),
i meant to write: not because '=' does not work as an assignment
operator (or otherwise the
Dear R users,
I know, the question is bit old one. :-(
Ok. I have a table with say three columns and 70 rows.
The second column has dates in format dd.mm.yy (i.e. 01.10.07 indicating
record for October 1, 2007).
I read the text file, containing the records. Now, I want to find out the
weekday
try this,
d = read.table(textConnection(USER NAME
12 admin
12 admin
10 admin
10 advertising
61 process
17snapshot
61ticket
61ticket
30snapshot
10advertising
10advertising
10advertising
10advertising
),head=T)
str(d) # note that NAME is a
Hello,
I want to start Klimt from S.Urbanek directly from R.
In the description of klimt is the following R-Code:
source(klimt.r);
d-read.table(mydataset.txt);
t-tree(OUT2~.,d);
Klimt(t,d);
One should make sure, that the klimt.jar is in the working directory of R
(in my case C:\Program
Dear R users
I am currently investigating time series analysis using an irregular time
series. Our study is looking at vegetation change in areas of alien vegetation
growth after clearing events. The irregular time series is sourced from Landsat
ETM+ data, over a six year period I have 38
As I told you before, without knowing the definition of your function
f, one cannot help much.
Paul
On Wed, Apr 1, 2009 at 3:15 PM, rkevinbur...@charter.net wrote:
Thank you I had not considered using gradient in this fashion. Now as an
add on question. You (an others) have suggested using
HI,
I need help..
How to sort and group the data below:-
USER NAME
12 admin
12 admin
10 admin
10 advertising
61 process
17snapshot
61ticket
61ticket
30snapshot
10advertising
10advertising
10advertising
10advertising
I want to plot graph using
Dear List,
No doubt I am going around this the wrong way, and hopefully one of you
will be able to tell me how to go about it the right way.
I want to change the names of an object inside a function and have it
stay changed in the global environment. I can only
effect the change inside the
Rolf Turner wrote:
On 2/04/2009, at 7:04 AM, Thomas Levine wrote:
I really want to do this:
abline(
a=tan(-kT*pi/180),
b=kY-tan(-kT*pi/180)*kX
)
where kX,kY and kT are vectors of equal length. But I can't do that
with abline unless I use a loop, and I haven't figured out the least
Maxl18 wrote:
Hello,
I want to start Klimt from S.Urbanek directly from R.
In the description of klimt is the following R-Code:
source(klimt.r);
d-read.table(mydataset.txt);
t-tree(OUT2~.,d);
Klimt(t,d);
One should make sure, that the klimt.jar is in the working directory of R
(in my case
Dear R folks
While preparing figures of 'envfit' plots with vegan for publication, I
ran into a layout problem, that I found no solution for in the
literature or the help archive:
The labels of the vectors that indicate correlations of environental
variables sometimes overlap with each
V Prasanth wrote:
Dear Duncan Murdoch:
Thanks for your tips. By the way, I think I didn't mentioned my question
very clear. What I mean to say is that, in Excel one could decide upon the
axis interval unit. Please see the attached file. Likewise, is it possible
in R...?
See ?axis
Uwe
Benedikt Niesterok wrote:
Hello everybody,
I would like to carry out a discriminant analyse.I have two variables:
eye diameter and body length.
I have values for different areas and would like to separate those areas from
each other according to the variables.
Taking the raw data returns a
Muhammad Azam wrote:
Dear R community
I have a question regarding the value of cost complexity parameter k used in tree package for pruning purpose. Any help in finding the optimum value of k is requested. Please give some suggestion in this regard. In the example below i used k=0 but i don't
For 2nd question:
a) This is a question that is supposed to go to the BioC list, because
we are talking about a BioC package.
b) The following worked for me in January (but we might have new
versions of something):
1. Install the current package from the BioC website (strongly assuming
Breitbach, Nils wrote:
Dear R-Community,
since I work on a PC at the University I have not the necessary rights for all devices
and therefore my library is located on a net device. The installation process worked and
everything is right apart from one little thing - the help files. When I
Suresh_FSFM wrote:
Dear R users,
I know, the question is bit old one. :-(
Ok. I have a table with say three columns and 70 rows.
The second column has dates in format dd.mm.yy (i.e. 01.10.07 indicating
record for October 1, 2007).
I read the text file, containing the records. Now, I want to
Dear R users,
I have a table with say three columns and 70 rows.
The second column has dates in format dd.mm.yy (i.e. 01.10.07 indicating
record for October 1, 2007).
I read the text file, containing the records. Now, I want to find out the
weekday for each date.
However, I cannot do so.
Hi
r-help-boun...@r-project.org napsal dne 02.04.2009 11:14:34:
HI,
I need help..
How to sort and group the data below:-
USER NAME
12 admin
12 admin
10 admin
10 advertising
61 process
17snapshot
61ticket
61ticket
30snapshot
10advertising
10
You have so many strange special characters (including different quotes
at strange places) below, that it is impossible to find out anything.
If you are using the same editor you are writing your e-mails with, I am
sure you will have diverse problems with your code
Uwe Ligges
Tammy Ma wrote:
Hi, All.
I have scatterplot in 2-D
I'd like to see which proportion of data goes into a range. How shall I figure
it out?
Perhaps some accumulative graph or something?
See ?hist and it argument breaks as well as ?cut
Uwe Ligges
Kind regards,
Tammy
a) This is the *R-help* mailing list. If you want others to make your
data analyses, there are consultants around ...
b) If you still want help from the list, follow the posting guide and
provide relevant information such as some insight to your data. Not many
of us are clairvoyants and
I have answered almost the same question a few minutes ago.
Why do you send questions more than once? It won't make responses
quicker but will confuse people who spend their time in answering
messages who do not see that the questions is already answered in
another thread
Uwe Ligges
MarcioRibeiro wrote:
Hi listers,
I am having some trouble in a matrix multiplication...
I have already checked some posts, but I didn't find my problem...
I have the following code...
But I am not getting the right multiplication...
I checked the dimension and they are fine...
id_y -
The forecast package has a number of forecasting methods
you could try.
On Thu, Apr 2, 2009 at 3:17 AM, minben minb...@gmail.com wrote:
I want to forecaste the call number everyday for a call-center. Now I
have removed the influence of the fluctuation with some method, so
only thing left is to
RJCallahan wrote:
Hi all,
I have a (hopefully quick) question. I've got a fascinating set of fitted
surfaces in three dimensions corresponding to local linear multiple
regressions. I'd like to add rugs to the X and Y axes (corresponding to my
independent variables) in order to get a sense for
j.k wrote:
Hello alltogheter,
I have the following problem and maybe someone can help me with it.
I have a list of values with times. They look like that:
V1 V2
1 2008-10-14 08:45:00 94411.08
2 2008-10-14 08:50:00 90745.45
3 2008-10-14 08:55:00
rename(x,C,Z)
x - rename(x,C,Z)
x
A B Z D
1 2 3 4
--
Regards,
Hans-Peter
__
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
Example:
see_context - function(word, data, context) {
dat - data$strings
temp - grep(paste(^, word, $, sep=), dat)
if(length(temp))
index - lapply(temp, function(x) seq(max(0, x - context),
min(x + context, length(dat
sapply(index, function(x) paste(dat[x],
I am running on 64-bit Ubuntu, R version 2.8.1
If I do anything Tcl/Tk related like:
library( Rcmdr )
or
available.packages()
I get the error:
Error in structure(.External(dotTclObjv, objv, PACKAGE=tcltk), class =
tclObj) :
[tcl] unknown color name red
Try this where we read in a zoo series and then merge it with
a zero width regularly spaced series to create the result.
Lines - V1,V2
2008-10-14 08:45:00,94411.08
2008-10-14 08:50:00,90745.45
2008-10-14 08:55:00,82963.35
2008-10-14 09:00:00,75684.38
2008-10-14 09:05:00,78931.82
2008-10-14
Dear R Users:
Greetings!
Finally, I got what I required...! Thanks a lot for all of your valuable
support, especially to Jim and Duncan Murdoch. Great help guys...
By the way, herewith I am furnishing the code that I used for adjusting the
axis interval unit... Hope it will be useful to others,
What you are trying to do is make R behave like a macro language, which is not
a good idea at all. Better to use R as it was designed to be used rather than
make it behave like something it wasn't.
It also follows that trying to do this is going to be tricky. Here is one way:
RENAME -
Ioannis,
Here's an illustrative example. Note that: glm also objects to X4; X1,..,X4
are defined as factors.
I've looked (albeit in a crude way) at various examples using the perturb
package and it seems to confirm that X4 is the source of multicollinearity.
As I say, I think the constant
Mark, Ted, Gabor,
Thanks for all your input.
José
-Original Message-
From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com]
Sent: 01 April 2009 18:12
To: Jose Iparraguirre D'Elia
Cc: r-help@r-project.org
Subject: Re: [R] A query about na.omit
First input the data frame:
Lines - x
Hello
This may have been answered elsewhere, and I have looked on the web, but
nothing helps. I am trying to do the following:
X-matrix(c(1:15),nrow=3,byrow=T)
Y-matrix(c(2,4,6,8,10),ncol=1)
I need to sum the product of each row of X by the remaining j rows multiplied
by j y values (i.e
May be:
plot(c(-1, 1) , c(-1, 1), type = n)
n = 4
a = rep(0, n)
b = 1:n/n
fun = function(i, a, b, col = 1 , ...) {
abline(a[i], b[i], col = col[i], ...)
}
lapply(1:n, fun, a=a, b=b, col = 1:n)
Andrea
Thomas Levine wrote:
I really want to do this:
abline(
a=tan(-kT*pi/180),
This is interesting. The fact that there are so few texts on the
subject probably means that very few are using OO programming methods in
R.
I will probably look in the Python direction. Pity. I would have
preferred R.
Tom
krzysztof.sakre...@gmail.com wrote:
I have been using Chambers
I have a data.frame y as below, and I want to calculate the weighted modal
value, where v... are the values, and w... are the weights.
At tha moment I am doing it as shown below, but my data.frame has 165900 and
more rows, and it takes ages to do the calculations. I am sure there is a
much better
Tom Backer Johnsen wrote:
This is interesting. The fact that there are so few texts on the
subject probably means that very few are using OO programming methods
in R.
I will probably look in the Python direction. Pity. I would have
preferred R.
if you insist on oo, python might be a
Tom Backer Johnsen bac...@psych.uib.no writes:
This is interesting. The fact that there are so few texts on the
subject probably means that very few are using OO programming methods
in R.
Using python is great; your deduction about use of OO in R harder to
support. The Bioconductor project
Wacek Kusnierczyk wrote:
Tom Backer Johnsen wrote:
This is interesting. The fact that there are so few texts on the
subject probably means that very few are using OO programming methods
in R.
I will probably look in the Python direction. Pity. I would have
preferred R.
if you insist on
Your R version seems to be out of date. This would happen in older
versions of R, prior to 2.8.0 I believe, due to a bug in socketSelect
that was fixed last August.
luke
On Wed, 1 Apr 2009, Ubuntu Diego wrote:
I'm trying to use snow in my dual-core (hopefully later this is going to
run in a
Tom Backer Johnsen wrote:
This is interesting. The fact that there are so few texts on the
subject probably means that very few are using OO programming methods in R.
That's overstating the problem. I frequently run into OO R packages and
many of them are very nicely done. Some good
While not wholly directed towards OO programming, 'R Programming for
Bioinformatics' does cover both the S3 and S4 systems (and how to make
them play nicely together) at an accessible level.
http://www.bioconductor.org/pub/RBioinf/
Best,
Jim
Krzysztof Sakrejda-Leavitt wrote:
Tom Backer
Did you load the package after installing it?
install.packages(ggplot2)
library(ggplot2)
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish Wildlife Service
California, USA
--- On Wed, 4/1/09, haettulegur haettule...@gmail.com wrote:
From:
Sorry I sent a description of the function I was trying to minimize but I must
not have sent it to this group (and you). Hopefully with this clearer
description of my problem you might have some suggestions.
It is basically a warehouse placement problem. You have a warehouse that has
many
Thanks for your mail. I guess that the constant row sum on X would create
problems in a simulation framework because you might end up with linearly
dependent columns or even with columns of zeros (which I believe do not make
much sense).
First of all, I think there is a problem with your
Dear friends,
this time I have a problem with using waba function. Firstly, I'll explain you
my situation.
In the survey a gruop of supervisors judge the dipendents of a company.
One supervisor reported on more than one subordinate.
Thus, I need to show that lack of independence is not a
Dear List-Members,
does anyone know a simple way to automatically install all R packages
on a unix system to the default library path? Not from inside R, it
should rather work as a shell script - job at startup.
Something like R cmd install -l pkgs ### where pkgs should mean all
packages
Dear R-users,
For the purpose of model selection I am looking for a way to
exhaustively (and efficiently) search for best subsets of predictor
variables for a logistic regression model.
I am looking for something like leaps() but that works with glm.
Any feedback highly appreciated.
--
Harald
Dear all,
I'm trying to select from a dataframe all rows which correspond to a
factor (the id variable) for which there exists at least one positive
value of a certain variable. As an example:
x -
data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),rep(1,2)),ncol=2))
x
Hi all,
I was wondering how to construct a seasonal differenced time series
variable.
I used the following code to construct a 12 span seasonal difference
seasonal-diff(V2, lag=12, differences=1)
is this correct?
thank you in advance
joe
[[alternative HTML version deleted]]
I tried many optimizers in R on my large scale optimization problems.
I am not satisfied with their speed on large op problems. But you may
try in this order
nlminb
ucminfucminf package
spq BB package
optim
Is here someone that try to port Ipopt in R?
x -
data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),re
p(1,2)),ncol=2))
id.keep - unique(subset(x,X20)$X1)
x2 - subset(x,X1 %in% id.keep)
x2
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Stephan Lindner
Just a quick thought: if you have the locations
of the items along a line segment (the warehouse),
can you find a way to formulate the problem so that
the average distances represent a matrix calculation
(i.e., multiply some huge matrix by the locations)
then it's a linear problem ...
It's
Florin,
Please allow me to clarify some issues:
Many, if not most, problems in science involve optimization in one form or
another. Consequently, optimization is a vast area. There are many
different types of optimization. Here is a one way to classify optimzation
problems (neither mutually
Hi again,
I understood what you guys explained...
But, there isn't a way to do a multiplication of matrix with a FOR command
or otherelse where one o my dimension is ONE...
Well, as my data file is small, I did the procedure at the excel... But,
this is not the good procedure...
Thanks,
Marcio
On Thu, Apr 2, 2009 at 3:49 PM, rkevinbur...@charter.net wrote:
Sorry I sent a description of the function I was trying to minimize but I
must not have sent it to this group (and you). Hopefully with this clearer
description of my problem you might have some suggestions.
It is basically a
On 3/29/09, In Hee Park ip...@chemistry.ohio-state.edu wrote:
Dear R users:
I am having difficulty to place x-axis location alternatively
top/bottom side in Lattice plot, which is composed of seven-column as
following:
E1 E2 E3 E4 E5 E6 E7
Harald von Waldow wrote:
For the purpose of model selection I am looking for a way to
exhaustively (and efficiently) search for best subsets of predictor
variables for a logistic regression model.
Of all the dangerous ways of doing this and getting confusing results, gl1ce
in lasso2
Hello,
Is there a function in r to find the best fitting model for a set of data?
I would like to know if my data are related exponentially,linearly or if there
is a logarithmic correlation between my x and y values.
To get a better imagination I've added the graphics at the end of this mail
as
Hello all,
I am looking at the one program of the marketing textbook. I understand what
the following function is doing especially the .C command
Can someone help?
If I take off the .C comand will it still run??
drawwc = function(w, mu, y, sigi) {
.C(draww, w = as.double(w),
or the exactly equivalent form:
x[x$X1 %in% unique(x[x$X20,X1]), ]
Patrizio
2009/4/2 Nutter, Benjamin nutt...@ccf.org:
x -
data.frame(matrix(c(rep(11,4),rep(12,3),rep(13,3),rep(0,3),1,rep(0,4),re
p(1,2)),ncol=2))
id.keep - unique(subset(x,X20)$X1)
x2 - subset(x,X1 %in% id.keep)
x2
Thanks, that helped! I didn't realize there was another version of the book.
On Wed, Apr 1, 2009 at 2:51 PM, Tobias Verbeke
tobias.verb...@openanalytics.be wrote:
Hi,
I'm trying to follow the ggplot introduction here:
http://had.co.nz/ggplot/ggplot-introduction.pdf
I've installed ggplot2
I tried the example in ggplot as well and rec'd the same error message.
ggpoint is not found in the ggplot2 library.
Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034
steve_fried...@nps.gov
Office
Hello,
I'm trying to use the function svyglm in the library survey.
I create a data survey object:
data_svy- svydesign(id=~PSU, strata=~sample_domain,
weights=~sample_weight, data=data, nest=TRUE)
and I try to use svyglm() with little success:
Thanks for your comment. Beside axis location, I have another
question for you.
If I wanted to change the matrix column names shown on the lattice
plot, which argument should be used to handle it? (I'd like to know
the overall lattice plot level scheme, for example, which argument
controls
I have a data frame that looks something like...
Column 1 is an experiment_id, Column 2 is the type of treatment (control,
full treatment, or partial treatment), and Column 3 is a value.
Experiment_id Treament_type Value
12345control3
12345full treatment4
12345full treatment
On 4/2/09, In Hee Park ip...@chemistry.ohio-state.edu wrote:
Thanks for your comment. Beside axis location, I have another
question for you.
If I wanted to change the matrix column names shown on the lattice
plot, which argument should be used to handle it? (I'd like to know
the
Can someone recommend a more sophisticated way to annotate heatmaps than the
ColSideColors argument of heatmap and heatmap.2? In particular, I would
like to be able to annotate columns with more than one piece of information,
like in Figure 1 of the article at
You need to put in calls to 'as.matrix'. It's
a bit tricky though -- what you want depends
on whether it is the first or second subscript
that has length 1.
as.matrix(id_y[,,i])
if the second dimension has length 1.
t(as.matrix(id_y[,,i]))
if the first dimension has length 1.
Patrick Burns
Would your blood still circulate if you take
off your heart?
That is, the answer is, No, that's where the
work is done in the function. If you want to
understand the computations that function is
doing, then you need to examine the C code
that it is calling.
Patrick Burns
I think this works in general, although it's
a little bit clunky:
id_y - array(1:10,dim=c(2,1,5))
id_yt - aperm(id_y,c(2,1,3))
m_id - array(dim=c(dim(id_y)[1],dim(id_y)[1],dim(id_y)[3]))
for (i in 1:dim(id_y)[3]){
m1 - array(id_y[,,i],dim=dim(id_y)[1:2])
m2 -
Hello Wesely,
The appropriate way to address irregular time series depends on what want to
use the estimates for. If your objective is to estimate the times that you
don't observe (interpolate) then a natural cubic spline is a good method to
provide such an estimate. If your objective is to
Ravi,
You are right. I did not specified the type of problem:
large problems with smooth functions and not large-scale discrete
problems. I am sorry for confusion. For non-smooth
functions, I can suggest subplex.
http://cran.r-project.org/web/packages/subplex/index.html
Florin
On Thu, 2
On 2/04/2009, at 11:27 PM, Uwe Ligges wrote:
snip
Not many of us are clairvoyants
snip
Hey! Wish I'd said that! :-)
cheers,
Rolf
P. S. Great minds think alike.
R.
I have a data.frame, data, with 30 factor variables. I would like to tabulate
the frequencies of each variable and output to a tex file using Sweave. Here is
my code chunk:
label=tab, echo=FALSE, results=tex=
library(xtable)
for(j in 1:30){
cap - paste(Frequency counts for Q,j,., sep=)
Hi List,
I am looking for an R advanced programming course in USA for April. Need to
attend the course before April 31st.
Regards - Steve
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Stacey Burrows schreef:
I have a data.frame, data, with 30 factor variables. I would like to tabulate
the frequencies of each variable and output to a tex file using Sweave. Here is
my code chunk:
label=tab, echo=FALSE, results=tex=
library(xtable)
for(j in 1:30){
cap - paste(Frequency
nboe...@uni-potsdam.de schreef:
Dear List-Members,
does anyone know a simple way to automatically install all R packages
on a unix system to the default library path? Not from inside R, it
should rather work as a shell script - job at startup.
Something like R cmd install -l pkgs ### where
I have created this data frame to help illustrate my problem.
id-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
x-rep((seq(1:5)),5)
y-c(0, 0.1, 0.5, 0.4, 0.2, 0, 0.1, 0.5, 0.4, 0.12, 0, 0.1, 0.5, 0.55, 0.2, 0,
0.1, 0.5, 0.3, 0.2, 0, 0.1, 0.6, 0.4, 0.1)
d1-cbind(id,x,y)
I would like to delete
I am plotting multiple graphs per window with multiple series on each graph.
When I try to set ylim I get the error below:
Error in ylim[[idx]] : subscript out of bounds
Am I incorrectly specifying my ylim list or is this a bug?
Here is a simple reproduction:
z - zoo(cbind(a = 1:10, b = 11:20,
Is this what you want:
d1[which(id != 4),]
id xy
[1,] 1 1 0.00
[2,] 1 2 0.10
[3,] 1 3 0.50
[4,] 1 4 0.40
[5,] 1 5 0.20
[6,] 2 1 0.00
[7,] 2 2 0.10
[8,] 2 3 0.50
[9,] 2 4 0.40
[10,] 2 5 0.12
[11,] 3 1 0.00
[12,] 3 2 0.10
[13,] 3 3 0.50
[14,] 3 4 0.55
[15,] 3 5
On Thu, Apr 2, 2009 at 3:37 PM, Rowe, Brian Lee Yung (Portfolio
Analytics) b_r...@ml.com wrote:
Is this what you want:
d1[which(id != 4),]
Or just
d1[id != 4, ]
Hadley
--
http://had.co.nz/
__
R-help@r-project.org mailing list
On Thu, 2009-04-02 at 14:37 +0200, nboe...@uni-potsdam.de wrote:
Dear List-Members,
does anyone know a simple way to automatically install all R packages
on a unix system to the default library path? Not from inside R, it
should rather work as a shell script - job at startup.
I have another question, if I now want to remove multiple id's e.g. id=1 or 4
is there a simple OR command I can use?
I tried d2-(d1[id != 1 | 4, ])
however this does not delete anything
PS d2-(d1[id != 4, ]) worked to remove id=4
Thanks
Gina
--- On Thu, 4/2/09, hadley wickham
On 3/04/2009, at 9:30 AM, gina patel wrote:
I have created this data frame to help illustrate my problem.
id-c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
x-rep((seq(1:5)),5)
y-c(0, 0.1, 0.5, 0.4, 0.2, 0, 0.1, 0.5, 0.4, 0.12, 0, 0.1, 0.5,
0.55, 0.2, 0, 0.1, 0.5, 0.3, 0.2, 0, 0.1, 0.6,
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of gina patel
Sent: Thursday, April 02, 2009 2:17 PM
To: Brian Lee Yung (Portfolio Analytics)Rowe; hadley wickham
Cc: R-help@r-project.org
Subject: Re: [R] Deleting rows based on
just for curiosity,
`%ni%` - Negate(`%in%`)
1 %ni% c(2,1)
[1] FALSE
d1[id %ni% c(1,4), ]
baptiste
On 2 Apr 2009, at 22:17, gina patel wrote:
I have another question, if I now want to remove multiple id's e.g.
id=1 or 4 is there a simple OR command I can use?
I tried d2-(d1[id != 1 |
This is probably simple, but I just can't see it...
I want to calculate the R^2s for a series of linear models where each
term is dropped in turn. I can get the
RSS from drop1(), and the r.squared from summary() for a given model,
but don't know how to use the
result of drop1() to get the
1 - 100 of 120 matches
Mail list logo