Re: [R] How to remove a package.

2010-11-28 Thread Stefan Grosse
Am 27.11.2010 09:48, schrieb Stephen Liu:

 I found the datasets of AER 

cool.

 detach(package:AER, unload = TRUE)

detach(package:AER) works for me.

 data()
 still found car there.

you mean cars ? This is not part of AER but in a base R installation.

 install.packages(EcDat)

 Where can I download/install EcDat?  TIA

It is case sensitive, try install.packages(Ecdat) it works for me...

Maybe you should try a little bit more...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Where to download R .xls sample files?

2010-11-28 Thread Stefan Grosse
On Sun, 28 Nov 2010 03:46:45 -0800 (PST) sati...@yahoo.com wrote:

SL Hi folks,
SL 
SL Which R packages containing sample .xls files?  TIA

Help yourself! Create your own! If you do not have Excel use
OpenOffice and save as xls!

Stefan

__
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, self-contained, reproducible code.


Re: [R] hi!! please help me!

2010-08-06 Thread Stefan Grosse
Am 06.08.2010 07:31, schrieb leepama:
 
 I made some anonymous function which performs some process in matlab code..
 But I want to perform it in R program...
 Is there any method???

You have already got answers to this. Please read the posting guide and
please stop using an unspecific subject a la help.

Stefan

__
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, self-contained, reproducible code.


Re: [R] Reshape? I need it?

2010-08-05 Thread Stefan Grosse
Am 05.08.2010 12:57, schrieb spigo:

 I don't know how to do it. I need to use reshape? how?
 thanks for your reply.

example(reshape)

Stefan

__
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, self-contained, reproducible code.


Re: [R] hi!! please help me

2010-07-31 Thread Stefan Grosse
On Fri, 30 Jul 2010 18:59:50 -0700 (PDT) leepama wrote:

L please give me answer!

Please do your homework yourself and 
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented,
minimal, self-contained, reproducible code.

Thanks
Stefan

__
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, self-contained, reproducible code.


Re: [R] Problem with par and bubble plot

2010-07-31 Thread Stefan Grosse
On Fri, 30 Jul 2010 13:30:35 -0700 (PDT) Filoche wrote:

F par(mfcol = c(3,3), mar = c(3,3,3,3), oma = c(0,0,0,0));
F 
F However, when plotting the bubble plot (gstats package), it plots
F the graph on a full page. I tried to plot something else with
F plot(x,y) and it works as intended. So I'm guessing the problem
F comes from the bubble plot itself.

Could you provide an example (code) so that we see what you mean? 

Thanks
Stefan

__
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, self-contained, reproducible code.


Re: [R] xlsx [path input]

2010-07-29 Thread Stefan Grosse
Am 29.07.2010 09:24, schrieb nero:

 But it doesn´t work. It only works, if i put the file into the
 xlsx-directory and set a dynamic path.
 a short example:
 
 http://r.789695.n4.nabble.com/file/n2306056/example_loading_xls.png 
 
 But the file is there...
 Am i missing something?

Lukas,
You have probably misspecified your path. Maybe it is better to use setwd:

setwd(c:/Users/[INSERT YOUR USERNAME]/Documents)
# our your path with desktop, make sure the file is there
# you could check with dir()
library(xlsx)
read.xlsx(test.xlsx,1)

  A B C
1 1 3 5
2 2 4 6


hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Reset R environment through R command

2010-07-29 Thread Stefan Grosse
Am Donnerstag, den 29.07.2010, 13:22 -0400 schrieb Ralf B:
 Is it possible to remove all variables in the current environment
 through a R command.
 
 Can one do that in R?

see
?rm

__
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, self-contained, reproducible code.


Re: [R] Column mapping

2010-07-28 Thread Stefan Grosse
Am 28.07.2010 07:36, schrieb jd6688:
 
 DF1
 name  OTHER   
 ABCO
 KKKO
 QQQO
 DDDO
 PPPO
 
 DF2
 name
 ABC
 KKK
 DDD
 
 If the names in df1 mapped the names in df2, then add the mapped name to df1
 as a separate column, for instance mappedColumn

What do you mean by mapped:
(1) how often a name in df1 is present or
(2) whether a name of DF1 is existing in DF2?

for (1) you could use DF1$existsinDF2-DF1$name%in%DF2$name
for (2) use either aggregate or table (type ?aggregate or ?table at
command prompt for help.

Stefan

__
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, self-contained, reproducible code.


Re: [R] Drop firms in unbalanced panel if not more than 5 observations in consecutive years for all variables

2010-07-22 Thread Stefan Grosse
Am 22.07.2010 11:18, schrieb Christian Schoder:

 I use the plm package and work with firm-level data in a panel. I would
 like to eliminate all firms that do not fulfill the requirement of
 having an observation in every variable used for at least x consecutive
 years. 

There are probably more ellegant solutions but you could do something like:

test-data.frame(year=c(2001,2001,2002,2001,2002,2003),id=c(1,2,2,3,3,3),x=runif(6))
test1-aggregate(test,by=list(id=test$id),FUN=c(length,mean))
test2-merge(test,test1[,c(id,x)],by.x=id,by.y=id)
names(test2)-c(names(test),count)
testsub-subset(test2,count2)
testsub

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] How to create sequence in month

2010-07-12 Thread Stefan Grosse
Am 12.07.2010 20:25, schrieb Bogaso Christofer:

 library(zoo)
 
 seq(as.yearmon(2010-01-01), as.yearmon(2010-03-01), by=1 month)
 

seq(as.Date(2010-01-01), as.Date(2010-03-01), by=1 month)


hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Change the frequency of a ts?

2010-07-03 Thread Stefan Grosse
Am 03.07.2010 13:55, schrieb Nicholas R Frazier:
 I'm trying to convert a column of a table into a ts object.  The data is
 monthly, so I want the ts frequency to be 12.
 
 I did this ...
 
 filings.ts = as.ts(Filings.100K, frequency=12)

try:

filings.ts - ts(Filings.100K, frequency=12)

example:
test-runif(312)
test.ts-ts(test, frequency=12)
tsp(test.ts)
plot(test.ts)

Oh I am late, Achim was faster...

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] Popularity of R, SAS, SPSS, Stata...

2010-06-20 Thread Stefan Grosse
Am 20.06.2010 15:31, schrieb Muenchen, Robert A (Bob):

 I've been fiddling around with various ways to estimate the popularity
 of R, SAS, SPSS, Stata, JMP, Minitab, Statistica, Systat, BMDP, S-PLUS,
 R-PLUS and Revolution R. It's not an easy task. You can see what I've
 come up with so far at http://r4stats.com/popularity . I'm sure people
 will have plenty of ideas on how to improve this, so please let me know
 what you think.

Your analysis is quite web-based. But to define what popular means is -
I believe - hard. R is open source and very broad in its different
applications so of course it generates much more e-mail and web traffic
because there are many different uses and users.

SPSS and Stata for example are closed and very specialized. You get
support also directly from the company and do not necessarily need a
mailing list. Does this mean that they are less popular? I'd say no.

So the question I would raise here is whether it is a fair comparison?
I know that is a sufficient statistics-subset like panel econometrics
Stata is by far leading and for time series econometrics Eviews, Gauss
in research. I would say that in the industry that I know plus in
econometrics research those programs are much more widespread or
popular. To measure their popularity I would say a
industry-and-education-wide-questionnaire should be used.

Plus it is not sufficient so I would also name Matlab, Gauss, Ox, Eviews
from the areas of my interest (econometrics) as popular proprietary
software.

I do not deny that R is becoming more popular, but I doubt whether
mailing lists and search requests are enough to prove this hypothesis.

My 2cents
Stefan

__
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, self-contained, reproducible code.


Re: [R] setting up zoo objects from a data frame

2010-06-08 Thread Stefan Grosse
Am 08.06.2010 16:52, schrieb Erin Hodgess:

 I would like to set up 3 time series; one for dog, one for cat, one
 for tree, such that each runs from 1/1/2000 to 1/3/2000, with 0 if
 there is no entry for the day.


   

Before using zoo or zooreg you should transform your data.frame as such
as that you have one column for each time series you want to have
afterwards. have a look at
?reshape
to do so.
little example:
test-data.frame(date=c(2001/01/01,2001/01/01,2001/01/02,2001/01/02),animal=c(dog,cat,dog,cat),data=1:4)
test.w-reshape(test,idvar=date,timevar=animal,direction=wide)
test.w

then you can do the zoo stuff, e.g. with
?zooreg
if you have a regular series.
It will transform automatically into a multiple time series.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] setting up zoo objects from a data frame: solved.

2010-06-08 Thread Stefan Grosse
Am 08.06.2010 17:04, schrieb Erin Hodgess:
 Here is a particular way to solve the problem:
   

If you solve your own problem then please reply to your own message
otherwise things get confused. How should one know what your problem was
without knowing your first e-mail - if you reply your own e-mail it gets
sorted as such otherwise not. However

 cat.zoo - zoo(table(dog.df$V1,dog.df$V2)[,1],order=test3)
 dog.zoo - zoo(table(dog.df$V1,dog.df$V2)[,1],order=test3)
 
that must be an error, a line to much  bur you heal it:
 dog.zoo - zoo(table(dog.df$V1,dog.df$V2)[,2],order=test3)
 tree.zoo - zoo(table(dog.df$V1,dog.df$V2)[,3],order=test3)


This is way to complicating, you should put the things into one object,
then you can e.g. plot them or analyse them.

You can do so after this more complicating code with:

all-merge(cat.zoo,dog.zoo,tree.zoo)

__
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, self-contained, reproducible code.


Re: [R] 2.11.0 on ubuntu (hardy) inadvertently installed

2010-05-28 Thread Stefan Grosse

Am 28.05.2010 17:25, schrieb Cedrick W. Johnson:
I now have a bunch of pkgs that aren't loading due to the fact that 
they were built before 2.10.0 -- There's some *ancient* packages, like 
(sma) that I was able to figure out what we were using, and pull out 
the relevant functions and just temporarily do a source('xxx.r') 
until I can re-build those things into new 2.11 packages.


Am I misssing something or what speaks against 
update.packages(checkBuilt=TRUE) ?


Stefan

__
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, self-contained, reproducible code.


Re: [R] median test

2010-05-28 Thread Stefan Grosse

 **Disclaimer: I have no idea what your data represents or how

(in)appropriate any of these tests may be**

R can do the tests you mentioned (and many more).

Wilcoxon test:
wilcox.test(x=group1, y=group2, paired=FALSE)
see ?wilcox.test
   


I am not sure whether it is still valid but in case of ties (equal 
values in the same group) like in your example data you should use the 
wilcox_test from the coin package. That one has a correction for ties.


But as Joshua told correctly as far as we do not know your data, Linda, 
it is hard to tell what might be approproate...


Stefan

__
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, self-contained, reproducible code.


Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Stefan Grosse

Am 19.05.2010 19:36, schrieb Sabatier, Jennifer F. (CDC/OID/NCHHSTP):

mydf-data.frame(matrix(rnorm(102), ncol=6)
   

you mean something like:
mydf[2:length(mydf[,1]),6]-NA

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Blanking out specific cells in a data frame

2010-05-19 Thread Stefan Grosse

Am 19.05.2010 20:08, schrieb Sabatier, Jennifer F. (CDC/OID/NCHHSTP):

I do know that you can't actually have unequal column lengths.  The
reality is I am creating a pretty table to export to EXCEL and it

Now that I have Stefan's solution, which turns all the un-needed info
into NAs I can use NAToUnkown() to blank them out completely.
   
when I import data to Excel NA's are imported as empty cell's. So you 
should not even need this function (which I do not know).


Stefan

__
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, self-contained, reproducible code.


Re: [R] how to make stacked plot?

2010-03-28 Thread Stefan Grosse
Am 28.03.2010 15:06, schrieb sdzhangping:
 Dear friends:
  I'm interested to make a stacked plot of cumulative incidence. 
 that's, the cuminc model is fitted [fit=cuminc(time, relapse)] and cumulative 
 incidence is in place. I'd like to stack the cuminc plots(line 1: relapse of 
 luekemia and line 2: treatment related mortality, for example) , then  the 
 constituent ratio of leukemia relapse and treatment related mortality is very 
 clear. Can you give me some directions?
  Yours Ping Zhang
   

Dear friend what makes you think that if you repost your question
again and again with the same text you will somehow receive an answer? I
believe the lack of an answer might be due to the lack of you showing
some effort on explaining what you did, what you want and what went
wrong. You already got an answer suggesting a package but you did not
respond.

There is a reason why every mail gets attached this text:

PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

If you want help, make it people easy.

Stefan.

__
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, self-contained, reproducible code.


Re: [R] survival data with competing risks and time-dependent covariates!

2010-03-28 Thread Stefan Grosse
Am 28.03.2010 15:08, schrieb sdzhangping:
   I??m very interested in the analysis of survival data of leukemic patients, 
 which involves competing risks and time-dependent covariates (infections or 
 relapse of leukemia after BMT). In my present work, I??d like to estimate the 
 risk of chemotherapy, BMT or gvhd on the onset and prognosis of invasive 
 fungal infections (IFI). In detail, the leukemic patients will receive 
 several cycles of chemotherapy and some of them will receive BMT. The 
 patients have three outcomes, that??s acquisition of IFI, death free from IFI 
 or IFI free survival. My puzzle is: 

 (1)Dose multi-state model fit this situation? 

 (2)I tried to fit coxphf model:  fit = coxphf(Surv(start,stop,ifi==1)~bmt, 
 data=ifi). The system always goes wrong when variable ??gvhd?? was fitted. 
 [coxphf(Surv(start,stop,ifi==1)~bmt+gvhd, data=ifi)]. Is there something 
 wrong with my data format?
 ted, minimal, self-contained, reproducible code.
   

You were posting exactly this question already on Friday twice and then
today twice. You have been pointed out that you might be using the wrong
function. So why should anyone answer you question when you do not show
any effort? You did not even ask back.

Stefan

__
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, self-contained, reproducible code.


Re: [R] producing a QQ plot.

2010-03-27 Thread Stefan Grosse
Am 27.03.2010 10:45, schrieb Philip Wong:

 mah=mahalanobis(data,apply(data,2,mean),var(data))
 
   
 mah=mahalanobis(data,apply(data,2,mean),var(no_fisher))
 
 qqplot(qchisq(ppoints(data),ncol(data),data)
   

As Joshua already pointed out: you are trying mathematical functions on
names. Your Data containes e.g. Village names.

You can exclude those with subset, generating a new data.frame.

If you want averages by categories e.g. by a village have a look at the
doby package, it has a function summaryby that is perfect for generating
aggregated data with multiple functions.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] large dataset

2010-03-27 Thread Stefan Grosse
Am 27.03.2010 10:19, schrieb n.via...@libero.it:
 What im facing when i try to import the file is that R generates more than 
 100.000 records and is very slow...
 thanks a lot!!!

   

Maybe your physical memory is too limited. R uses this and if your data
are to large Linux and windows start to use the swap file which slows
not only R but your computer down.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] wilcox.test construction in r

2009-11-01 Thread Stefan Grosse
On Sun, 1 Nov 2009 00:47:50 -0700 (PDT) jomni jom...@gmail.com wrote:

J So do I write the function as wilcox.test(original, test,
J alternative=l)? or wlcox.test(original, test, alternative = g)?
J or wilcox.test(test, original, alternative=g)?
J or wilcox.test(test, original, alternative=l)?

J How do I interpret the p-value given my criteria?
J Do I reject null when p-value less than 0.05? 
J or greater than 0.95?

The interpretation of the p depends on how you have tested the
hypothesis.

J Not a statistics major here so I'm really confused. 

You don't need to be that but please read the documentation and try the
given examples in the documentation.

If you would have typed example(wilcox.test) you would have seen for
example:

wlcx.t ## Two-sample test.
wlcx.t ## Hollander  Wolfe (1973), 69f.
wlcx.t ## Permeability constants of the human chorioamnion (a placental
wlcx.t ##  membrane) at term (x) and between 12 to 26 weeks gestational
wlcx.t ##  age (y).  The alternative of interest is greater
permeability 
wlcx.t ##  of the human chorioamnion for the term
pregnancy. 
wlcx.t x - c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91,
1.64, 0.73, 1.46)

wlcx.t y - c(1.15, 0.88, 0.90, 0.74, 1.21)

wlcx.t wilcox.test(x, y, alternative = g)# greater

Wilcoxon rank sum test

data:  x and y 
W = 35, p-value = 0.1272
alternative hypothesis: true location shift is greater than 0 


This I think makes it very easy to interprete. Here it is tested as the
text says whether x is greater than y. So if you want to test the
hypothesis that x is smaller than y so you do
wilcox.test(x,y,alternative=less)
then the lower your p is the higher is the probability that the samples
are different. hence p0.05 would match your confidence level. Now the
surprising news:
wilcox.test(y,x,alternative=greater)
would work as well! 

If you are in doubt create an x and an y where you are sure that x is
smaller than y.

One final remark: if you have ties (several identical values in one
sample) you should use wilcox_test of the coin package.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Is there any performance difference between subset() and list comprehension?

2009-09-26 Thread Stefan Grosse
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

__
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, self-contained, reproducible code.


Re: [R] data frame's column names not the same as in CSV

2009-09-26 Thread Stefan Grosse
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 X..LS01.Processor._TotalProcessor.Time.

Yous should maybe specify a unique separator for the columns which is
not existant in your colum name strings. Otherwise things might get
messed up.

It is not clear what the separator is in your example since you did not
show the numbers. Probably it is \ so you have to specify it as such.
?read.csv

Stefan

__
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, self-contained, reproducible code.


Re: [R] graphing help

2009-09-19 Thread Stefan Grosse
stephen sefick wrote:
 ?read.csv
 ?paste
 ?as.Date
 ?as.dataframe
 library(ggplot2)
 ?qplot
   

Also:
library(zoo)
?zoo

Stefan

__
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, self-contained, reproducible code.


Re: [R] write.table column names shift

2009-09-04 Thread Stefan Grosse
On Fri, 4 Sep 2009 01:07:49 -0700 (PDT) dennis11
detebe...@hotmail.com wrote:

D It added an index and shifted the column names by one, b is above a,
D and a is above the added index.

Try the option row.names=FALSE in write.table then no index is written.

Stefan

__
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, self-contained, reproducible code.


Re: [R] Help with sub-setting data.frame

2009-09-02 Thread Stefan Grosse
On Wed, 2 Sep 2009 17:12:18 +1200 Worik R wor...@gmail.com wrote:

WR I have a data frame, df that I want to extract some rows from

What you need is subset, see
?subset

Example:
df-data.frame(TTE=(0:10)/100,SOME=rnorm(11))
df
# subset with all columns
subset(df,TTE0.02)
# the same as:
df[df$TTE0.02,]

When you put the whole data.frame into the braces it does not make much
sense...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Rcmdr installalation under Viata gives a warning. Do I need to do anything?

2009-08-29 Thread Stefan Grosse
On Fri, 28 Aug 2009 21:39:41 -0400 John Sorkin
jsor...@grecc.umaryland.edu wrote:

JS Windows Vista
JS R 2.9.1
JS 
JS When trying to install Rcmdr I get the message shown below. What
JS does it mean, do I need to do anything?
JS 
JS The downloaded packages are in
JS C:\Users\John
JS Sorkin\AppData\Local\Temp\RtmpRCLbhe\downloaded_packages updating
JS HTML package descriptions Warning message:
JS In file.create(f.tg) :
JS   cannot create file
JS 'C:\PROGRA~1\R\R-29~1.1/doc/html/packages.html', reason 'Permission
JS denied'

Vista does not allow normal Users to write into the program folder. So
either you run R with admin rights (right click, then run as
administrator) or you circumvent this by installing R into your User
directory like into 

C:\Users\John Sorkin\R

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] script navigation in Vista

2009-08-29 Thread Stefan Grosse
On Sat, 29 Aug 2009 00:07:44 +0200 Wolfgang Polasek
wolfgang.pola...@gmail.com wrote:

WP Why is the option  last changed not working if I open a script
WP from R under Vista?

Because it remembers the changes only of a current session?

You should be a bit more descriptive: which editor? which R? What do
you mean with last changes etc.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread Stefan Grosse
On Sat, 29 Aug 2009 00:15:45 +0200 Wolfgang Polasek
wolfgang.pola...@gmail.com wrote:

WP  g=gretldata[1:2,]
WP  g
WPEmpfang   Versand  Transit  Inland AuslandSumS
WP 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341
WP 2 421473.1  306445.4 448801.2 1779402 14445.6 2970567
WP  dim(g)
WP [1] 2 6
WP  as.vector(g)
WPEmpfang   Versand  Transit  Inland AuslandSumS
WP 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341
WP 2 421473.1  306445.4 448801.2 1779402 14445.6 2970567
WP  gg=matrix(as.vector(g),nrow=1,byrow=TRUE)
WP  gg
WP  [,1]  [,2]  [,3]  [,4]  [,5]  [,6]
WP [1,] Numeric,2 Numeric,2 Numeric,2 Numeric,2 Numeric,2 Numeric,2
WP 
WP  Help please,the docu on thids is lousy!!!.

Depending on what you want which is not really clear again, you can use 
?reshape
or maybe also 
?stack

to reshape a data-frame which gretldata supposedly is.

Note that with your as.vector(g) you dont create a vector as:
dat1-data.frame(x=1:3, y=5:7)
v1-as.vector(dat1)
str(v1)
resp.
is.vector(v1)

clearly shows. So you were also not debugging your problem. And you
clearly did not have a look at the lousy documentation as this is
shown in the example in ?as.vector, so don't blame others!

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] Best R text editors?

2009-08-28 Thread Stefan Grosse
On Thu, 27 Aug 2009 12:43:41 -0700 Jonathan Greenberg
greenb...@ucdavis.edu wrote:

JG Quick informal poll: what is everyone's favorite text editor for
JG working with R?  I'd like to hear from people who are using editors
JG that have some level of direct R interface (e.g. Tinn-R,
JG Komodo+SciViews).  Thanks!

By my personal preference:

Windows 
1. Tinn-R
2. Notepad+ with npptor
3. JGR

Linux
1. Rkward
2. Emacs+ESS

(JGR useless here since it consumes 100% CPU at least with Fedora
Linux)

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] mann whitney u

2009-08-26 Thread Stefan Grosse
On Wed, 26 Aug 2009 12:18:53 +0100 Mcdonald, Grant
grant.mcdonal...@imperial.ac.uk wrote:

MG is the wilcox.test function equivalent to mann-whitney u?  Is there

Yes, the test is the same. It is also called wilcoxon mann whitney test
because the authors created the test independently.

MG a way to gain the U-value as apposed to the W-value in R?

What would be the purpose of this when you already have the p-value
given? As far as I know W and U are related. Look at
http://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U
and calculate the U1 U2 with the values of the example(wilcox.test). 

You have not described how your data look like. In case of tie's
(equal values) use wilcox_test of the coin package.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] how to apply a date format for data frame

2009-08-25 Thread Stefan Grosse
On Mon, 24 Aug 2009 23:42:11 -0700 (PDT) rajclinasia r...@clinasia.com
wrote:

R   labels starts  ends priorities
R 1  firsttask  37987 38049  1

It is easier with the other data.frame you had with:

   labels   starts ends
1  first task 1-Jan-04 3-Mar-04

and as.Date see
?as.Date

e.g.
as.Date(1-Jan-04,%d-%b-%y)
or for the whole column:

myframe$starts-as.Date(myframe$starts,%d-%b-%y)

now I hope you have learnt how to get the data into a list for the
gantt.chart...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] error in creating gantt chart.

2009-08-24 Thread Stefan Grosse
On Mon, 24 Aug 2009 05:22:17 -0700 (PDT) rajclinasia r...@clinasia.com
wrote:

R my.gantt.info-read.csv(C:/Documents and
R Settings/balakrishna/Desktop/one.csv).
R 
R and for create gantt chart i used below code.
R 
R  gantt.chart(my.gantt.info).

This again is why others have pointed you first to have a look at the
basics of R which can be read at:
http://cran.r-project.org/manuals.html
or more extensively in:
http://cran.r-project.org/other-docs.html

You start to program without knowing the very basics of R. Which is in
this case the data structures. my.gantt.info is a data frame. But with
the quotation marks you don't even give this as an object to
gantt.chart because with the quotation mark you have created a single
variable with a single value which is the characters between the
quotation marks that have nothing to do with the data - hence the atomic
stuff error message...

If you would have taken the real data you need the objects name which
is: gantt.chart(my.gantt.info) but this would not work either since
as I have already pointed out in an earlier mail lase week: you need a
list but not a data.frame. So please also consider the documentation
which you can do with
?gantt.chart
which directly points you towards this.

So what you need is a list. What that is you can see either in the
example of
example(gantt.chart)
what is a list? thats basics. Its an object type (there is data.frame,
matrix, list and so on)
?list
?as.list

Please learn the basics before asking such questions because you
save a lot of time for yourself and we do as well because we would not
need to answer such questions.

Stefan

__
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, self-contained, reproducible code.


Re: [R] gantt chart for dataset

2009-08-21 Thread Stefan Grosse
On Fri, 21 Aug 2009 06:19:53 -0700 (PDT) rajclinasia r...@clinasia.com
wrote:

R but my question is assume that above data stored in a excel file
R 'sample'. now i want gantt chart for the 'sample' dataset.

As a list is expected you need to convert your data frame into a list...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] what is the meaning of this error

2009-08-20 Thread Stefan Grosse
On Thu, 20 Aug 2009 12:54:33 + (GMT) Inchallah Yarab
inchallahya...@yahoo.fr wrote:

IY Error in Math.factor(c(2L, 1L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L,
IY 1L,  : log not meaningful for factors
IY In addition:Warning messages:
IY 
IY 1: In Ops.factor(LRUpBound, LRLowBound) : * not meaningful for
IY factors 2: In Ops.factor(TransitCoefStdDev, TransitCoefMean) :
IY   / not meaningful for factors

You are doing something with factors which is not possible. Since you
haven't given any code we cannot say much more. Provide a reproductive
example and maybe someone is able to help you more...

Stefan

__
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, self-contained, reproducible code.


Re: [R] Move legend text to the left legend box border

2009-08-19 Thread Stefan Grosse
On Wed, 19 Aug 2009 10:20:03 +0200 Sigbert Klinke
sigb...@wiwi.hu-berlin.de wrote:

SK in legend I'am coloring my text rather than using symbols or lines:
SK 
SK legend(bottomleft, txt, text.col=col, cex=0.7)
SK 
SK However, between the left legend box border and the text in txt is a
SK large empty space. Can I somehow move the text more to the left and
SK get also a smaller legend box?

try
legend(bottomleft, txt, text.col=col, cex=0.7,inset=-0.05)
and play around with the inset value.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Urgent Help

2009-08-19 Thread Stefan Grosse
On Wed, 19 Aug 2009 10:01:19 -0700 (PDT) Bin1aya bpasakh...@gmail.com
wrote:

B I have done copy paste of climate data from excel file to notepad
B and tried to upload. I do not have any knowledge about programming
B languages. Please help me.

There are better ways of importing data from Excel. Have a look at the
wiki:
http://wiki.r-project.org/rwiki/doku.php?id=tips:data-io:ms_windows

The first possible solution path should work...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Graphical Parameters

2009-08-18 Thread Stefan Grosse
On Mon, 17 Aug 2009 16:47:23 + mohsin ali ali.moh...@hotmail.com
wrote:

MA I also found this way much easier. But when to have figure on MS
MA Word, it is copied and then pasted on MS word then minor pixels
MA appears. How to get a clear figure?

Use another device. I personally use *.eps which can be obtained by:

postscript(myplot.eps,width=8,height=8,paper=special,horizontal=F)
plot(...)
dev.off()

note that width and height are different here to the png device where
the size is in points.

You can use this in word 200x but note that the plot will look ugly on
the screen. It will look great when you print it with a postscript
printer or when you produce a pdf out of that word file.

Look also here on how you could produce wmf/emf files:
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:export#exporting_r_graphs_-_cross-platform_solutions

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] postscript, options

2009-08-18 Thread Stefan Grosse
On Tue, 18 Aug 2009 13:52:58 +0100 e-letter inp...@gmail.com wrote:

EL On 18/08/2009, Rodrigo Aluizio r.alui...@gmail.com wrote:
EL  I'm not shure but I guess that you miss a  and putted it in the
EL  wrong place!
EL  Try this:
EL  postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE)
EL 
EL  Hope It helps.
EL 
EL Thank you, that did help a little, but the eps file was faulty and I
EL could not open in either imagemagick or gimp. I found it easier and
EL quicker to copy the graph into gimp, save in png and use imagemagick
EL to convert to eps format.

What an effort which also yields bad results regarding quality! EPS is
vector oriented and I doubt that PNG to EPS gives nice results besides
if you prefer it as such why not directly create a png using the png
device?

What do you mean with faulty? I suspect it was to large because you
forgot the paper=special option. Otherwise it creates an A4 plot.

postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE,paper=special)

see
?grDevices::postscript

for the options.

Stefan

__
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, self-contained, reproducible code.


Re: [R] postscript, options

2009-08-18 Thread Stefan Grosse
On Tue, 18 Aug 2009 16:08:36 +0100 e-letter inp...@gmail.com wrote:

EL  
postscript(/pathto/filename.eps,horizontal=FALSE,onefile=FALSE,paper=special)
EL 
EL This command created a small blank eps file.

Its hard to say why without any example code.

Does
postscript(/pathto/filename.eps,width=8,height=8,horizontal=FALSE,onefile=FALSE,paper=special)
hist(rnorm(100))
dev.off()
work?

(I have added width and height since it got an error without.)

Have you maybe forgotten the dev.off()? 

If not and the upper code does not produce something that can be seen
it cold be that your plot command is wrong. 

Stefan

__
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, self-contained, reproducible code.


Re: [R] Graphical Parameters

2009-08-17 Thread Stefan Grosse
On Mon, 17 Aug 2009 05:54:18 + mohsin ali ali.moh...@hotmail.com
wrote:

MA How can I change plot size, figure size and device size? The
MA examples availble for par() function are not very helpful. Would
MA you please give a very simple example?

It would be easier if you would tell what exactly you want to do. I
believe the easiest way is not par but the options of the device. For
example:

png(myplot.png,width=400,height=400)
plot(...)
dev.off()

vs.:

png(myplot.png,width=800,height=400)
plot(...)
dev.off()

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Newbie question re stddev, quantmod and performanceanalytics

2009-08-17 Thread Stefan Grosse
On Sun, 16 Aug 2009 22:43:14 -0700 (PDT) afx111 afx...@yahoo.com
wrote:

A getSymbols(YHOO)
A retYHOO - Return.calculate(Cl(YHOO))
A  sd(retYHOO)
A 
A YHOO.Close 
A NA 
A 
A but i received an NAcan any assist? tks!

You receive NA because getSymbols went wrong, so YHOO was empty. Try
getSymbols('YHOO',src='yahoo',return.class='ts')

Btw. there is a r-finance mailing list which is a good place for such
questions. 

Hth 
Stefan

__
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, self-contained, reproducible code.


Re: [R] forcasting or predictive analysis

2009-08-13 Thread Stefan Grosse
On Thu, 13 Aug 2009 00:26:46 -0700 (PDT) rajclinasia r...@clinasia.com
wrote:

R My question is I want to do forcasting or predictive analysis on
R some data and also genearte any graph based on the analysis. is it
R possible in R, if possible please give me the code it is very
R helpful for me.

Since we are neither clairvoyants nor mind readers we unfortunately
will not be of any help of you unless you provide a little bit more
information or a specific problem/case, almost preferably with some code
that makes us easy to follow you and shows us that you at least took
some effort.

Please read the posting guide!
http://www.R-project.org/posting-guide.html

Stefan

__
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, self-contained, reproducible code.


Re: [R] ncdf

2009-08-13 Thread Stefan Grosse
On Thu, 13 Aug 2009 11:29:40 +0200 Silke Troemel
silke.troe...@uni-bonn.de wrote:


ST 
/usr/lib64/gcc/x86_64-suse-linux/4.0.2/../../../../x86_64-suse-linux/bin/ld: 
ST /usr/local/lib64/libnetcdf.a(attr.o): relocation R_X86_64_32S
ST against `a local symbol' can not be used when making a shared
ST object; recompile with -fPIC

Have you tried that? (recompiling with -fPIC: see the R-admin.pdf how
to change the flags)

Stefan

__
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, self-contained, reproducible code.


Re: [R] .... running JGR on a Linux/SuSE system

2009-08-03 Thread Stefan Grosse
Martin Maechler wrote:
 But there are quite a few others (I do not really know from
 personal experience), see, e.g.,
 all the projects (listed on the left hand side) of
 http://www.r-project.org/GUI

   

I personally can recommend rkward which is now available on many
platforms and which is probably a little easier to use than the mighty
emacs+ESS.

rkward:
http://sourceforge.net/apps/mediawiki/rkward/index.php?title=Main_Page

Regards
Stefan

__
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, self-contained, reproducible code.


Re: [R] books on Time series

2009-06-16 Thread Stefan Grosse
On Sun, 14 Jun 2009 22:30:49 -0300 Antonio Olinto
aolint...@bignet.com.br wrote:

AO I would like to receive any suggestion of which is most appropriate
AO for a non-statistician (I am a biologist). Reading only the index I
AO could not evaluate it.
AO reproducible code.

I am an economist but maybe also as a biologist you will find the
following useful:

As introduction:
* Venables/Ripley, Modern Applied Statistics with S. Fourth Edition.
  (the bible, a must have anyway)
As an introduction also dealing with time series:
* Kleiber/Zeileis, Applied Econometrics with R (with application in
  economics, but enough for basics in R and time series)
As an advanced book on time series with R/S examples:
* Tsay, Analysis of Financial Time series (there is also a package for
  R that has examples on some chapters)

Have a look at: http://www.r-project.org/doc/bib/R-books.html you find
there most books dealing with R and also discount information. 

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] A MS-VAR Introduction

2009-06-15 Thread Stefan Grosse
On Mon, 15 Jun 2009 14:21:29 -0300 Henrique henrique.coe...@gmail.com
wrote:

H I'm starting to learn the MS-VAR methodology and I would like to know
H what I need to download (e.g. packages) to make MS-VAR estimations
H using R.

Please, mailing to every mailing list you find does not increase the
probability to get help since they belong to the same list. I got your
mail 3 times...

If you use search you will find that there is a package called MSVAR
which is in early development stage. So probably you will need to do
more programming yourselves, or look for other programs.

Stefan

__
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, self-contained, reproducible code.


Re: [R] Black-Litterman model

2009-06-09 Thread Stefan Grosse
JannaB schrieb:
 Anyone know where I can obtain an R implementation of the Black-
 Litterman portfolio model?

   
There is the BLCOP package.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] ADF test

2009-06-05 Thread Stefan Grosse
koyel chakrabartti wrote:
 While doing the ADF test in R using the following command I am getting the
 error and the result..
 x.ct=ur.df(rev$REVENUE,start=1,end=length(rev$REVENUE),frequency=1)
 Error in ur.df(rev$REVENUE, start = 1, end = length(rev$REVENUE), frequency
 = 1) :
   unused argument(s) (start = 1, end = 4, frequency = 1)
   

The error and code above does not fit to the code below. The arguments
start, end and frequency belong to the ts command which you probably
forgot in the code above.

Btw. it seems you have a time series of only 4 dates, so either there is
another mistake or you don't know what you do...


 t=1:length(x)
 plot(t,x)
 trend = lm(x~t)
 abline(lm(x~t))
 summary(trend)
 library(urca)
 x = ts(x, start=1, end = length(x), frequency=1)
 x.ct = ur.df(x,lags=0,type='trend')
 plot(x.ct)
 library(tseries)
 adf.test(x,alternative = explosive , k=0)
 summary(ur.df(x,lags=0,type='trend')


__
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, self-contained, reproducible code.


Re: [R] Import ARIMA coefficients

2009-06-04 Thread Stefan Grosse
On Thu, 4 Jun 2009 15:21:52 +0100 Daniel Mail d20...@live.com.pt
wrote:

DM I need to know how to import ARIMA coefficients. I already
DM determined the coefficients of the model with other software, but
DM now i need to do the forecast in R.

So why then don't you fit the model then in R Would be much more
convenient...

Stefan

__
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, self-contained, reproducible code.


Re: [R] can you help me please :)

2009-05-28 Thread Stefan Grosse
On Thu, 28 May 2009 15:47:18 +0300 NOUF AL NUMAIR
noufalnum...@hotmail.com wrote:

NAN  barplot(zz,width = 4,names.arg= xx,axes = TRUE, axisnames = TRUE,
NAN main=title,xlab=xlab,ylab=ylab,ylim=c(0,1175),xlim=c(0,226),col =
NAN c(for (i in zz){if i70 col= lightblue else col= mistyrose))
NAN 
NAN 
NAN i tried to get red of zero then plot it 

? I have no idea what this means...

NAN i want to color different result with different colors ?
NAN 
NAN any body can help plaaaeee

If you want help try to be more clear about what you want. It is hard
with your mail because there is so much what does not belong to your
current problem, one has to scroll over plenty of numbers and still I am
not sure whether I understood what you want.

Hence you want your bar color conditional on the value or the height,
it is helpful to create a vector beforehand.(for control purposes)

y-c(1175,  483,  240,  170,   99,   79,   76,   45,   38,   35,
21,   16,   14,   19,   16) 
x-c( 1,   2,   3,   4,   5,   6,   7,
8,   9,  10,  11,  12,  13,  14,  15) 

d1-data.frame(x=x,y=y)

Color-ifelse(d1$y70,blue,red)

barplot(as.matrix(d1$y),names.arg=d1$x,col=Color,beside=T)

as an example.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Factor level with no cases shows up in a plot

2009-05-27 Thread Stefan Grosse
Arthur Burke wrote:
  
 ...  I get the four lines that I expected but the legend includes the
 Group level cohort 4 .
  
 How can I get rid of cohort 4 in Group?
   

This link might be of interest for you:
http://wiki.r-project.org/rwiki/doku.php?id=tips:data-manip:drop_unused_levels

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] How R connects to the internet

2009-05-26 Thread Stefan Grosse
On Tue, 26 May 2009 12:52:16 +0530 Menezes, Ian
ian_mene...@syntelinc.com wrote:

MI I'm unable to get R to connect to the internet at work and I'm
MI guessing its because of our proxy server. Is there any way to
MI change how R connects to the internet? How do I provide it the
MI proxy address?

You haven't told which operating system you use. For windows there is
the option --internet2 for the Rgui.exe that uses the proxy settings of
the explorer. 

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Creating multiple graphs based on one variable

2009-05-26 Thread Stefan Grosse
On Tue, 26 May 2009 02:34:55 -0700 (PDT) Tim Clark
mudiver1...@yahoo.com wrote:

TC I would like separate plots for Tony, Mike, and Vicky.  What is the
TC best way to do this?  

use the lattice package:

library(lattice)
xyplot(y~x|Name,data=dat)

Mr. Sarkar (the author of the package) has written an excellent book on
his package I recommend it.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] counting occurrence of text in a dataframe

2009-05-23 Thread Stefan Grosse
On Sat, 23 May 2009 12:44:19 + (GMT) Iain Gallagher
iaingallag...@btopenworld.com wrote:

IG I am hoping for some help with a relatively simple problem. I have
IG a data frame arranged as below. I want to be able to count the
IG occurrence of each gene (eg let-7e) by Experiment. In other words
IG how many times does a given gene crop up in the dataframe. 

IG Tanaka Mitchell   Wang   Hunter Chen   Chim   
IG miR-191*   let-7e let-7b miR-126let-7a let-7g 
IG miR-198let-7f let-7c miR-146a   let-7b let-7i 

Hi Iain,

I would rearrange the dataframe to the following structure:

Gene   Experiment
let-7e Mitchell
...

then you can use ftable.

probably you could use reshape for your data. I could not figure out
how to do it without a time var, so here a quick and dirty way:

exp.wide-data.frame(Tim=c(a,a,b),Struppi=c(b,b,b),More=c(a,b,b))

nam-names(exp.wide)
ctL-length(exp.wide[1,])
ctW-length(exp.wide[,1])

exp.long-cbind(as.character(exp.wide[,1]),rep(nam[1],ctW))

for(i in 2:ctL){
   tmp-cbind(as.character(exp.wide[,i]),nam[i])
   exp.long-rbind(exp.long,tmp)
}

exp.long-as.data.frame(exp.long)
names(exp.long)-c(gene,exp)
ftable(exp.long)


hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] fitting distribution

2009-05-19 Thread Stefan Grosse
On Tue, 19 May 2009 14:04:19 +1000 Kon Knafelman konk2...@hotmail.com
wrote:

KK i have the sample variances for 1000 samples, and i want to fit it
KK to a chi-squared distribution.

KK can someone please help me fit this to a chi-squared distribution
KK with n degrees of freedom. Thanks a lot 

Dear Kon, 

1. please only mail to r-h...@stat.math.ethz.ch OR to
r-help@r-project.org as we receive every mail of you twice if
you mail to both. 

2. please read the posting guide. A link is attached
every e-mail:

PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented,
minimal, self-contained, reproducible code.

especially the section do your homework. It means use search on
r-project.org and rseek.org and have a look at the documentation.

Don't expect others to do your homework. And show some effort!

Using search would have pointed you to a guide of Ricci on fitting
distributions for example:
http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf

If you programmed something and it does not work as expected- THEN mail
to the list. 

hth
Stefan

PS You don't know Debbie Zhang by coincidence?...

__
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, self-contained, reproducible code.


Re: [R] (no subject)

2009-05-18 Thread Stefan Grosse
On Mon, 18 May 2009 17:33:51 +1030 Debbie Zhang
debbie0...@hotmail.com wrote:

DZ Based on a set of binomial sample data, how would you utilize the
DZ nlm function in R to estimate the true proportion of the
DZ population?

Dear Debbie,

This is a list that is mainly intended helping people if they have a
problem writing code. If you expect useful answers you should:

- follow the posting guide:
  PLEASE do read the posting guide
  http://www.R-project.org/posting-guide.html and provide commented,
  minimal, self-contained, reproducible code.

- especially try NOT to give the impression that you are doing homeworks
  and expect others to do the work for you (thus show at least some
  effort: what you have searched/found and what you programmed to solve
  the problem see homework before posting in the posting guide)

- Use the subject field of the e-mail to give a pointer of the problem:
  it increases the probability that someone who has knowledge actually
  reads your mail

Thanks
Stefan

__
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, self-contained, reproducible code.


Re: [R] Simple plotting errors

2009-05-18 Thread Stefan Grosse
On Mon, 18 May 2009 11:17:50 + Steve Murray
smurray...@hotmail.com wrote:

SM plot(FeketeJAN[1,2], FeketeFEB[1,2], FeketeMAR[1,2], *through to
SM December* type=l)

SM What is it that I'm doing wrong?!

try plot( c(FeketeJAN[1,2], FeketeFEB[1,2], ...)),type=l)

however it is better to create one big data frame like:

Location Mean Sum Month
Amazon   144  ... JAN

all you need is cbind.


hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Simulation

2009-05-15 Thread Stefan Grosse
On Fri, 15 May 2009 19:17:37 +1000 Kon Knafelman konk2...@hotmail.com
wrote:

KK I hve the same problem as the initial one, except i need 1000
KK samples of size 15, and my distribution is Exp(1). I've adjusted
KK some of the loop formulas for my n=15, but im unsure how to proceed
KK in the quickest way. 
KK Can someone please help?

What exactly do you want? Please be more specific about what you did
and what does not work. 

Stefan

__
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, self-contained, reproducible code.


Re: [R] Problems intalling on Suse 10.3 x86_64 OS

2009-05-15 Thread Stefan Grosse
On Thu, 14 May 2009 12:32:18 -0700 (PDT) PDXRugger j_r...@hotmail.com
wrote:

P 
P Alright, i am unsure of the posting rules for these types of
P questions but i will be as help ful as possible.  My windows based
P system cant handle a model i am running so i am trying to install R

Why? To many data?

P on our Linux based machine but i have encountered the following and
P i dont know linux much but my intuition is that i need to install
P some other files first.  Any thoughts?

P There are no installable providers of libtcl8.5.so()(64bit) for

It seems that you need a more recent tcl/tk Installation. Suse 10.3 is
a little bit old. Maybe 8.5 was not included. So you could see if you
find a newer version. Sometimes you can take the repository of the more
recent opensuse version and install newer versions from there. 

Unfortunately yast is very sensitive on dependencies. From my
experience the smart package manager is faster and less touchy than
Yast/zypper on the older Opensuse systems.

Alternatively you could upgrade you distro, install another one or run
a live-System. You could run a live Usb-Ubuntu to run your programs.
Depends on what time you have and how flexible your admins are...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Additional points to scatter plot show up at wrong place

2009-05-15 Thread Stefan Grosse
On Fri, 15 May 2009 15:43:33 +0200 Peter Menzel
pmen...@googlemail.com wrote:

PM scatterplot(data[,2] ~ data[,1],
PM 
data=data,smooth=F,reg.line=F,xlim=c(0.5,1),ylim=c(0.5,1),ylab=ML,xlab=Freq,cex.lab=1.9,cex.axis=1.8)

Side remark: you don't need do data[,2] if you have specified data=data
as you did. So var1~var2 would be enough.

PM after that, I draw one line with abline(0,1,col=gray20) which
PM works perfectly fine.

abline for me also does not work in the expected way, see below.
 
PM now I want to add, say the point (0.6,0.6) to the plot with
PM points(c(0.6),c(0.6)).

the c() is not necessary points(0.6,0.6) is enough.

PM The point is plotted, but not exactly at the proper coordinates, but
PM at something like (0.55,0.55).

That seems to be a bug. The axis seems not to be drawn exactly.
to replicate see:
library(car)
data-data.frame(x1=rnorm(100),x2=rnorm(100,.25))
scatterplot(x1~x2,data=data,ylab=ML,xlab=Freq)
points(0.5,0.5,col=blue)
abline(h=0.5,lty=2) # check whether point is at the correct location.
abline(v=0.5,lty=2)
abline(h=1) # line is not at 1 at the y-axis!

So maybe one can contact the package owner?

Btw. creating such a plot by yourself is easy, have a look
at ?layout ?axis 

Stefan

__
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, self-contained, reproducible code.


Re: [R] Simulation

2009-05-14 Thread Stefan Grosse
Debbie Zhang schrieb:
 Now, I am trying to obtain the sample variance (S^2) of the 1000 samples that 
 I have generated before.

 I am wondering what command I should use in order to get the sample variance 
 for all the 1000 samples.

  

 What I am capable of doing now is just typing in

 var(z[[1]])

 var(z[[2]]). 

  

   
Common please use the package brain 2.0. What is the difference between
this and what you already had here (???):
 for(i in 1:n){
 x[[i]]=rnorm(i,0,1)
 }
 

hint: its only a small change.

Please do some introductionary exercises. You find plenty of material here:
http://cran.r-project.org/manuals.html
and here:
http://cran.r-project.org/other-docs.html

Stefan

__
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, self-contained, reproducible code.


Re: [R] JGR

2009-05-06 Thread Stefan Grosse
On Tue, 05 May 2009 15:12:00 +0200 r...@quantide.com r...@quantide.com
wrote:

RC The point is that one Cpu stays at 100% for all time JGR is up.
RC Any ideas?
RC Andrea

I believe it is a bug with JGR. Unfortunately it is existing for quite
some time now. (I am using Fedora Linux since years and try it from
time to time.)

Just try another gui like emacs with ess or rkward.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Producing customized tickmarks when producing a graph using curve

2009-04-28 Thread Stefan Grosse
Dimitri Liakhovitski schrieb:
 I was wondering, if it's possible to turn off the default tick marks
 and introduce those tick marks in specific locations.
   
use search. rseek for example. use help. ?axis for example leads you to
an example how to do so... (works also for curve)
and please try to show at least that you had some effort when you post
something.

Stefan

__
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, self-contained, reproducible code.


Re: [R] Scatterplot of two groups side-by-side?

2009-04-26 Thread Stefan Grosse
On Sun, 26 Apr 2009 09:29:39 + (GMT) nonu...@yahoo.de
nonu...@yahoo.de wrote:

ND I'm realy new to R, so I hope you can help me, as I didn't find any
ND solution in the common books.  

Have a look at the online resources at:
http://cran.r-project.org/other-docs.html
There is also stuff on graphics.

Furthermore the lattice package and book are highly recommended as well.

ND By the way: It's realy necessary to plott the data as scatters and
ND not as boxplots. With the command plot, I can not plot the data
ND by groups (I tried it with the commands subset and groups, but
ND obviously, there is no way to do so).  

There is always a way. I just don't understand why it is necessary to
plot this as a scatterplot. 

Look your problem is that your data have integer values. So it is
very clear that they will be overplotted and that the reader has no
idea at which point are many observations even when you split the data
on the x axis into groups. Or even if you make a per group plot as
Baptiste suggested and as would be possible with lattice as well.

I could offer an easy solution. You can split into groups manually by
changing your x values slightly groupwise. But still you dont see how
many data are on each point. You could add some noise with the jitter
function (see ?jitter ), so that one sees that there are many
observation at one point. However it introduces the appearence that you
dont deal with categorical data, which might not be intended...

daten-data.frame(y=sample(c(1,2,3),24,replace=T),
x=rep(c(1,2),each=12),group=rep(c(1,2)))

daten


# plot with overplotting, no information gain
plot(daten$x,daten$y)

# plot with jitter

# prepare data
daten$x2-ifelse(daten$group==1,daten$x-0.02,daten$x+0.02)

plot(c(0,2),c(0,4),type=n) # empty plot you could use real data

# plot points, see ?jitter for options
points(jitter(y)~x2,data=subset(daten,group==1),col=blue,pch=1)
points(jitter(y)~x2,data=subset(daten,group==2),col=red,pch=2)

# regression lines added:
abline(lm(y~x,data=subset(daten,group==1)),col=blue)
abline(lm(y~x,data=subset(daten,group==2)),col=red)

legend(topleft,c(group 1,group 2,
regression group 1,regression group 2) ,lty=c(0,0,1,1),
pch=c(1,2,NA,NA), col=rep(c(blue,red),2),bty=n)

But I believe there are better solutions. You should think about a
different plot like a ballon plot or so. 

Then I doubt whether a linear regression is really good here since we
deal with categorical data...

ND I'm greatful for every (simple) solution  

Sorry if it is not simple. You see R has the advantage that it is
highly configurable. But you still need to know the message...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Memory issues in R

2009-04-26 Thread Stefan Grosse
On Sun, 26 Apr 2009 09:20:12 -0600 Neotropical bat risk assessments
neotropical.b...@gmail.com wrote:

NBRA 
NBRAHow do people deal with R and memory issues?
NBRAI have tried using gc() to see how much memory is used at each
NBRA step. Scanned Crawley R-Book and all other R books I have
NBRA available and the FAQ on-line but no help really found.
NBRARunning WinXP Pro (32 bit) with 4 GB RAM.

There is a limit on windows, read the FAQ:
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021

So either you use a (64bit) Linux with enough memory or you use
packages or a SQL solution that is able to deal with huge datasets.
(biglm for example)

Stefan

__
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, self-contained, reproducible code.


Re: [R] Tinn-R and latex

2009-04-25 Thread Stefan Grosse
On Fri, 24 Apr 2009 22:35:05 -0700 (PDT) Roslina Zakaria
zrosl...@yahoo.com wrote:

RZ I installed new version of R and Tinn-R and I just wonder why all
RZ my latex document change to Tinn-R symbol?

Because Tinn-R also is able to edit tex documents and you probably
missed the default document settings during the installation?

Stefan

__
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, self-contained, reproducible code.


[R] Fw: Problems with old version of R

2009-04-23 Thread Stefan Grosse
On Wed, 22 Apr 2009 11:18:17 -0400 Dimitri Liakhovitski
ld7...@gmail.com wrote:

DL You don't have to uninstall the old version. Just install the new
DL version. What I do then - I manually copy (in Windows Explorer) all
DL the packages from the folder library that is under your old R
DL version into the folder library under the new R version. And then I
DL open the new R version and run update packages.

Its even simpler than this. [On windows] You can install the new R over
the old in the very same folder. Then run update.packages(checkBuilt=T)
and you have upgraded the whole R suite.

No need to manually copy anything.

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] Problems with old version of R

2009-04-23 Thread Stefan Grosse
On Wed, 22 Apr 2009 11:18:17 -0400 Dimitri Liakhovitski
ld7...@gmail.com wrote:

DL You don't have to uninstall the old version. Just install the new
DL version. What I do then - I manually copy (in Windows Explorer) all
DL the packages from the folder library that is under your old R
DL version into the folder library under the new R version. And then I
DL open the new R version and run update packages.

Its even simpler than this. [On windows] You can install the new R over
the old in the very same folder. Then run update.packages(checkBuilt=T)
and you have upgraded the whole R suite.

No need to manually copy anything.

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] Running Scripting on Linux Machine

2009-04-23 Thread Stefan Grosse
On Thu, 23 Apr 2009 09:31:54 +0100 Bronagh Grimes
bronagh.gri...@distinct.ie wrote:

BG -  But the only way I can run this script is to call the
BG whole script using the source() function.
BG 
BG -  Does anyone know how I can implement a script that I can
BG run as in the Windows version, whereby I can run one line at a time
BG if I wish for testing purposes?

What a long and complicating mail for the simple question: is there a
gui on Linux?

However besides Emacs/ESS there is rkward which is probably easier to
use for a closer to Windows gui feeling (it is much better of course).

Since you have not given specifics about your Linux: on Fedora as well
as on Ubuntu(s) it is in the standard repositories.

hth
Stefan

PS There is also JGR as a cross-platform Java Gui. However on Fedora it
is unusable since it consumes far to much CPU.

__
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, self-contained, reproducible code.


Re: [R] to extract data

2009-04-20 Thread Stefan Grosse
On Sun, 19 Apr 2009 23:59:43 -0700 (PDT) Roslina Zakaria
zrosl...@yahoo.com wrote:

RZ I have a set of data from 1958-2009, how do I extract the data from
RZ 1927 and 2007? 
RZ beechworth.dt
RZ  Year Month  Rain

how about:

beech.cut-subset(beechworth.dt,(Year1926Year2008))

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] R graph into MS Word: which format to use?

2009-04-20 Thread Stefan Grosse
On Mon, 20 Apr 2009 03:01:42 -0700 (PDT) jjh21 jjhar...@gmail.com
wrote:

J The journal I am publishing in requires MS Word files. What is my
J best option for getting a high quality image of a graph done in R
J into Word? JPEG? Postscript?

I use png or eps. The latter has the better output but in old
Word versions you don't get WYSIWIG - only pdf conversion or printing
with a postscript printer reveals the true figure. But maybe I just
have missed an option.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] what is R best for; what should one learn in addition to R

2009-04-20 Thread Stefan Grosse
On Mon, 20 Apr 2009 11:49:29 -0400 Juliet Hannah
juliet.han...@gmail.com wrote:

JH I've been working with R for a couple of years, and I've
JH been able to get most of the things done that I needed (sometimes in
JH a roundabout way). A few experienced statisticians told me that
JH R is best for interactive data analysis, but for large-scale
JH computations, one needs something else.

Depends on what is meant by large-scale computations and you yourself
intend to do. I know of people doing optimization stuff which needs a
lot of computational power. They use Matlab since it is easy for them
to use multiple processors (+multiple pc's). R at the moment only uses
one processor and also does not yet (there is a project working on it)
something like just in time compilation which appears to be in Matlab. 

However R is for free and flexible so there are ways to deal with some
analysis that need more computational power. 

my 2c
Stefan

__
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, self-contained, reproducible code.


Re: [R] importing spreadsheet data - linera regression - panel data

2009-04-19 Thread Stefan Grosse
Cecilia Carmo schrieb:
 The objective of my work is to do linear regressions with the
 variables in the files or with other variables that I can obtain from
 those by doing some mathematical operations.  I’ve already tried to
 import this information to an array in R, but I’ve seen that the
 linear regressions functions need the data into a dataframe. So I’m
 asking: How to import this information to a dataframe in R, in a
 manner that I can easily do the mathematical operations between the
 variables and then use it to do the regressions?


Your question is probably misspecified. Or the pure import is not your
only problem. For the import of the txt you should easily find read.csv
your candidate. (please use search on the r-project.org page which leads
easily to this solution.)
firms-read.csv(myfilename.txt,header=T,sep=\t)

see
?read.csv for help.

Then your data are maybe in the wrong order. Instead of
Firm Year1 Year2
A100   101

it is sometimes better to

Firm Year Rev
A1100
A1101

the transformation is called reshape. See
?reshape
and
example(reshape)

Then you can do your mathematical operations.

See eg.
?lm
example(lm)

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well

2009-04-18 Thread Stefan Grosse
LI Qi schrieb:
 I found that Tinn-R (Version 2.2.0.2) dose not support R 2.9.0 very well. 
 Maybe, somebody who have solved this problem can help me.

   

What do you mean with doeas not support very well. I have no problems
with Vista + R 2.9.0 + Tinn-R 2.2.0.2

Try to start Rterm instead of Rgui. This opens the R terminal inside
Tinn-R, causes less problems and has the advantage of a little syntac
highlightning in the terminal. However you have to get used to the error
messages being sent to another window.

Have a look at the Tinn-R sourceforge page. There is an rsite of jose:
http://sourceforge.net/forum/forum.php?forum_id=886959
manipulate it to for your convienience. there is also a line that
resolves the .trPath problem which is maybe what you stumbled upon.

Cheers
Stefan


PS Notepad++ installs for me but the installation on npptor does not
work for me. Syntax highlightning does not work and commands are not
passed to Rgui neither in sdi mode nor in normal mode.

__
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, self-contained, reproducible code.


Re: [R] Fedora 10 KDE plasma font rendering issue

2009-04-15 Thread Stefan Grosse
On Tue, 31 Mar 2009 13:02:23 -0700 (PDT) dfermin dfer...@umich.edu
wrote:

D Has anyone else got this problem? If so do you have a work around or
D a solution?
D 
D I'm using R version 2.8.1 installed from the Fedora 10 repositories
D if that helps.

I have Fedora 10 and R 2.8.1 as well and have no problems. On KDE I see
the text in the histogram plot. 

R has been updated quite some times recently. Have you ensured you have
the latest package installed via yum?

Stefan

__
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, self-contained, reproducible code.


Re: [R] TinnR Philips Webcam

2009-03-02 Thread Stefan Grosse
On Mon,  2 Mar 2009 12:48:16 -0500 (EST) waterho...@vims.edu wrote:

WE Now when I start up TinnR to use with R, it opens the webcam.  If I
WE manually start up R, Tinn R will no longer synch with it. 

More detail would help to answer those questions properly. Which Tinn-R
are you using, and how are you starting an R session?

The current Tinn-R (2.2.0.2) has 2 different possibilities to do that.

Older Tinn-R programs (below 2) had the problem to start R it searched
something that is named console. Which caused very different programs
to start (it was my wireless console). But this problem was solved with
2.x since I dont know your version: use latest TinnR.

hth Stefan

__
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, self-contained, reproducible code.


Re: [R] Problems installing/updating packages in Linux

2009-02-07 Thread Stefan Grosse
On Fri, 6 Feb 2009 19:12:09 -0800 (PST) Paul Heinrich Dietrich
paul.heinrich.dietr...@gmail.com wrote:

PHD I feel very comfortable with R in Windows, and am trying to switch
PHD over to Linux.  I have R 2.8.1 on Linux and it works great (so
PHD far), except for instalilng/updating packages.  For example, using
PHD Emacs with ESS as a text editor, I entered:

I usually update R packages as superuser (terminal: su + pwd, type R,
then update.packages() ). Maybe not the most secure way but other logins
might use the updated packages as well and there are no permission
problems.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Upgrade R program (version 2.6.2) ???

2009-02-06 Thread Stefan Grosse
On Fri,  6 Feb 2009 10:41:54 -0500 (EST) Nidhi Kohli nid...@umd.edu
wrote:

NK has numerous packages that I downloaded for my research work. I
NK want to upgrade my R program with those packages in it. Is there a
NK way I can do this? I would appreciate if someone can help me in
NK this issue.

A bit more information would be nice... So we can only guess which
operating system you are on. I would suppose you are on Windows since
you seem not aware of alternatives.

However on windows you could install the new R in the same directory as
the old, so that the old gets overwritten. You can specify this in the
installation procedure.

Once you have done this you can update your packackes with
update.packages(checkBuilt=TRUE)
this updates the packages on your system to the current R versions
packages.

hth.
Stefan

__
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, self-contained, reproducible code.


Re: [R] Vector Autocorrelation Function in R?

2009-01-23 Thread Stefan Grosse
Andreas Klein schrieb:
 Hello.


 Does anyone know, if there is a function in R to compute the vector 
 autocorrelations?

   
?ccf on bivariate time series.

+ have a look at the vars package though I am not sure what exactly you
are trying.

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] R badly lags matlab on performance?

2009-01-03 Thread Stefan Grosse
On Sat, 3 Jan 2009 22:25:38 +0530 Ajay Shah ajays...@mayin.org wrote:

AS system.time(for (i in 1:1000) {a[i] - a[i] + 1})

AS I wonder what we're doing wrong!

it is no secret that R does badly with loops. Thats why it is
recommended to use vectorized operations.

Another approach is just in time compilation, which would speed up
simple loops. 

There is an interesting entry on R-wiki showing speeding up things:

http://wiki.r-project.org/rwiki/doku.php?id=tips:programming:code_optim2s=just%20time

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] R badly lags matlab on performance?

2009-01-03 Thread Stefan Grosse

 I don't have octave (on the same machine) to compare these with.
 And I don't have MatLab at all. So I can't provide a comparison
 on that front, I'm afraid.
 Ted.
   

Just to add some timings, I was running 1000 repetitions (adding up to
a=1001) on a notebook with core 2 duo T7200

R 2.8.1 on Fedora 10: mean 0.10967, st.dev 0.005238
R 2.8.1 on Windows Vista: mean 0.13245, st.dev 0.00943

Octave 3.0.3 on Fedora 10: mean 0.097276, st.dev 0.0041296

Matlab 2008b on Windows Vista: 0.0626 st.dev 0.005

But I am not sure how representative this is with that very simple
example. To compare Matlab speed with R a kind of benchmark suite is
necessary. Like: http://www.sciviews.org/benchmark/index.html but that
one is very old. I would guess that there did not change much: sometimes
R is faster, sometimes not.

This difference between the Windows and Linux timing is probably not
really relevant: when I was comparing the timings of my usual analysis
there was no difference between the two operating systems. (count data
and time series stuff)

Cheers
Stefan

__
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, self-contained, reproducible code.


Re: [R] Testing predictive power of ARIMA model

2008-12-13 Thread Stefan Grosse

 for(i in 1:length(data))
 {
   point_data = unlist(data[i], use.names = FALSE)
   x = auto.arima(point_data , max.p = 10, max.q = 10, max.P = 0, max.Q = 
 0, approximation = TRUE)

 }

 However, I would like to find a way to test the out of sample predictive 
 power of these models. I can think of a few ways I MIGHT be able to do this 
 but nothing clean. I am a recen R user and despite my best efforts (looking 
 on the mailing list, reading documentation) I cant figure out the best way to 
 do this. 

   
if you want to test the predictive power you need a prediction. so at
least you need predict(x) in your loop and to store the predictions in
another variable. Afterwards you can calculate several measures.

another way is to use the dm.test and accuracy functions of the
forecast(ing) package which you might already have used for the auto arima.

one remark: the use of auto arima might not be the best solution since
it uses in sample fit measures (e.g. AIC) for the best in sample fit. So
for every i you might have a very different arima class. I am not sure
whether this is what you intented...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] how to merge panel data stored by variable?

2008-12-10 Thread Stefan Grosse
 I have two datasets stored in tab-separated format in the following way
 file1:
 country   year1year2
 Germanyvar1  var1
 Hungary var1  var1

 file2:
 country   year1year2
 Germanyvar2 var2
 Hungary var2 var2

 I can easily read in these files, but how can I merge them as a panel
 dataset?

   

?cbind
?rbind

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] xyplot sorted by date

2008-12-10 Thread Stefan Grosse

 With the lattice package, I would like to plot C1 as function of C2 sorted
 by the dates, that is something like :
 xyplot(C1 ~ C2 | as.Date(C3))

 It plots somethings but not the truth.
 I have compared the output with the output of this script

   

I don't know whether it is ther perfect way but I did something similiar
with using a factor. So you could use factors from 1:(number of days)
and the dates as factor labels. But maybe there is a better way.


hth
Stefan

ps I would be interested in truth plotting if someone has a function
it could substitute parts of my reserach ;-)

__
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, self-contained, reproducible code.


Re: [R] request information

2008-12-10 Thread Stefan Grosse
Lisbeth Garzon schrieb:
 Dear R-Help team,

 I'm researcher University Nacional of Colombia, I'll use R for my research,
 and I would want to know, how i can to estimate Logistic Regression model
 such as binary logistic model, multinomial logistic model, and logit models
 with repeated measurement, for i can estimate discrete choice models.

 I would appreciate your help.

   
Dear Lisbeth,

starting points could be

http://cran.r-project.org/web/views/
which is e.g. in social sciences listing relevant packages.

The official introduction:
http://cran.r-project.org/doc/manuals/R-intro.pdf


And the tons of contributed manuals:
http://cran.r-project.org/other-docs.html

plus maybe the posting guide...

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Creating Tabel for Mean, Deviance

2008-12-04 Thread Stefan Grosse
Edwin Sendjaja schrieb:
 Hi,

 Can someone help me how to create a table for Min, Max, Mean, Deviance.

   

Try the summaryBy function of the doBy package. The package has an
excellent vignette (=documentation).

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] select a subset

2008-11-24 Thread Stefan Grosse
gallon li schrieb:
 for id 1, i want to select the last row since all censor indicator is 0; for
 id 2, i want to select the row where censor ==1; for id 3, i also want to
 select the row where censor==1. So if there is a 1 for censor, then I want
 to select such a row, otherwise I want to select the last obs. for this id.
 I am wondering if there is a quick way to solve this?
   
?subset

and please do read an introductionary text

__
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, self-contained, reproducible code.


Re: [R] Help With Permutations

2008-11-24 Thread Stefan Grosse

 To an adequate approximation there are 10^158 of them.
 Simply to obtain them all (at a rate of 10^10 per second, which is
 faster than the CPU frequency of most desktop computers) would take
 10^148 seconds, or slightly longer than 3*(10^140) years.

 Current estimates of the age of the Universe are of the order of
 1.5*(10^10) years, so the Universe will have to last about 2*(10^130)
 times as long as it has already existed, before the task could
 be finished.

 So: why do you want to do this?

   

I want to nominate this as a fortune. How to do it?

;-)

Stefan

__
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, self-contained, reproducible code.


Re: [R] Time plots

2008-11-17 Thread Stefan Grosse
On Mon, 17 Nov 2008 15:30:14 - Lathouri, Maria
[EMAIL PROTECTED] wrote:

LM I want to do some time plots and actually the dates are in the
LM format of dd/mm/. So first I input my dataframe in R in a csv
LM form. What I do is DF-read.csv(C:/Documents and Settings/DF.csv)
LM DATE-as.Date(DATE, %d/%m/%Y)  # to tell R that DATE column is
LM indeed dates with(DF, plot(DATE,pH))

Use a time series class for your data. Then you will get plots with
lines. Have a look at the zoo package and/or ?ts

Stefan

__
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, self-contained, reproducible code.


Re: [R] plot3d - could not find function xlim

2008-10-05 Thread Stefan Grosse
On Sun, 05 Oct 2008 19:32:41 +0200 Tomas Lanczos wrote:
TL when I tried to apply xlim, ylim, zlim functions to the 
TL plot3d/decorate3d, inspite all the help documentation I got this 
TL errormessage:
TL 
TL ERROR: could not find function xlim
TL 
TL Is it a bug or possibly my fault?

More probably the latter one but hard to tell without any example.

Thats why:
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented,
minimal, self-contained, reproducible code.
is attached to mails...

Stefan

__
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, self-contained, reproducible code.


Re: [R] Query about finding correlations

2008-07-31 Thread Stefan Grosse
I am sorry if I misinterpreted this but this questions looks/looked very
like a very basic one about statistical inference... (have a look at the
Manuals/contributed documentation e.g. Faraway)

Lalitha Viswanath wrote:
 Hi
 This is not a homework assignment :)
 Me and my manager are trying to understand the problem better. In the
 meanwhile, we thought we would post the problem on this forum to seek
 some input from statisticians who possibly do this kind of analyses
 everyday and hence are possibly more proficient with R and/or any
 recommended methodologies.

 Lalitha

 On 5/2/07, *Stefan Grosse* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:

 How about making your homeworks yourselfes?

 lalitha viswanath wrote:
  Hi
  I have a dataframe which has 3 columns of numeric data
  A,B,C each of which has been obtained independent of
  the other.
 
  We are trying to find out, which of A or B cause C
  i.e. We are hypothesising that C is the effect and
  either A or B, not both is the cause.
 
  i.e. A causes C and this cause-effect relationship
  explains B.
 
  The data for A contains more noise than that for B.
  We are working with around 1000 points.
 
  I would greatly appreciate any inputs on the best
  statistcal approach to tackle this problem.
  I am thinking that we can find correlation
  coefficients between A and C, and between B and C, but
  I am not sure this answers the question.
  Also we do not know whether the correlation between
  them is linear or non linear.
 
  Thanks
  Lalitha
 
  __
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 
 
 


 

 No virus found in this incoming message.
 Checked by AVG Free Edition. 
 Version: 7.5.467 / Virus Database: 269.6.2/784 - Release Date: 01.05.2007 
 14:57


__
[EMAIL PROTECTED] 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, self-contained, reproducible code.

__
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, self-contained, reproducible code.


Re: [R] Query about finding correlations

2008-07-31 Thread Stefan Grosse
How about making your homeworks yourselfes?

lalitha viswanath wrote:
 Hi
 I have a dataframe which has 3 columns of numeric data
 A,B,C each of which has been obtained independent of
 the other.

 We are trying to find out, which of A or B cause C
 i.e. We are hypothesising that C is the effect and
 either A or B, not both is the cause.

 i.e. A causes C and this cause-effect relationship
 explains B.

 The data for A contains more noise than that for B.
 We are working with around 1000 points.

 I would greatly appreciate any inputs on the best
 statistcal approach to tackle this problem. 
 I am thinking that we can find correlation
 coefficients between A and C, and between B and C, but
 I am not sure this answers the question.
 Also we do not know whether the correlation between
 them is linear or non linear.

 Thanks
 Lalitha

 __
 [EMAIL PROTECTED] 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, self-contained, reproducible code.




__
[EMAIL PROTECTED] 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, self-contained, reproducible code.

__
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, self-contained, reproducible code.


Re: [R] Question about graphical UI running R version 2.7.0 (2008-04-22) on Ubuntu Hardy Heron...

2008-05-18 Thread Stefan Grosse

 Original Message  
Subject: Re: [R] Question about graphical UI running R version 2.7.0   
(2008-04-22) on Ubuntu Hardy Heron...

From: Scionforbai [EMAIL PROTECTED]
To: Brian Lunergan [EMAIL PROTECTED]
Date: 17.05.2008 23:07

Have a look at RKWard (http://rkward.sourceforge.net/), for kde. I
don't know though if Ubuntu has it in its repos.

  
rkward is great. It is in the ubuntu repos although usually not the 
recent versions. If you want to try those there are *.deb files on the 
already mentioned sourceforge page.


Stefan

__
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, self-contained, reproducible code.


Re: [R] problem in installing R packages on linux

2008-04-18 Thread Stefan Grosse
On Fri, 18 Apr 2008 01:47:43 -0700 (PDT) man4ish wrote:
M  The screenshot is not there, but I suspect you want to install
M  package BARD rather than BART.
M  
M  Uwe Ligges
M No i am trying to install  BART which is valid name , i have 30-40
M times for other packages still facing the same pblm .How can i
M rectify this.Please help me out.

You are wrong. There is no BART package on CRAN. Probably you mean BART
models which are in the BayesTree package:

http://cran.r-project.org/web/packages/BayesTree/index.html

hth
Stefan

__
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, self-contained, reproducible code.


Re: [R] Vertical bars with barchart

2008-04-18 Thread Stefan Grosse
On Fri, 18 Apr 2008 12:00:13 +0200 G. Draisma wrote:
GDbarchart(VADeaths,horizontal=F,
GDkey=simpleKey(colnames(VADeaths),points=F,rectangles=T))
GD does not give what I need,

Works for me. Do you have the current R (2.6.2) and lattice?

btw. it also works with
barchart(VADeaths, horizontal=F,auto.key=T)

Stefan

__
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, self-contained, reproducible code.


Re: [R] SVG format from any R graphic GUI?

2008-04-17 Thread Stefan Grosse
On Wed, 16 Apr 2008 18:51:30 +0200 Agustin Lobo wrote:
AL 2. I need the figure displayed on the screen, I'm using
AL Impress (the equivalent of ppt). Thus EPS is not an option,

1. So what please is wrong with png? I am using it with Word (If for
some reasons I cannot use LaTeX -- some coauthors are unfortunately
quite resistant there...)

2. Plus have you tried to make pdf's from the impress slides with the
eps graphics? Works perfectly for me. Acrobat reader can than do the
presentation in full screen mode as well. This indeed makes eps an
option again!  

hth
Stefan

__
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, self-contained, reproducible code.


  1   2   >