[R] New to R

2018-09-19 Thread Bill Poling
Hello Jim, as new use"R" myself, 1.5 years I HIGHLY recommend emersion.

Subscribe to :
https://www.r-bloggers.com/

https://stackoverflow.com

http://blog.revolutionanalytics.com/

Anything Hadley Wickam, he has several free e-books.

Depending on  r-help (r-help@r-project.org<mailto:r-help@r-project.org>) is a 
tough way to go, they can be hard on new users without the formality of:
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html<http://www.R-project.org/posting-guide.html>

Be prepared for partial suggestions that depend on your further research, trial 
and error!

WHP



From: R-help  On Behalf Of Jim Blackburn
Sent: Friday, September 14, 2018 2:00 PM
To: r-help@r-project.org
Subject: [R] New to R

I am newly subscribed to r-project.


I have recently plunged into R on a totally self-taught basis (may not have 
been the smartest decision!)



I am attempting to download tickers as a time series. I can successfully create 
RDA files but I want to convert them to CVS. Following is the code I have 
created so far.



if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')

library(BatchGetSymbols)

tickers <- c('SPY','VCR', 'RPG')

first.date<http://first.date> <- Sys.Date()-365

last.date<http://last.date> <- Sys.Date<http://Sys.Date>

l.out <- BatchGetSymbols(tickers = tickers,

first.date<http://first.date> = first.date<http://first.date>,

last.date<http://last.date> = last.date<http://last.date>,

cache.folder = file.path("c://Users/Owner/Documents/R",

+ 'BGS_Cache') )

print(l.out$df.control)

print(l.out$df.tickers)







I can print(l.out) and see that it contains all the data, but it is not a 
data.frame



Can anyone help with creating a data.frame and then converting to CSV?



Any help is GREATLY appreciated!



Thanks



Jim


Sent from 
Mail<https://go.microsoft.com/fwlink/?LinkId=550986<https://go.microsoft.com/fwlink/?LinkId=550986>>
 for Windows 10


[[alternative HTML version deleted]]

__
R-help@r-project.org<mailto:R-help@r-project.org> mailing list -- To 
UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help<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.

Confidentiality Notice This message is sent from Zelis. ...{{dropped:15}}

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2018-09-15 Thread Michael Dewey

Dear Jim

Without knowing what l.out is this might be tricky. What does str(l.out) 
tell you it is. And is CVS a typo for csv?


Michael

On 14/09/2018 19:00, Jim Blackburn wrote:

I am newly subscribed to r-project.


I have recently plunged into R on a totally self-taught basis (may not have 
been the smartest decision!)



I am attempting to download tickers as a time series.  I can successfully 
create RDA files but I want to convert them to CVS.  Following is the code I 
have created so far.



if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')

library(BatchGetSymbols)

tickers <- c('SPY','VCR', 'RPG')

first.date <- Sys.Date()-365

last.date <- Sys.Date

l.out <- BatchGetSymbols(tickers = tickers,

first.date = first.date,

last.date = last.date,

cache.folder = file.path("c://Users/Owner/Documents/R",

+'BGS_Cache') )

print(l.out$df.control)

print(l.out$df.tickers)







I can print(l.out) and see that it contains all the data, but it is not a 
data.frame



Can anyone help with creating a data.frame and then converting to CSV?



Any help is GREATLY appreciated!



Thanks



Jim


Sent from Mail for Windows 10


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.



--
Michael
http://www.dewey.myzen.co.uk/home.html

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2018-09-14 Thread David Winsemius


> On Sep 14, 2018, at 2:15 PM, MacQueen, Don via R-help  
> wrote:
> 
> If l.out is not a data frame, what is it? A list? A matrix? Some other 
> structure? Try

I thought it would be one of those variants of a zoo object. Matrix structure 
with specialized row.names that can handle time-date range operators.

Bert's advice to learn some basic R certainly makes sense. After fixing the two 
errors in the code and substituting a proper path I get:

str(l.out)
List of 2
 $ df.control:'data.frame': 3 obs. of  6 variables:
  ..$ ticker  : Factor w/ 3 levels "SPY","VCR","RPG": 1 2 3
  ..$ src : Factor w/ 1 level "yahoo": 1 1 1
  ..$ download.status : Factor w/ 1 level "OK": 1 1 1
  ..$ total.obs   : int [1:3] 252 252 252
  ..$ perc.benchmark.dates: num [1:3] 1 1 1
  ..$ threshold.decision  : Factor w/ 1 level "KEEP": 1 1 1
 $ df.tickers:'data.frame': 756 obs. of  10 variables:
  ..$ price.open : num [1:756] 250 249 250 250 250 ...
  ..$ price.high : num [1:756] 250 249 250 250 250 ...
  ..$ price.low  : num [1:756] 250 249 249 250 249 ...
  ..$ price.close: num [1:756] 250 249 250 250 250 ...
  ..$ volume : num [1:756] 95446300 95432400 46235200 47108100 
59574100 ...
  ..$ price.adjusted : num [1:756] 245 246 246 247 247 ...
  ..$ ref.date   : Date[1:756], format: "2017-09-14" "2017-09-15" 
"2017-09-18" "2017-09-19" ...
  ..$ ticker : chr [1:756] "SPY" "SPY" "SPY" "SPY" ...
  ..$ ret.adjusted.prices: num [1:756] NA 0.00135 0.00213 0.001 0.00036 ...
  ..$ ret.closing.prices : num [1:756] NA -0.0036 0.00213 0.001 0.00036 ...


So the data.frame would be:  l.out$df.tickers


It's got the data in a long-format arrangement:

table( l.out$df.tickers$ticker)

RPG SPY VCR 
252 252 252 
-- 
David.
> 
>  str(l.out)
>  class(l.out)
> 
> and see what you get.
> 
> Can't help you convert it to a data frame without knowing what it is.
> 
> After you have a data frame, then write.table(), write.csv(), or write.csv2() 
> will "convert" it to a CSV (assuming that's what you meant by "CVS".
> 
> -Don
> 
> p.s. use reply-all if you want to add that extra information .
> 
> --
> Don MacQueen
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
> Lab cell 925-724-7509
> 
> 
> 
> On 9/14/18, 11:00 AM, "R-help on behalf of Jim Blackburn" 
>  outlook_5dc74cb3034cb...@outlook.com> wrote:
> 
>I am newly subscribed to r-project.
> 
> 
>I have recently plunged into R on a totally self-taught basis (may not 
> have been the smartest decision!)
> 
> 
> 
>I am attempting to download tickers as a time series.  I can successfully 
> create RDA files but I want to convert them to CVS.  Following is the code I 
> have created so far.
> 
> 
> 
>if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')
> 
>library(BatchGetSymbols)
> 
>tickers <- c('SPY','VCR', 'RPG')
> 
>first.date <- Sys.Date()-365
> 
>last.date <- Sys.Date
> 
>l.out <- BatchGetSymbols(tickers = tickers,
> 
>   first.date = first.date,
> 
>   last.date = last.date,
> 
>cache.folder = file.path("c://Users/Owner/Documents/R",
> 
>+'BGS_Cache') )
> 
>print(l.out$df.control)
> 
>print(l.out$df.tickers)
> 
> 
> 
> 
> 
> 
> 
>I can print(l.out) and see that it contains all the data, but it is not a 
> data.frame
> 
> 
> 
>Can anyone help with creating a data.frame and then converting to CSV?
> 
> 
> 
>Any help is GREATLY appreciated!
> 
> 
> 
>Thanks
> 
> 
> 
>Jim
> 
> 
>Sent from Mail for Windows 
> 10
> 
> 
>   [[alternative HTML version deleted]]
> 
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>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 -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   
-Gehm's Corollary to Clarke's Third Law

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2018-09-14 Thread MacQueen, Don via R-help
If l.out is not a data frame, what is it? A list? A matrix? Some other 
structure? Try

  str(l.out)
  class(l.out)

and see what you get.

Can't help you convert it to a data frame without knowing what it is.

After you have a data frame, then write.table(), write.csv(), or write.csv2() 
will "convert" it to a CSV (assuming that's what you meant by "CVS".

-Don

p.s. use reply-all if you want to add that extra information .

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 9/14/18, 11:00 AM, "R-help on behalf of Jim Blackburn" 
 wrote:

I am newly subscribed to r-project.


I have recently plunged into R on a totally self-taught basis (may not have 
been the smartest decision!)



I am attempting to download tickers as a time series.  I can successfully 
create RDA files but I want to convert them to CVS.  Following is the code I 
have created so far.



if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')

library(BatchGetSymbols)

tickers <- c('SPY','VCR', 'RPG')

first.date <- Sys.Date()-365

last.date <- Sys.Date

l.out <- BatchGetSymbols(tickers = tickers,

   first.date = first.date,

   last.date = last.date,

cache.folder = file.path("c://Users/Owner/Documents/R",

+'BGS_Cache') )

print(l.out$df.control)

print(l.out$df.tickers)







I can print(l.out) and see that it contains all the data, but it is not a 
data.frame



Can anyone help with creating a data.frame and then converting to CSV?



Any help is GREATLY appreciated!



Thanks



Jim


Sent from Mail for Windows 
10


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
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] New to R

2018-09-14 Thread Bert Gunter
Others may help, but I suggest first going through an R tutorial or
two to learn about R's basic data structures, i/o, etc. This list can
help, but cannot substitute for such homework. Some tutorial
recommendations can be found here:
https://www.rstudio.com/online-learning/#r-programming

There are many more, of course.

See also:
?read.table (etc. in the Help page)
?write.table

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Fri, Sep 14, 2018 at 1:56 PM Jim Blackburn
 wrote:
>
> I am newly subscribed to r-project.
>
>
> I have recently plunged into R on a totally self-taught basis (may not have 
> been the smartest decision!)
>
>
>
> I am attempting to download tickers as a time series.  I can successfully 
> create RDA files but I want to convert them to CVS.  Following is the code I 
> have created so far.
>
>
>
> if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')
>
> library(BatchGetSymbols)
>
> tickers <- c('SPY','VCR', 'RPG')
>
> first.date <- Sys.Date()-365
>
> last.date <- Sys.Date
>
> l.out <- BatchGetSymbols(tickers = tickers,
>
>first.date = first.date,
>
>last.date = last.date,
>
> cache.folder = file.path("c://Users/Owner/Documents/R",
>
> +'BGS_Cache') )
>
> print(l.out$df.control)
>
> print(l.out$df.tickers)
>
>
>
>
>
>
>
> I can print(l.out) and see that it contains all the data, but it is not a 
> data.frame
>
>
>
> Can anyone help with creating a data.frame and then converting to CSV?
>
>
>
> Any help is GREATLY appreciated!
>
>
>
> Thanks
>
>
>
> Jim
>
>
> Sent from Mail for Windows 10
>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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 -- To UNSUBSCRIBE and more, see
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] New to R

2018-09-14 Thread Jim Blackburn
I am newly subscribed to r-project.


I have recently plunged into R on a totally self-taught basis (may not have 
been the smartest decision!)



I am attempting to download tickers as a time series.  I can successfully 
create RDA files but I want to convert them to CVS.  Following is the code I 
have created so far.



if (!require(BatchGetSymbols)) install.packages('BatchGetSymbols')

library(BatchGetSymbols)

tickers <- c('SPY','VCR', 'RPG')

first.date <- Sys.Date()-365

last.date <- Sys.Date

l.out <- BatchGetSymbols(tickers = tickers,

   first.date = first.date,

   last.date = last.date,

cache.folder = file.path("c://Users/Owner/Documents/R",

+'BGS_Cache') )

print(l.out$df.control)

print(l.out$df.tickers)







I can print(l.out) and see that it contains all the data, but it is not a 
data.frame



Can anyone help with creating a data.frame and then converting to CSV?



Any help is GREATLY appreciated!



Thanks



Jim


Sent from Mail for Windows 10


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-05-10 Thread rex

Boris Chow chow.bo...@gmail.com [2015-05-09 20:04]:


I want to do a pricing of an American option as my first exercise. Can some 
experienced users give me some pointers to do so?


https://stat.ethz.ch/mailman/listinfo/r-sig-finance

http://cran.r-project.org/web/packages/AmericanCallOpt/AmericanCallOpt.pdf

http://cran.r-project.org/web/packages/fOptions/fOptions.pdf


-rex
--
The market can remain irrational longer than you can remain solvent.
-- John Maynard Keynes

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-05-10 Thread Luis Fernando García
Dear Boris,

I am new too, but got a lot of help from this webpage. I hope it will work
for you too,

All the best!

http://tryr.codeschool.com/

2015-05-09 23:44 GMT-03:00 Boris Chow chow.bo...@gmail.com:

 Dear R users,

 I am new to R community and would like to dig into it. Would you advise
 what are the appropriate steps to do so?

 I want to do a pricing of an American option as my first exercise. Can
 some experienced users give me some pointers to do so?

 Thanks a lot,
 Boris
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-05-10 Thread John Kane
Welcome to R and the R-help list

Not oriented to finance but just general info
A good source of introductory sources is available at 
http://www.introductoryr.co.uk/R_Resources_for_Beginners.html. BTW I've never 
seen the author's book but it does look interesting. :) 

I have had a look at most of the on-line books listed and I'd say any of them 
is likely to be very helpful. I have read a good bit of the book by Daniel 
Navarro and it is a excellent intro but possibly a bit tedious if you already 
are well grounded in stats.

Pat Burn's (of The R Inferno infamy ) has a new tutorial out which looks 
interesting. It is listed in the above link (Impatient R)

My personal opinion is that An Introduction to R by W.N. Venables and D.M. 
Smith (2004) is an excellent resource but it is only an introduction if you 
already are a pretty knowledgeable stats and programming type. However, when 
you hit a problem it is one of the first places to look for help.

If you have experience with SAS or SPSS then Bob Muenchen's R FOR SAS AND SPSS 
USERS (www.et.bs.ehu.es/~etptupaf/pub/R/RforSASSPSSusers.pdf) also available 
in expanded hard-copy format, can be extremely useful.

A couple of very useful sites for crafting questions for R-help or Stack

http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
 and http://adv-r.had.co.nz/Reproducibility.html. In fact, just following the 
instructions for preparing a decent example can lead to a solution to the 
problem.

John Kane
Kingston ON Canada


 -Original Message-
 From: chow.bo...@gmail.com
 Sent: Sun, 10 May 2015 10:44:31 +0800
 To: r-help@r-project.org
 Subject: [R] New to R
 
 Dear R users,
 
 I am new to R community and would like to dig into it. Would you advise
 what are the appropriate steps to do so?
 
 I want to do a pricing of an American option as my first exercise. Can
 some experienced users give me some pointers to do so?
 
 Thanks a lot,
 Boris
 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.


GET FREE 5GB EMAIL - Check out spam free email with many cool features!
Visit http://www.inbox.com/email to find out more!

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-05-09 Thread Boris Chow
Dear R users,

I am new to R community and would like to dig into it. Would you advise what 
are the appropriate steps to do so?

I want to do a pricing of an American option as my first exercise. Can some 
experienced users give me some pointers to do so?

Thanks a lot,
Boris
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-02-03 Thread Jim Lemon
Hi Lalitha,
Your description is more like calculating a composite score from the
values observed on ten attributes, which can then be ranked. Perhaps
you want to standardize the observed values to insure that the result
is not dominated by the attribute with the numerically highest
variance. For example:

V1-rnorm(10,5,5)
Z1-scale(V1)

You can then combine your ten standardized (Z) scores to form a
composite score and rank your subjects on that.

Jim


On Tue, Feb 3, 2015 at 6:48 PM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote:
 Please don't cross-post to multiple lists. There is a Posting Guide mentioned 
 in the footer that you probably won't see because you are using Nabble. It 
 would have informed you that the R-devel mailing list was for people 
 interested in modifying R, definitely not this topic.

 As to your question, Revolution R would probably be overkill, and if you 
 chose to go that route then asking the Revolution R support people for help 
 would be appropriate. This list is for the open source R software that RR 
 builds on.

 Your problem  statement suggests you already know the weights... in which 
 case this is a straightforward linear algebra calculation that is trivial in 
 R.

 But your question mentions selecting statistics methods, which is not on 
 topic here in the R-help mailing list, since methods are independent of the 
 software used to apply them. If you know what methods you want to apply, and 
 have read the introductory R documentation, then this is an appropriate place 
 to ask for help on how to apply R to your problem. If that is the case, then 
 DO read the Posting Guide and try again with some example data and if 
 possible some sample results you expect to get. We can then show you how to 
 connect the dots using R.

 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 On February 2, 2015 10:14:28 PM PST, Lalitha Kristipati 
 lalitha.kristip...@techmahindra.com wrote:
Hi,



In our data we have 10 people with 10 different attributes , we want to
rank the people based on the weightage of these attributes.

Suggest the best statistical method to do this.

Does Revolution R solves my problem??



Regards,
Lalitha Kristipati
Associate Software Engineer




Disclaimer:  This message and the information contained herein is
proprietary and confidential and subject to the Tech Mahindra policy
statement, you may review the policy at
http://www.techmahindra.com/Disclaimer.html externally
http://tim.techmahindra.com/tim/disclaimer.html internally within
TechMahindra.



   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
 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 -- To UNSUBSCRIBE and more, see
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] New to R

2015-02-02 Thread Lalitha Kristipati
Hi,



In our data we have 10 people with 10 different attributes , we want to rank 
the people based on the weightage of these attributes.

Suggest the best statistical method to do this.

Does Revolution R solves my problem??



Regards,
Lalitha Kristipati
Associate Software Engineer




Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-02-02 Thread Jeff Newmiller
Please don't cross-post to multiple lists. There is a Posting Guide mentioned 
in the footer that you probably won't see because you are using Nabble. It 
would have informed you that the R-devel mailing list was for people interested 
in modifying R, definitely not this topic.

As to your question, Revolution R would probably be overkill, and if you chose 
to go that route then asking the Revolution R support people for help would be 
appropriate. This list is for the open source R software that RR builds on.

Your problem  statement suggests you already know the weights... in which case 
this is a straightforward linear algebra calculation that is trivial in R.

But your question mentions selecting statistics methods, which is not on topic 
here in the R-help mailing list, since methods are independent of the software 
used to apply them. If you know what methods you want to apply, and have read 
the introductory R documentation, then this is an appropriate place to ask for 
help on how to apply R to your problem. If that is the case, then DO read the 
Posting Guide and try again with some example data and if possible some sample 
results you expect to get. We can then show you how to connect the dots using R.

---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On February 2, 2015 10:14:28 PM PST, Lalitha Kristipati 
lalitha.kristip...@techmahindra.com wrote:
Hi,



In our data we have 10 people with 10 different attributes , we want to
rank the people based on the weightage of these attributes.

Suggest the best statistical method to do this.

Does Revolution R solves my problem??



Regards,
Lalitha Kristipati
Associate Software Engineer




Disclaimer:  This message and the information contained herein is
proprietary and confidential and subject to the Tech Mahindra policy
statement, you may review the policy at
http://www.techmahindra.com/Disclaimer.html externally
http://tim.techmahindra.com/tim/disclaimer.html internally within
TechMahindra.



   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
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] New to R

2015-01-21 Thread Lalitha Kristipati
Thanks 

Regards,

Lalitha K.

Associate Software Engineer

917411291011


From: Jeff Newmiller jdnew...@dcn.davis.ca.us
Sent: 21 January 2015 21:34
To: Lalitha Kristipati; R-help@r-project.org
Subject: Re: [R] New to R

This is not really a question about R... it is a question about databases 
because similar divisions occur in every imperative programming language that 
deals with databases. ODBC is a software layer that aims to create a uniform 
API for the programmer among different variations of SQL databases (though it 
doesn't entirely succeed). RODBC gives R access to that API. You have to use 
OS-specific utilities outside of R to link ODBC Data Source Names to specific 
ODBC-to-DB drivers.

The alternatives are usually much more specific to the DB back end, with 
potential ability to take advantage of DB- specific features, and disadvantages 
of being more closely tied to that particular software.

There is a mailing list (R-sig-db) where you should ask more specific questions 
about how R deals with these non-R- specific APIs, but each of the R packages 
maps to much more extensive documentation about those APIs that you will need 
to be familiar with in order to make progress with them.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
---
Sent from my phone. Please excuse my brevity.

On January 20, 2015 9:51:44 PM PST, Lalitha Kristipati 
lalitha.kristip...@techmahindra.com wrote:
Hi,

I am trying to connect R to databases.

I found two ways to connect.

1.By using specific package (eg RMySQL to connect to R)

2.By using connectors and RODBC package.

can any one tell me the difference between those two methods.



Regards,

Lalitha K.

Associate Software Engineer

917411291011



Disclaimer:  This message and the information contained herein is
proprietary and confidential and subject to the Tech Mahindra policy
statement, you may review the policy at
http://www.techmahindra.com/Disclaimer.html externally
http://tim.techmahindra.com/tim/disclaimer.html internally within
TechMahindra.



   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.




Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-01-20 Thread Lalitha Kristipati
Hi,

I am trying to connect R to databases.

I found two ways to connect.

1.By using specific package (eg RMySQL to connect to R)

2.By using connectors and RODBC package.

can any one tell me the difference between those two methods.



Regards,

Lalitha K.

Associate Software Engineer

917411291011



Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2015-01-20 Thread Jeff Newmiller
This is not really a question about R... it is a question about databases 
because similar divisions occur in every imperative programming language that 
deals with databases. ODBC is a software layer that aims to create a uniform 
API for the programmer among different variations of SQL databases (though it 
doesn't entirely succeed). RODBC gives R access to that API. You have to use 
OS-specific utilities outside of R to link ODBC Data Source Names to specific 
ODBC-to-DB drivers.

The alternatives are usually much more specific to the DB back end, with 
potential ability to take advantage of DB- specific features, and disadvantages 
of being more closely tied to that particular software.

There is a mailing list (R-sig-db) where you should ask more specific questions 
about how R deals with these non-R- specific APIs, but each of the R packages 
maps to much more extensive documentation about those APIs that you will need 
to be familiar with in order to make progress with them.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

On January 20, 2015 9:51:44 PM PST, Lalitha Kristipati 
lalitha.kristip...@techmahindra.com wrote:
Hi,

I am trying to connect R to databases.

I found two ways to connect.

1.By using specific package (eg RMySQL to connect to R)

2.By using connectors and RODBC package.

can any one tell me the difference between those two methods.



Regards,

Lalitha K.

Associate Software Engineer

917411291011



Disclaimer:  This message and the information contained herein is
proprietary and confidential and subject to the Tech Mahindra policy
statement, you may review the policy at
http://www.techmahindra.com/Disclaimer.html externally
http://tim.techmahindra.com/tim/disclaimer.html internally within
TechMahindra.



   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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 -- To UNSUBSCRIBE and more, see
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] New to R

2015-01-20 Thread Prof Brian Ripley

On 21/01/2015 05:51, Lalitha Kristipati wrote:

Hi,

I am trying to connect R to databases.

I found two ways to connect.

1.By using specific package (eg RMySQL to connect to R)

2.By using connectors and RODBC package.

can any one tell me the difference between those two methods.


See the 'R Data Import/Export Manual' which ships with R.

There is a specific list for such questions, R-sig-db, where less vague 
questions should be asked.






Regards,

Lalitha K.

Associate Software Engineer

917411291011



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2014-12-15 Thread Lalitha Kristipati
Hi

I'm learning R language from  past  one month .As R is used highly for data 
analysis ,mining and modeling ,I want to know few real time examples in R in 
order to make my learning  fun filled and practical .Any quick suggestions  are 
appreciated .



Regards,
Lalitha Kristipati
Associate Software Engineer





Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at http://www.techmahindra.com/Disclaimer.html externally 
http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2014-12-15 Thread Mark Sharp
I would recommend finding some tutorials on line in areas that you enjoy, read 
http://r-bloggers.com every day, find introductory texts in the statistical 
areas of interest, and study some texts on R programming. I really enjoyed The 
Art of R Programming: A Tour of Statistical Software Design by Norman Matloff. 
For a bit more depth I like Hadley Wickham's Advanced R book 
(http://adv-r.had.co.nz).

Mark Sharp

R. Mark Sharp, Ph.D.
Director of Primate Records Database
Southwest National Primate Research Center
Texas Biomedical Research Institute
P.O. Box 760549
San Antonio, TX 78245-0549
Telephone: (210)258-9476
e-mail: msh...@txbiomed.org

 On Dec 15, 2014, at 5:12 AM, Lalitha Kristipati 
 lalitha.kristip...@techmahindra.com wrote:

 Hi

 I'm learning R language from  past  one month .As R is used highly for data 
 analysis ,mining and modeling ,I want to know few real time examples in R in 
 order to make my learning  fun filled and practical .Any quick suggestions  
 are appreciated .



 Regards,
 Lalitha Kristipati
 Associate Software Engineer




 
 Disclaimer:  This message and the information contained herein is proprietary 
 and confidential and subject to the Tech Mahindra policy statement, you may 
 review the policy at http://www.techmahindra.com/Disclaimer.html externally 
 http://tim.techmahindra.com/tim/disclaimer.html internally within 
 TechMahindra.
 


   [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.



NOTICE:  This E-Mail (including attachments) is confidential and may be legally 
privileged.  It is covered by the Electronic Communications Privacy Act, 18 
U.S.C.2510-2521.  If you are not the intended recipient, you are hereby 
notified that any retention, dissemination, distribution or copying of this 
communication is strictly prohibited.  Please reply to the sender that you have 
received this message in error, then delete it.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2014-12-15 Thread billy am
Hi ,

As the OP was asking for examples , I would also recommend Modeling
Techniques in Predictive Analytics by Thomas Miller.

That book is full of examples + R scripts. Its on Amazon.

Regards
Billy


--
|


http://billyam.com  || http://use-r.com  || http://shinyserver.com (BETA)

SAS Certified Base Programmer for SAS 9
Oracle SQL Expert(11g)




On Mon, Dec 15, 2014 at 11:26 PM, Mark Sharp msh...@txbiomed.org wrote:

 I would recommend finding some tutorials on line in areas that you enjoy,
 read http://r-bloggers.com every day, find introductory texts in the
 statistical areas of interest, and study some texts on R programming. I
 really enjoyed The Art of R Programming: A Tour of Statistical Software
 Design by Norman Matloff. For a bit more depth I like Hadley Wickham's
 Advanced R book (http://adv-r.had.co.nz).

 Mark Sharp

 R. Mark Sharp, Ph.D.
 Director of Primate Records Database
 Southwest National Primate Research Center
 Texas Biomedical Research Institute
 P.O. Box 760549
 San Antonio, TX 78245-0549
 Telephone: (210)258-9476
 e-mail: msh...@txbiomed.org

  On Dec 15, 2014, at 5:12 AM, Lalitha Kristipati 
 lalitha.kristip...@techmahindra.com wrote:
 
  Hi
 
  I'm learning R language from  past  one month .As R is used highly for
 data analysis ,mining and modeling ,I want to know few real time examples
 in R in order to make my learning  fun filled and practical .Any quick
 suggestions  are appreciated .
 
 
 
  Regards,
  Lalitha Kristipati
  Associate Software Engineer
 
 
 
 
 
 
  Disclaimer:  This message and the information contained herein is
 proprietary and confidential and subject to the Tech Mahindra policy
 statement, you may review the policy at
 http://www.techmahindra.com/Disclaimer.html externally
 http://tim.techmahindra.com/tim/disclaimer.html internally within
 TechMahindra.
 
 
 
 
[[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
  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.



 NOTICE:  This E-Mail (including attachments) is confidential and may be
 legally privileged.  It is covered by the Electronic Communications Privacy
 Act, 18 U.S.C.2510-2521.  If you are not the intended recipient, you are
 hereby notified that any retention, dissemination, distribution or copying
 of this communication is strictly prohibited.  Please reply to the sender
 that you have received this message in error, then delete it.

 __
 R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
 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.


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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] New to R

2014-02-28 Thread Ista Zahn
Please give a reproducible example. When I run your code I get object
'stocks' not found. So what is stocks?

On Thu, Feb 27, 2014 at 11:24 PM, George Katsuras geoka...@hotmail.com wrote:
 I successfully downloaded and loaded the stockPortfolio and quadprog 
 packages, but when I entered the following command I got an error:


 returns - getReturns(names(stocks), freq=week)
 Error in file(file, rt) : cannot open the connection
 In addition: Warning message:
 In file(file, rt) : cannot open: HTTP status was '404 Not Found'




 When I tried discovering the source of this error, it appears that the file 
 has been temporarily moved to a new URL address.


 I’m currently running Windows 8.1.


 Is there a fix for this?




 Sent from Windows Mail
 [[alternative HTML version deleted]]


 __
 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-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] New to R

2014-02-28 Thread Ista Zahn
Hi George,

Please keep the R mailing list copied--I've added them back.

The example on the webpage you listed is wrong, in a way that would be
obvious if you took the time to familiarize yourself with the basics
of R. stocks has no names.

Best,
Ista



On Fri, Feb 28, 2014 at 6:45 PM, George Katsuras geoka...@hotmail.com wrote:
 http://economistatlarge.com/portfolio-theory/r-optimized-portfolio

 Thanks for your prompt response.  I think the above link provides the
 reproducible example you are looking for.



 From: istaz...@gmail.com
 Date: Fri, 28 Feb 2014 13:16:57 -0500
 Subject: Re: [R] New to R
 To: geoka...@hotmail.com
 CC: r-help@r-project.org


 Please give a reproducible example. When I run your code I get object
 'stocks' not found. So what is stocks?

 On Thu, Feb 27, 2014 at 11:24 PM, George Katsuras geoka...@hotmail.com
 wrote:
  I successfully downloaded and loaded the stockPortfolio and quadprog
  packages, but when I entered the following command I got an error:
 
 
  returns - getReturns(names(stocks), freq=week)
  Error in file(file, rt) : cannot open the connection
  In addition: Warning message:
  In file(file, rt) : cannot open: HTTP status was '404 Not Found'
 
 
 
 
  When I tried discovering the source of this error, it appears that the
  file has been temporarily moved to a new URL address.
 
 
  I’m currently running Windows 8.1.
 
 
  Is there a fix for this?
 
 
 
 
  Sent from Windows Mail
  [[alternative HTML version deleted]]
 
 
  __
  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-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] New to R

2014-02-27 Thread George Katsuras
I successfully downloaded and loaded the stockPortfolio and quadprog packages, 
but when I entered the following command I got an error:


returns - getReturns(names(stocks), freq=week)
Error in file(file, rt) : cannot open the connection
In addition: Warning message:
In file(file, rt) : cannot open: HTTP status was '404 Not Found'




When I tried discovering the source of this error, it appears that the file has 
been temporarily moved to a new URL address.


I’m currently running Windows 8.1.


Is there a fix for this?




Sent from Windows Mail
[[alternative HTML version deleted]]

__
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] New to R

2012-08-28 Thread Bert Gunter
1. Read an Introduction to R (ships with R) or other R tutorial (there
are many good ones on the Web).

1.5 ... Also check CRAN for books and other info.

2. ?write.table
 but you'll need what you learn in the tutorial to extract output
from your functions.

2.5 ...and of course, ?xtabs and ?fisher.test,  paying attention to
the Value sections of the Help.

This list cannot replace your expending time and effort to learn R's
basics The tutorials and Help pages have the info you need..

-- Bert

On Mon, Aug 27, 2012 at 5:45 PM, moulirc c.radhakrish...@uq.edu.au wrote:
 Hi,

 I am new to R and using Rcmdr and like to automate and get into scripting...

 I am using for evaluating two variables

 .Table - xtabs(~CurSWI+BckMo, data=swanalysis_run1)
 .Table
 fisher.test(.Table)
 remove(.Table)

 the output for this will be 
 .Table
   BckMo
 CurSWI N/A No Yes
N/A   1  0   0
No3 62  38
Yes   2 23  24

 fisher.test(.Table)

 Fisher's Exact Test for Count Data

 data:  .Table
 p-value = 0.02689
 alternative hypothesis: two.sided
 ***
 What i would like to do is get an output in a excel or csv format with

 p.value and BckMo


 (BckMo, 0.02689)

 pls help me...thanks in advance..
 cheers

 Mouli






 --
 View this message in context: 
 http://r.789695.n4.nabble.com/New-to-R-tp4641489.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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] New to R

2012-08-27 Thread moulirc
Hi,

I am new to R and using Rcmdr and like to automate and get into scripting...

I am using for evaluating two variables 

.Table - xtabs(~CurSWI+BckMo, data=swanalysis_run1)
.Table
fisher.test(.Table)
remove(.Table)

the output for this will be 
 .Table
  BckMo
CurSWI N/A No Yes
   N/A   1  0   0
   No3 62  38
   Yes   2 23  24

 fisher.test(.Table)

Fisher's Exact Test for Count Data

data:  .Table 
p-value = 0.02689
alternative hypothesis: two.sided
***
What i would like to do is get an output in a excel or csv format with 

p.value and BckMo


(BckMo, 0.02689)

pls help me...thanks in advance..
cheers

Mouli






--
View this message in context: 
http://r.789695.n4.nabble.com/New-to-R-tp4641489.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] New to R

2012-05-14 Thread Ronald McDowell
I am new to R and starting to explore its functionality. I wondered if anyone 
could advise whether R supports non-linear canonical correlation and/or the 
specification of models using alternating least squares?

Thanks
Ron


[[alternative HTML version deleted]]

__
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] New to R

2012-05-14 Thread David L Carlson
You will find functions such as these in the thousands of packages that are
available once you have installed R. You can use rseek.org to search for
specific topics. Good overviews are found in the CRAN Task Views (from the
main R webpage, click on CRAN, select a mirror host, and then select Task
Views from the list on the left.

--
David L Carlson
Associate Professor of Anthropology
Texas AM University
College Station, TX 77843-4352


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Ronald McDowell
 Sent: Monday, May 14, 2012 6:51 AM
 To: r-help@r-project.org
 Subject: [R] New to R
 
 I am new to R and starting to explore its functionality. I wondered if
 anyone could advise whether R supports non-linear canonical correlation
 and/or the specification of models using alternating least squares?
 
 Thanks
 Ron
 
 
   [[alternative HTML version deleted]]
 
 __
 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-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] New to R

2012-05-14 Thread Bert Gunter
I usually try google searches first. While not always successful, I am
frequently surprised by how well it does.

I strongly second the use of CRAN task views. IMHO, some fine folks
have volunteered their time and efforts to produce this very well
written series of guides to what's in R. It and they deserve greater
recognition.

-- Bert

On Mon, May 14, 2012 at 9:32 AM, David L Carlson dcarl...@tamu.edu wrote:
 You will find functions such as these in the thousands of packages that are
 available once you have installed R. You can use rseek.org to search for
 specific topics. Good overviews are found in the CRAN Task Views (from the
 main R webpage, click on CRAN, select a mirror host, and then select Task
 Views from the list on the left.

 --
 David L Carlson
 Associate Professor of Anthropology
 Texas AM University
 College Station, TX 77843-4352


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Ronald McDowell
 Sent: Monday, May 14, 2012 6:51 AM
 To: r-help@r-project.org
 Subject: [R] New to R

 I am new to R and starting to explore its functionality. I wondered if
 anyone could advise whether R supports non-linear canonical correlation
 and/or the specification of models using alternating least squares?

 Thanks
 Ron


       [[alternative HTML version deleted]]

 __
 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-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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

__
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] New to R

2012-05-14 Thread Sarah Goslee
Hi,

On Mon, May 14, 2012 at 12:44 PM, Bert Gunter gunter.ber...@gene.com wrote:
 I usually try google searches first. While not always successful, I am
 frequently surprised by how well it does.

rseek.org is simply a custom Google search for R-related things. It
does an even better job pulling out only R-related material, and
organizing it in a useful format.


 I strongly second the use of CRAN task views. IMHO, some fine folks
 have volunteered their time and efforts to produce this very well
 written series of guides to what's in R. It and they deserve greater
 recognition.

Absolutely.

Sarah
-- 
Sarah Goslee
http://www.sarahgoslee.com

__
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] new to R - text command - background color

2012-02-06 Thread Henry
update

Jim Lemon emailed me suggesting I look at boxed.labels in the plotrix
package.
I loaded the package, there were a few messages about directories/etc. but
somehow I got it  working.
I got the command to work, just what I wanted. 

Thanks to Jim


-Henry


--
View this message in context: 
http://r.789695.n4.nabble.com/new-to-R-text-command-background-color-tp4359778p4363401.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] New to R, Curious about Project Idea

2012-01-12 Thread Antonio Rodriges
Phil,

You should look onto sp package which is the base for any other
spatial packages in R
http://cran.r-project.org/web/packages/sp/index.html

Also notice Reverse depends section where you can find a lot of
useful packages for spatial operations and analysis.

For loading shape files, maptools, rgdal and similar packages will help you.

You can read on-line Applied Spatial Data Analysis with R
http://www.springerlink.com/content/978-0-387-78171-6#section=147788page=1
which contains a lot of examples to work and analyze spatial data in R
(the authors of the book are also the authors of sp and other
spatial packages in R)

Very important package is rgeos that contains all GIS functions:
covers, intersects, inside, 

You can also find ideas in
Clemens Reimann - Statistical Data Analysis Explained. Applied
Environmental Statistics with R – 2008
(however it does not contain R code)

 Good morning,

 I am a student whom is currently working on a term project for my GIS
 Program. I am looking for a software package which can aid me in my
 project,
 and I was curious if R would be able to address my goals.

 My project includes  power outage data from a hydro company (point data,
 with UTM coordinates attached), which is available in an Access database,
 or
 in a Shapefile.

 I would like to be able to take this poweroutage data, and then perform a
 spatial analysis of this data, perhaps as a hot-spot analysis, or in a
 points per raster square style analysis.

 With the completed analysis, I would like to be able to use an open source
 web mapping platform to display it for the 'company' I am performing this
 for as part of my project.


 Any insight you could provide me would be greatly, greatly appreciated.

 Thanks,

 Phil


Kind regards,
Antonio Rodriges

__
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] New to R, Curious about Project Idea

2012-01-11 Thread arbeaupg
Good morning,

I am a student whom is currently working on a term project for my GIS
Program. I am looking for a software package which can aid me in my project,
and I was curious if R would be able to address my goals.

My project includes  power outage data from a hydro company (point data,
with UTM coordinates attached), which is available in an Access database, or
in a Shapefile. 

I would like to be able to take this poweroutage data, and then perform a
spatial analysis of this data, perhaps as a hot-spot analysis, or in a
points per raster square style analysis. 

With the completed analysis, I would like to be able to use an open source
web mapping platform to display it for the 'company' I am performing this
for as part of my project. 


Any insight you could provide me would be greatly, greatly appreciated.

Thanks,

Phil

--
View this message in context: 
http://r.789695.n4.nabble.com/New-to-R-Curious-about-Project-Idea-tp4285576p4285576.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] New to R, Curious about Project Idea

2012-01-11 Thread R. Michael Weylandt
It sounds quite possible but you'll probably get more specialized help
if you ask on the r-sig-geo mailing list.

Michael

On Wed, Jan 11, 2012 at 9:36 AM, arbeaupg parb...@gmail.com wrote:
 Good morning,

 I am a student whom is currently working on a term project for my GIS
 Program. I am looking for a software package which can aid me in my project,
 and I was curious if R would be able to address my goals.

 My project includes  power outage data from a hydro company (point data,
 with UTM coordinates attached), which is available in an Access database, or
 in a Shapefile.

 I would like to be able to take this poweroutage data, and then perform a
 spatial analysis of this data, perhaps as a hot-spot analysis, or in a
 points per raster square style analysis.

 With the completed analysis, I would like to be able to use an open source
 web mapping platform to display it for the 'company' I am performing this
 for as part of my project.


 Any insight you could provide me would be greatly, greatly appreciated.

 Thanks,

 Phil

 --
 View this message in context: 
 http://r.789695.n4.nabble.com/New-to-R-Curious-about-Project-Idea-tp4285576p4285576.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 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] New to R, Curious about Project Idea

2012-01-11 Thread Daniel Nordlund
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
 On Behalf Of arbeaupg
 Sent: Wednesday, January 11, 2012 6:36 AM
 To: r-help@r-project.org
 Subject: [R] New to R, Curious about Project Idea
 
 Good morning,
 
 I am a student whom is currently working on a term project for my GIS
 Program. I am looking for a software package which can aid me in my
 project,
 and I was curious if R would be able to address my goals.
 
 My project includes  power outage data from a hydro company (point data,
 with UTM coordinates attached), which is available in an Access database,
 or
 in a Shapefile.
 
 I would like to be able to take this poweroutage data, and then perform a
 spatial analysis of this data, perhaps as a hot-spot analysis, or in a
 points per raster square style analysis.
 
 With the completed analysis, I would like to be able to use an open source
 web mapping platform to display it for the 'company' I am performing this
 for as part of my project.
 
 
 Any insight you could provide me would be greatly, greatly appreciated.
 
 Thanks,
 
 Phil
 

Not my area of expertise, but if you go to your favorite CRAN mirror and look 
at the task views, you will find info on spatial analysis.  Also, Googling 'R 
GIS' brings up a ton of hits.

Good luck,

Dan

Daniel Nordlund
Bothell, WA USA
 

__
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] new to R coding.

2011-10-25 Thread Robert Baer
Not quite sure what you were trying to do, but try the slight modification 
below and see if it works for you:
x = c (2434.1, 2463.7, 2451.6, 2444.5, 2431.3, 2436.3, 2412.6, 2417.9, 
2380.1,

 2366.2,
 2349.1, 2373.9, 2336.9, 2335.0, 2297.1, 2291.1, 2278.6, 2289.9, 2314.5, 
2328.8,
 2322.0, 2337.3, 2345.8, 2355.1, 2348.4, 2321.1, 2307.4, 2331.0, 2313.6, 
2286.9,
 2293.2, 2298.3, 2313.8, 2325.9, 2297.1, 2277.0, 2259.7, 2269.2, 2236.7, 
2249.3,
 2254.8, 2255.4, 2238.4, 2254.8, 2230.5, 2216.0, 2230.3, 2250.0, 2234.3, 
.8,
 2224.5, 2226.1, 2234.9, 2263.9, 2238.0, 2259.7, 2250.3, 2258.9, 2283.9, 
2298.2,

 2266.2, 2275.0, 2263.0, 2247.9, 2221.6, 2240.7, 2231.6, 2239.5, 2221.1)
#extraction of the stock index returns

n=length(x)
d=diff (log(x)) # daily log returns
# d is shorter than x
n=length(d)
# to get dx to index in the loop it must be defined before loop begins
dx = NULL
for (i in 2:n) {
dx[i]=(d[i])/(d[i-1])
# delta doesn't really do anything so I commented out
# delta=dx[i]
} # this is what I have tried to do.


-Original Message- 
From: tynashy

Sent: Monday, October 24, 2011 11:29 AM
To: r-help@r-project.org
Subject: Re: [R] new to R coding.


I am new to R coding and I am trying to model the returns on the ftse100
since 1990. I have got a vector with all the closing values on each trading
day. however, instead of using the difference in the closing values of two
consecutive days, (ie dx=diff(x) where x is the vector containing the
closing values), i wanted to use the quotient of the two closing values. I
have tried the following without any luck


x = c (2434.1 2463.7 2451.6 2444.5 2431.3 2436.3 2412.6 2417.9 2380.1
2366.2

 2349.1 2373.9 2336.9 2335.0 2297.1 2291.1 2278.6 2289.9 2314.5 2328.8
 2322.0 2337.3 2345.8 2355.1 2348.4 2321.1 2307.4 2331.0 2313.6 2286.9
 2293.2 2298.3 2313.8 2325.9 2297.1 2277.0 2259.7 2269.2 2236.7 2249.3
 2254.8 2255.4 2238.4 2254.8 2230.5 2216.0 2230.3 2250.0 2234.3 .8
 2224.5 2226.1 2234.9 2263.9 2238.0 2259.7 2250.3 2258.9 2283.9 2298.2
 2266.2 2275.0 2263.0 2247.9 2221.6 2240.7 2231.6 2239.5 2221.1)
#extraction of the stock index returns


n=length(x)
d=diff (log(x)) # daily log returns



for (i in 2:n) {

+ dx[i]=(d[i])/(d[i-1])
+ delta=dx[i]
+ } # this is what I have tried to do.
how do i do this properly in R please.


--
View this message in context: 
http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933738.html

Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


--
Robert W. Baer, Ph.D.
Professor of Physiology
Kirksville College of Osteopathic Medicine
A. T. Still University of Health Sciences
800 W. Jefferson St.
Kirksville, MO 63501
660-626-2322
FAX 660-626-2965

__
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] new to R coding.

2011-10-24 Thread tynashy
how do I code the following in R. I want to produce a vector where dx=log(
(d(x))/(d(x-1)) ). I can do it for dx=diff(log(x)). I am learning/trying to
model log returns of a stock market index. But instead of using the
difference of the closing values of two consecutive days, i want to use the
log of the quotient of the two days. any help is most appreciated. d is a
vector of the closing values of the stock market index of length 5000.

--
View this message in context: 
http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933588.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] new to R coding.

2011-10-24 Thread R. Michael Weylandt
Assuming that d(x) is equal to x, (I don't know a d() function in R)
these should be the same.

log(a/b) = log(a) - log(b) = diff(log(c(a,b))

If you mean simple returns instead of continuous/log returns, perhaps try this:

x[-1]/x[-length(x)] - 1

Michael

On Mon, Oct 24, 2011 at 11:44 AM, tynashy tyna...@yahoo.co.uk wrote:
 how do I code the following in R. I want to produce a vector where dx=log(
 (d(x))/(d(x-1)) ). I can do it for dx=diff(log(x)). I am learning/trying to
 model log returns of a stock market index. But instead of using the
 difference of the closing values of two consecutive days, i want to use the
 log of the quotient of the two days. any help is most appreciated. d is a
 vector of the closing values of the stock market index of length 5000.

 --
 View this message in context: 
 http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933588.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 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] new to R coding.

2011-10-24 Thread R. Michael Weylandt
Try it yourself:

x = seq(1, 11, by = 2)

diff(log(x))
log(x[-1]/x[-length(x)])
all.equal(diff(log(x)), log(x[-1]/x[-length(x)]))

It seems like you don't really understand logs / log returns and why
they are used by some in quant finance: might I suggest you read this:
http://quantivity.wordpress.com/2011/02/21/why-log-returns/

My quick explanation is that log returns aggregate nicely over time
while simple returns aggregate nicely over a portfolio. Thus, for a
single instrument portfolio, log returns play very nicely with
vectorized thinking in R.

Michael

On Mon, Oct 24, 2011 at 12:39 PM,  tyna...@yahoo.co.uk wrote:
 lets say
 x(t)=c(1,3,5,7,9,11) #value of the index at close of trading day

 does this mean these two are the same?
 d(t) = diff(log( x(t) ) and  d(t) = log ( x(t)/x(t-1) )


 quote author='Michael Weylandt'
 Assuming that d(x) is equal to x, (I don't know a d() function in R)
 these should be the same.

 log(a/b) = log(a) - log(b) = diff(log(c(a,b))

 If you mean simple returns instead of continuous/log returns, perhaps try
 this:

 x[-1]/x[-length(x)] - 1

 Michael

 On Mon, Oct 24, 2011 at 11:44 AM, tynashy tyna...@yahoo.co.uk wrote:
 how do I code the following in R. I want to produce a vector where dx=log(
 (d(x))/(d(x-1)) ). I can do it for dx=diff(log(x)). I am learning/trying
 to
 model log returns of a stock market index. But instead of using the
 difference of the closing values of two consecutive days, i want to use
 the
 log of the quotient of the two days. any help is most appreciated. d is a
 vector of the closing values of the stock market index of length 5000.

 --
 View this message in context:
 http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933588.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 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.

 /quote
 Quoted from:
 http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933681.html


__
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] new to R coding.

2011-10-24 Thread tynashy

I am new to R coding and I am trying to model the returns on the ftse100
since 1990. I have got a vector with all the closing values on each trading
day. however, instead of using the difference in the closing values of two
consecutive days, (ie dx=diff(x) where x is the vector containing the
closing values), i wanted to use the quotient of the two closing values. I
have tried the following without any luck 

 x = c (2434.1 2463.7 2451.6 2444.5 2431.3 2436.3 2412.6 2417.9 2380.1
 2366.2
  2349.1 2373.9 2336.9 2335.0 2297.1 2291.1 2278.6 2289.9 2314.5 2328.8
  2322.0 2337.3 2345.8 2355.1 2348.4 2321.1 2307.4 2331.0 2313.6 2286.9
  2293.2 2298.3 2313.8 2325.9 2297.1 2277.0 2259.7 2269.2 2236.7 2249.3
  2254.8 2255.4 2238.4 2254.8 2230.5 2216.0 2230.3 2250.0 2234.3 .8
  2224.5 2226.1 2234.9 2263.9 2238.0 2259.7 2250.3 2258.9 2283.9 2298.2
  2266.2 2275.0 2263.0 2247.9 2221.6 2240.7 2231.6 2239.5 2221.1)
#extraction of the stock index returns

 n=length(x)
 d=diff (log(x)) # daily log returns

 for (i in 2:n) {
+ dx[i]=(d[i])/(d[i-1])
+ delta=dx[i]
+ } # this is what I have tried to do. 
how do i do this properly in R please.


--
View this message in context: 
http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933738.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] new to R coding.

2011-10-24 Thread R. Michael Weylandt
I believe I already showed you how to do this (though your code
doesn't seem to do what your words ask, so I'm not sure which one to
answer), but didn't draw attention to it:

x[-1]/x[-length(x)]

This creates two vectors, one consisting of everything but the first
element of x and the other of everything but the last, and divides
them, which gives the consecutive quotients you want.

Also, if you would, next time you provide sample data (which is a
wonderful thing to do) -- provide it in a directly pastable format
(i.e., with commas for c()). The easiest way to get such data is just
to dput(x) and copy the output.

E.g., for this data I have lying around:


P = c(128.59, 128.87, 127.84, 128.43, 128.32, 128.75, 129.31, 130.29,
130.04, 130.09, 129.66, 129.91, 129.51, 129.89, 130.94, 129.4,
129.28, 129.21, 129.88, 130.76, 131.54, 131.72, 131.76, 131.79,
132.09, 131.91, 130.93, 130.49, 131.59, 132.45, 132.62, 132.56,
132.84, 132.79, 132.69, 132.17, 132.05, 126.89, 128.19, 127.81,
126.14, 124.94, 127.07, 126.95, 128.02, 128.06, 128.25, 125.76,
126.69, 126.86, 126.51, 128.03, 128.74, 130.86, 130.76, 130.95,
130.77, 130.46, 129.51, 129.65, 129.68, 129.82, 131.22, 131.37,
131.72, 131.91, 132.06, 131.52, 132.11, 132.71, 133.97, 134.33,
134.49, 134.45, 135.72, 135.21, 135.27, 136.51, 136.66, 136.56,
135.42, 135.77, 136.56, 137.3, 137.82, 137.85, 137.67, 138.04,
136.6, 137.77, 137.47, 137.5, 138.45, 138.17, 139.38, 139.3,
139.19, 139.21, 137.95, 138.53)

we get

head(P[-1]/P[-length(P)])
1.0021775 0.9920074 1.0046151 0.9991435 1.0033510 1.0043495

which I believe is what you are after.

Michael

On Mon, Oct 24, 2011 at 12:29 PM, tynashy tyna...@yahoo.co.uk wrote:

 I am new to R coding and I am trying to model the returns on the ftse100
 since 1990. I have got a vector with all the closing values on each trading
 day. however, instead of using the difference in the closing values of two
 consecutive days, (ie dx=diff(x) where x is the vector containing the
 closing values), i wanted to use the quotient of the two closing values. I
 have tried the following without any luck

 x = c (2434.1 2463.7 2451.6 2444.5 2431.3 2436.3 2412.6 2417.9 2380.1
 2366.2
  2349.1 2373.9 2336.9 2335.0 2297.1 2291.1 2278.6 2289.9 2314.5 2328.8
  2322.0 2337.3 2345.8 2355.1 2348.4 2321.1 2307.4 2331.0 2313.6 2286.9
  2293.2 2298.3 2313.8 2325.9 2297.1 2277.0 2259.7 2269.2 2236.7 2249.3
  2254.8 2255.4 2238.4 2254.8 2230.5 2216.0 2230.3 2250.0 2234.3 .8
  2224.5 2226.1 2234.9 2263.9 2238.0 2259.7 2250.3 2258.9 2283.9 2298.2
  2266.2 2275.0 2263.0 2247.9 2221.6 2240.7 2231.6 2239.5 2221.1)
 #extraction of the stock index returns

 n=length(x)
 d=diff (log(x)) # daily log returns

 for (i in 2:n) {
 + dx[i]=(d[i])/(d[i-1])
 + delta=dx[i]
 + } # this is what I have tried to do.
 how do i do this properly in R please.


 --
 View this message in context: 
 http://r.789695.n4.nabble.com/new-to-R-coding-tp3933588p3933738.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 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.


[R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Karen R. Khar
Hi,

I'm mighty new to R. I'm using it on Windows. I'm trying to cluster using a
distance matrix I created from the data on my own and called it D10.dist. I
loaded the cluster package. Then tried the following command...

 agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand = FALSE,
 method = average, par.method, keep.diss = n  1000, keep.data = !diss)

And it responded...

Error in agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand =
FALSE,  : 
  x is not and cannot be converted to class dissimilarity

D10.dist has the following data...

D1  0
D2  0.6083920
D3  0.4974510.5376620
D4  0.6345480.3933430.5374260
D5  0.5587850.5433990.6322210.7266330
D6  0.6594830.7017780.7414250.668624
0.6559140
D7  0.6030120.6591730.5717760.687599
0.3837120.6839480
D8  0.6119190.6653570.5264530.715093
0.4574960.6982130.3170390
D9  0.41501 0.6521170.5520110.68969 0.485988
0.7027380.42819 0.4425980
D10 0.3765120.6006070.5178570.673515
0.5304210.6677360.5370250.48062
0.2405590

I would appreciate any suggestions. Please assume I know virtually nothing
about R.

Thanks,
Karen

PS I'll eventually be using ~10,000 species to cluster. I'll need to have
within and between cluster distance info and I'll want a plot colored by
cluster. I agnes the right R tool to use?

--
View this message in context: 
http://r.789695.n4.nabble.com/New-to-R-trying-to-use-agnes-but-can-t-load-my-ditance-matrix-tp3627154p3627154.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Karen R. Khar
I also tried...
  D1  D2  D3  D4  D5  D6  D7  D8  D9
D2  0.608392
D3  0.4974510.537662
D4  0.6345480.3933430.537426
D5  0.5587850.5433990.6322210.726633
D6  0.6594830.7017780.7414250.668624   
0.655914
D7  0.6030120.6591730.5717760.687599   
0.3837120.683948
D8  0.6119190.6653570.5264530.715093   
0.4574960.6982130.317039
D9  0.41501 0.6521170.5520110.68969  0.485988   
0.7027380.42819  0.442598
D10 0.3765120.6006070.5178570.673515   
0.5304210.667736  0.5370250.48062  0.240559 

--
View this message in context: 
http://r.789695.n4.nabble.com/New-to-R-trying-to-use-agnes-but-can-t-load-my-ditance-matrix-tp3627154p3627658.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Sarah Goslee
On Mon, Jun 27, 2011 at 3:43 AM, Karen R. Khar karen.k...@gmail.com wrote:
 Hi,

 I'm mighty new to R. I'm using it on Windows. I'm trying to cluster using a
 distance matrix I created from the data on my own and called it D10.dist. I
 loaded the cluster package. Then tried the following command...

 agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand = FALSE,
 method = average, par.method, keep.diss = n  1000, keep.data = !diss)
 And it responded...

 Error in agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand =
 FALSE,  :
  x is not and cannot be converted to class dissimilarity


At a guess, you need to actually import D10.dist into R. It looks like
you're trying to give agnes() a string that contains the path to the
file, but agnes() just sees that as a string, and of course can't
figure out what to do with it.

 D10.dist has the following data...

 D1      0
 D2      0.608392        0
 D3      0.497451        0.537662        0
 D4      0.634548        0.393343        0.537426        0
 D5      0.558785        0.543399        0.632221        0.726633        0
 D6      0.659483        0.701778        0.741425        0.668624        
 0.655914        0
 D7      0.603012        0.659173        0.571776        0.687599        
 0.383712        0.683948        0
 D8      0.611919        0.665357        0.526453        0.715093        
 0.457496        0.698213        0.317039        0
 D9      0.41501 0.652117        0.552011        0.68969 0.485988        
 0.702738        0.42819 0.442598        0
 D10     0.376512        0.600607        0.517857        0.673515        
 0.530421        0.667736        0.537025        0.48062
 0.240559        0

If you can convince whatever software you used to write out a full
symmetric matrix instead of a lower-triangular matrix, you can easily
use read.table() to import it.

 I would appreciate any suggestions. Please assume I know virtually nothing
 about R.

Then Karen, my first suggestion is that you read one of the many
excellent intro to R guides available online.

Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org

__
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] New to R, trying to use agnes, but can't load my ditance matrix

2011-06-27 Thread Bill.Venables
The first problem is that you are using a character string as the first 
argument to agnes()

The help information for agnes says that its first argument, x, is


   x: data matrix or data frame, or dissimilarity matrix, depending
  on the value of the 'diss' argument.

Not a character string.  So first you have to read your data into R and hold it 
as a data matrix or data frame.  Then you have a choice.  Either you can 
calculate your own distance matrix with it and then call agnes() with that as 
the first argument (and with diss = TRUE) or you can get agnes() to calculate 
the distance matrix for you, in which case you need to specify how, using the 
metric = argument.

With 1 entities to cluster, your distance matrix will require

 1*/2
[1] 49995000

numbers to be stored at once.  I hope you are using a 64-bit OS!

With such large numbers of entities to cluster, the usual advice is to try 
something more suited to the job.  clara() is designed for this kind of problem.

It might be useful to keep in mind that R is not a package.  (Repeat: R is NOT 
a package - I cannot stress that strongly enough.)  It is a programming 
language. To use it effectively you really need to know something about how it 
works, first.  It might pay you to spend a little time getting used to the 
protocols, how to do simple things in R like reading in data and manipulating 
it, before you tackle such a large and potentially tricky clustering problem.

Bill Venables. 

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Karen R. Khar
Sent: Monday, 27 June 2011 5:44 PM
To: r-help@r-project.org
Subject: [R] New to R, trying to use agnes, but can't load my ditance matrix

Hi,

I'm mighty new to R. I'm using it on Windows. I'm trying to cluster using a
distance matrix I created from the data on my own and called it D10.dist. I
loaded the cluster package. Then tried the following command...

 agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand = FALSE,
 method = average, par.method, keep.diss = n  1000, keep.data = !diss)

And it responded...

Error in agnes(E:D10.dist, diss = TRUE, metric = euclidean, stand =
FALSE,  : 
  x is not and cannot be converted to class dissimilarity

D10.dist has the following data...

D1  0
D2  0.6083920
D3  0.4974510.5376620
D4  0.6345480.3933430.5374260
D5  0.5587850.5433990.6322210.7266330
D6  0.6594830.7017780.7414250.668624
0.6559140
D7  0.6030120.6591730.5717760.687599
0.3837120.6839480
D8  0.6119190.6653570.5264530.715093
0.4574960.6982130.3170390
D9  0.41501 0.6521170.5520110.68969 0.485988
0.7027380.42819 0.4425980
D10 0.3765120.6006070.5178570.673515
0.5304210.6677360.5370250.48062
0.2405590

I would appreciate any suggestions. Please assume I know virtually nothing
about R.

Thanks,
Karen

PS I'll eventually be using ~10,000 species to cluster. I'll need to have
within and between cluster distance info and I'll want a plot colored by
cluster. I agnes the right R tool to use?

--
View this message in context: 
http://r.789695.n4.nabble.com/New-to-R-trying-to-use-agnes-but-can-t-load-my-ditance-matrix-tp3627154p3627154.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
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] new to R need urgent help!

2011-06-24 Thread StellathePug
I have taught myself R over the last few months and I learned quite a bit
from reading the PDFs that accompany each package, articles on the R Journal
(http://journal.r-project.org/) that cover similar problems to mine, and by
asking specific questions about code to this list. I also search online for
answers to questions similar to mine. Sometimes I even read other people's
code that has been posted online because they often include explanations and
I can learn new ways of coding things. I am still not proficient but I think
that might come with years of practice. 

Good luck

--
View this message in context: 
http://r.789695.n4.nabble.com/new-to-R-need-urgent-help-tp3621329p3622632.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] new to R need urgent help!

2011-06-23 Thread elisheva corn
hi all-

I am doing some research, have never used R before until today and need to
understand the following program for a project.
if some one could PLEASE help me understand this program ASAP i would
GREATLY appreciate it (any syntax/ statistic comments would be great)

PLEASE PLEASE HELP!!  THANKYOU!!!
-on a side note, it seems to me that R doesnt include the pv, and it was
calculated seperatly, is this true?


 fit=gee(foci~as.factor(time)*cond,id=exper,data=drt,family=poisson(link =
log))
Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
running glm to get initial regression estimate
  (Intercept) as.factor(time)24
 3.051177 -2.705675
  condHypoxia as.factor(time)24:condHypoxia
-0.402259  1.429034
 pv=2*(1-pnorm(abs(summary(fit)$coef[,5])))
 data.frame(summary(fit)$coef,pv)
   Estimate Naive.S.E.   Naive.z Robust.S.E.
Robust.z
(Intercept)3.051177 0.02221052 137.37527  0.04897055
62.306363
as.factor(time)24 -2.705675 0.10890056 -24.84537  0.19987174
-13.537057
condHypoxia   -0.402259 0.03907961 -10.29332  0.10661248
-3.773095
as.factor(time)24:condHypoxia  1.429034 0.12549576  11.38711  0.17867421
7.997988
pv
(Intercept)   0.00e+00
as.factor(time)24 0.00e+00
condHypoxia   1.612350e-04
as.factor(time)24:condHypoxia 1.332268e-15
 ftable(table(drt$cond,drt$time,predict(fit)))
 0.345501643340608 1.37227675004058 2.64891772174934
3.05117673373261


Oxia0.5  00
0  485
24 3150
00
Hypoxia 0.5  00
3460
24   0  449
00
 ## 3-th term gives the difference between the Hypoxia/Oxia at time=0.5
 ## the difference between Hypoxia/Oxia at time=24
 L=matrix(c(0,0,1,1),nrow=1)
 fit$coef[L==1]
  condHypoxia as.factor(time)24:condHypoxia
-0.402259  1.429034
 L%*%fit$coef
 [,1]
[1,] 1.026775
 wald.test(fit$robust.variance,fit$coef,L=L)
Wald test:
--

Chi-squared test:
X2 = 23.8, df = 1, P( X2) = 1.1e-06


[[alternative HTML version deleted]]

__
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] new to R need urgent help!

2011-06-23 Thread Abhijit Dasgupta
On Jun 23, 2011, at 4:42 PM, elisheva corn elishevac...@gmail.com wrote:

 hi all-
 
 I am doing some research, have never used R before until today and need to
 understand the following program for a project.
 if some one could PLEASE help me understand this program ASAP i would
 GREATLY appreciate it (any syntax/ statistic comments would be great)
 
 PLEASE PLEASE HELP!!  THANKYOU!!!
 -on a side note, it seems to me that R doesnt include the pv, and it was
 calculated seperatly, is this true?
 
 
 fit=gee(foci~as.factor(time)*cond,id=exper,data=drt,family=poisson(link =
 log))
You apparently have count data (foci) which is measured repeatedly within 
exper, and you're interested in how foci changes with time and condition 
including their interaction. The code fits a generalized estimating equation 
(GEE) model, which can be an appropriate model for repeated measures data. See, 
for example, Diggle, Liang, Zeger  Heagerty for background. 
 Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27
 running glm to get initial regression estimate
  (Intercept) as.factor(time)24
 3.051177 -2.705675
  condHypoxia as.factor(time)24:condHypoxia
-0.402259  1.429034
 pv=2*(1-pnorm(abs(summary(fit)$coef[,5])))
 data.frame(summary(fit)$coef,pv)

The gee package doesn't compute the value directly, though other functions like 
lm, glm and others do.  What the code does is use the robust z statistic, which 
is the estimate/robust se, and relate it to the standard normal distribution. 
   Estimate Naive.S.E.   Naive.z Robust.S.E.
 Robust.z
 (Intercept)3.051177 0.02221052 137.37527  0.04897055
 62.306363
 as.factor(time)24 -2.705675 0.10890056 -24.84537  0.19987174
 -13.537057
 condHypoxia   -0.402259 0.03907961 -10.29332  0.10661248
 -3.773095
 as.factor(time)24:condHypoxia  1.429034 0.12549576  11.38711  0.17867421
 7.997988
pv
 (Intercept)   0.00e+00
 as.factor(time)24 0.00e+00
 condHypoxia   1.612350e-04
 as.factor(time)24:condHypoxia 1.332268e-15
 ftable(table(drt$cond,drt$time,predict(fit)))
 0.345501643340608 1.37227675004058 2.64891772174934
 3.05117673373261
 
 
 Oxia0.5  00
 0  485
24 3150
 00
 Hypoxia 0.5  00
 3460
24   0  449
 00
 ## 3-th term gives the difference between the Hypoxia/Oxia at time=0.5
 ## the difference between Hypoxia/Oxia at time=24
 L=matrix(c(0,0,1,1),nrow=1)
 fit$coef[L==1]
  condHypoxia as.factor(time)24:condHypoxia
-0.402259  1.429034
 L%*%fit$coef
 [,1]
 [1,] 1.026775
 wald.test(fit$robust.variance,fit$coef,L=L)
 Wald test:
 --
 
 Chi-squared test:
 X2 = 23.8, df = 1, P( X2) = 1.1e-06
 
 
[[alternative HTML version deleted]]
 
 __
 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-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] NEW ONLINE R COURSE: Fundamentals of Using R

2011-04-17 Thread Geoffrey Hubona
EARLY REGISTRATION ENDS APRIL 22



The non-profit organization *Information Institute* (
http://www.information-institute.org) and faculty from Virginia Commonwealth
University (VCU) are offering a live, interactive, synchronous online course
entitled Fundamentals of Using R. The early registration cost (through April
22) for the 14-hour, 5 week course is $195 (student); $250 (faculty); and
$295 (practitioner). All of the live class sessions that
registered participants attend are recorded and provided to those
participants so they can repeatedly review the live sessions at their
convenience.



This course is designed for people who are curious about R, new to R, and
who would like to obtain a basic knowledge of R capabilities that apply to
any ultimate intended use of R. This course instructs about the R
environment: using workspaces; importing and exporting data; R data types,
data structures, and objects; writing simple and complex scripts; essential
R functions and packages; writing your own R functions and packages;
programming with R; publication-style 2-D and 3-D graphics capabilities
using special R packages, and many other essential topics. The course is
designed to serve as a useful knowledge foundation regardless of one’s
ultimate use of R (for example, statistical and data analyses, programming,
writing scripts or creating packages, using graphics, etc.). There is more
information at the URLs below.



The informational (and registration) site for the AM version (AM by US
Eastern Time) is here: https://www.regonline.com/R-fund-may-AM This course
runs on five consecutive Fridays from May 27 to June 24, from 11AM until 2PM
ET (GMT-4).



The informational (and registration) site for the PM version (PM by US
Eastern Time) is here: https://www.regonline.com/R-fund-may-PM  This course
runs on the same five consecutive Fridays (May 27-June 24), but in the
evenings from 6PM until 9PM ET (GMT-4).



Please email ghub...@vcu.edu with any questions or for more information.



Geoff Hubona

Information Systems Department

Virginia Commonwealth University

[[alternative HTML version deleted]]

__
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] new to R: don't understand errors

2011-02-15 Thread apc3n

Did you have any other warnings going on.  I had this same error and fix it
because I got a bunch of words that after stemming and number removal some
of my files were blank.  After deleting these files I made the textmatrix
fine.  I think when it tries to make the dataframe there is a mismatch
between the number of file that were named and the number that actually have
any usable text in them if you have blank files.

Peace,

Andrew Cassidy
-- 
View this message in context: 
http://r.789695.n4.nabble.com/R-new-to-R-don-t-understand-errors-tp809147p3308111.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] New to R

2010-08-30 Thread Josh HIll
I'm relatively new to R, and not particularly adept yet, but I was wondering
if there was a simply way to simulate missing data that are MAR, MNAR and
MCAR. I've got a good work-around for the MCAR data, but it's sort of hard
to work with.

Josh

[[alternative HTML version deleted]]

__
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] New to R

2010-08-30 Thread Dennis Murphy
Hi:

Try this:

library(sos) # install from CRAN if you don't have it
findFn('imputation')

I got 285 hits. That should be enough to get you started.

Here's a recent paper about how to use sos from the R Journal (Dec. 2009):
http://journal.r-project.org/archive/2009-2/RJournal_2009-2_Graves~et~al.pdf

HTH,
Dennis

On Mon, Aug 30, 2010 at 1:15 PM, Josh HIll jh...@isvg.org wrote:

 I'm relatively new to R, and not particularly adept yet, but I was
 wondering
 if there was a simply way to simulate missing data that are MAR, MNAR and
 MCAR. I've got a good work-around for the MCAR data, but it's sort of hard
 to work with.

 Josh

[[alternative HTML version deleted]]

 __
 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.


[[alternative HTML version deleted]]

__
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] new to R, analysis of latency data

2010-04-05 Thread jeff d

Hi,

  I'd like to move from excel to R because our dataset are so large. Here's
what my data looks like:

Transaction Rate   Run#   Transaction TypeLocationLatency in
Seconds
   101   Order 
A0
   101   Order 
B3
   101   Order 
C1
   101   Order 
D2
   101   ACK   
A0
   101   ACK   
B5
   101   ACK   
C2
   101   ACK   
D2
   101   FILL   
A0
   101   FILL   
B2
   101   FILL   
C3
   101   FILL   
D2

- we have about 1000 runs per transaction rate (run# 1..1000)
- we have 50 transaction rates (transaction rate 10..500 incrementing by 10)

We'd like to be able to create a graph where:
- Y axis = 95 pecentile latency of transaction type data (order, ack, fill)
- X axis = transaction rate

I've read the basic doc, created some simple plots, could someone get me
going in the right direction?

tia,
jd


  
-- 
View this message in context: 
http://n4.nabble.com/new-to-R-analysis-of-latency-data-tp1752096p1752096.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] new to R, analysis of latency data

2010-04-05 Thread Dennis Murphy
Hi:

I'll use some fake data to show you how to get the plots. To get the data
from Excel into
R, there are several ways to do it: converting the Excel file into csv and
using read.csv() in
R is one method and the XLSReadWrite package is another. Here's a link from
the R Wiki:
http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windowss=read%20excel

It sounds like what you want is a plot of the 95th percentiles of the
latency by
transaction rate for each transaction type. Here are a couple of ways to do
that using
some fake data.

df - data.frame(rate = rep(seq(10, 50, by = 10), each = 12),
 type = rep(rep(c('Order', 'ACK', 'FILL'), each = 4), 5),
 latency = rpois(60, 3))
library(ggplot2)
library(lattice)

# get 95th percentiles
# Several ways to do this; I'll use ddply() from the plyr package (which
loads with ggplot2)
latq95 - ddply(df, .(rate, type), summarise, lq95 = quantile(latency,
0.95))

# ggplot2 way to get the graph:
p - ggplot(latq95, aes(x = rate, y = lq95, shape = type))
p + geom_point(size = 2) + geom_line() +
  xlab('Transaction rate') + ylab('95th percentile')

# lattice method of getting the graph:
xyplot(lq95 ~ rate, data = latq95, groups = type, type = c('p', 'l'),
   xlab = 'Transaction rate', ylab = '95th percentile',
   auto.key = list(text = levels(latq95$type), space = 'right',
  points = FALSE, lines = TRUE))

Hope this is what you were after...

Dennis


On Mon, Apr 5, 2010 at 1:55 PM, jeff d jdavid...@forwardthinkgroup.comwrote:


 Hi,

  I'd like to move from excel to R because our dataset are so large. Here's
 what my data looks like:

 Transaction Rate   Run#   Transaction TypeLocationLatency
 in
 Seconds
   101   Order
 A0
   101   Order
 B3
   101   Order
 C1
   101   Order
 D2
   101   ACK
 A0
   101   ACK
 B5
   101   ACK
 C2
   101   ACK
 D2
   101   FILL
 A0
   101   FILL
 B2
   101   FILL
 C3
   101   FILL
 D2

 - we have about 1000 runs per transaction rate (run# 1..1000)
 - we have 50 transaction rates (transaction rate 10..500 incrementing by
 10)

 We'd like to be able to create a graph where:
 - Y axis = 95 pecentile latency of transaction type data (order, ack, fill)
 - X axis = transaction rate

 I've read the basic doc, created some simple plots, could someone get me
 going in the right direction?

 tia,
 jd



 --
 View this message in context:
 http://n4.nabble.com/new-to-R-analysis-of-latency-data-tp1752096p1752096.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


[[alternative HTML version deleted]]

__
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] new to R Project

2010-02-22 Thread Dr. David Kirkby

chinna wrote:

hi everyone,
i am new to R project can anyone please help me by providing documents

my goal is using R i have to connect to the database and i have to generate
reports.

Thanks in advance
chinna.


R is a complex program. If you can't work out how to find the documentation, I 
doubt you will be able to use R.


Dave

__
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] new to R Project

2010-02-22 Thread Ivan Calandra

Hi!
You should first go to the home page of the R project and read the 
manuals available there (and there are a lot).
When you'll understand how R works, read the posting guide and ask 
specific questions.

I don't think you'll get answers if you have such imprecise questions.
Ivan

Le 2/22/2010 14:07, Dr. David Kirkby a écrit :

chinna wrote:

hi everyone,
i am new to R project can anyone please help me by providing 
documents


my goal is using R i have to connect to the database and i have to 
generate

reports.

Thanks in advance
chinna.


R is a complex program. If you can't work out how to find the 
documentation, I doubt you will be able to use R.


Dave

__
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-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] new to R Project

2010-02-22 Thread spencerg

Hi, Ivan:


	  Are you trying to read standard text or csv files?  If yes, then try 
?read.table at a command prompt.



	  Or are you trying to connect directly from R to a database system? 
If yes, which database system?  This can be done from R, but as far as I 
know, finding the functions and documentation on how to do this is not 
trivial.



  To look at this, I tried the following:


library(sos)
db - ???database


	  This requires the sos package, which you can get from CRAN using 
install.packages('sos'), for example.



	  This command ???database identified 892 help pages that matched the 
search term database.  It returned a data.frame (like a matrix 
allowing different classes of objects in different columns) of class 
findFn (see ?findFn) of the 400 of these 892 with the strongest 
matches to the search term.



summary(db)


	  This gave me a summary by package of these first 400 help pages. 
I've found it useful to get all the matches, not merely the first 400, 
and look at the summary of those:


db9 - ???database(999)
summary(db9)

   Package Count MaxScore TotalScore   Date
1   seqinr41   34292 2009-11-26
2  emu32   38412 2009-11-26
3   RMySQL23   57217 2009-04-16
4  RPostgreSQL23   54178 2009-11-05
5  ROracle22   54158 2008-06-14
6  RSQLite22   35206 2010-02-13
7 maps19   24142 2010-02-13
8  DBI18   42177 2010-01-09
9   TRAMPR17   26114 2007-06-30
10  GO174 68 2005-07-23
11   RODBC14   31160 2009-10-19
12   GRASS13   25 39 2010-01-29


	  This tells you that there are packages RMySQL, RPostgreSQL, ROracle, 
RSQLite, and RODBC, plus other packages whose names sound to me like 
they might be less useful for this.



	  However, if you use a particular database, you might be wise looking 
for that particular database, e.g., by ???Oracle.  This just gave me 
many more options not on the above list.



  Hope this helps.
  Spencer Graves


Hi!
You should first go to the home page of the R project and read the 
manuals available there (and there are a lot).
When you'll understand how R works, read the posting guide and ask 
specific questions.

I don't think you'll get answers if you have such imprecise questions.
Ivan

Le 2/22/2010 14:07, Dr. David Kirkby a écrit :

chinna wrote:

hi everyone,
i am new to R project can anyone please help me by providing
documents

my goal is using R i have to connect to the database and i have to
generate
reports.

Thanks in advance
chinna.


R is a complex program. If you can't work out how to find the
documentation, I doubt you will be able to use R.

Dave

__
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-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-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] new to R Project

2010-02-22 Thread spencerg

Hi, Ivan:


	 p.s.  If you'd like to generate reports using LaTeX, I suggest you 
also try (LaTeX - ???LaTeX).


###
	  Are you trying to read standard text or csv files?  If yes, then try 
?read.table at a command prompt.



	  Or are you trying to connect directly from R to a database system? If 
yes, which database system?  This can be done from R, but as far as I 
know, finding the functions and documentation on how to do this is not 
trivial.



  To look at this, I tried the following:


library(sos)
db - ???database


	  This requires the sos package, which you can get from CRAN using 
install.packages('sos'), for example.



	  This command ???database identified 892 help pages that matched the 
search term database.  It returned a data.frame (like a matrix 
allowing different classes of objects in different columns) of class 
findFn (see ?findFn) of the 400 of these 892 with the strongest 
matches to the search term.



summary(db)


	  This gave me a summary by package of these first 400 help pages. I've 
found it useful to get all the matches, not merely the first 400, and 
look at the summary of those:


db9 - ???database(999)
summary(db9)

   Package Count MaxScore TotalScore   Date
1   seqinr41   34292 2009-11-26
2  emu32   38412 2009-11-26
3   RMySQL23   57217 2009-04-16
4  RPostgreSQL23   54178 2009-11-05
5  ROracle22   54158 2008-06-14
6  RSQLite22   35206 2010-02-13
7 maps19   24142 2010-02-13
8  DBI18   42177 2010-01-09
9   TRAMPR17   26114 2007-06-30
10  GO174 68 2005-07-23
11   RODBC14   31160 2009-10-19
12   GRASS13   25 39 2010-01-29


	  This tells you that there are packages RMySQL, RPostgreSQL, ROracle, 
RSQLite, and RODBC, plus other packages whose names sound to me like 
they might be less useful for this.



	  However, if you use a particular database, you might be wise looking 
for that particular database, e.g., by ???Oracle.  This just gave me 
many more options not on the above list.



  Hope this helps.
  Spencer Graves


Hi!
You should first go to the home page of the R project and read the 
manuals available there (and there are a lot).
When you'll understand how R works, read the posting guide and ask 
specific questions.

I don't think you'll get answers if you have such imprecise questions.
Ivan

Le 2/22/2010 14:07, Dr. David Kirkby a écrit :

chinna wrote:

hi everyone,
i am new to R project can anyone please help me by providing
documents

my goal is using R i have to connect to the database and i have to
generate
reports.

Thanks in advance
chinna.


R is a complex program. If you can't work out how to find the
documentation, I doubt you will be able to use R.

Dave

__
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-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-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] new to R Project

2010-02-21 Thread chinna

hi everyone,
i am new to R project can anyone please help me by providing documents

my goal is using R i have to connect to the database and i have to generate
reports.

Thanks in advance
chinna.
-- 
View this message in context: 
http://n4.nabble.com/new-to-R-Project-tp1564104p1564104.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] New York R Meetup

2009-03-12 Thread Joshua Reich
Hi,

After hearing good things about the R community over on the west coast, I
have started a New York based R meetup group. We intend to have our first
get together on Thursday April 2nd, at 7pm. For more details pop on over to
http://meetup.com/nyhackr

Regards,

Josh

-- 
Joshua Reich
646 256 4763
i2pi
simplicity . depth . scalability

[[alternative HTML version deleted]]

__
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] New to R

2009-02-02 Thread Joe Hughes

Hello All,

	A colleague of mine started working with R and out of curiosity I did  
some research on the language.  Very nice.  In my opinion this is one  
of the best languages I've found for getting tasks I'm interested in  
done.  I wrote this simple die roller and was curious to know if it is  
R enough.


##
#
# Input:
#   die_size - 4, 6, 8, 10, 20
#   number_of_dice - How many dice to roll
#   number_of_rolls - How many times to roll the dice
#
# Output:
#rolls - The array holding the values of the dice
#
##
#
function(die_size, number_of_dice, number_of_rolls)
{
rolls - array(0, dim=c(number_of_rolls, number_of_dice))

for (i in 1:number_of_rolls)
{
rolls[i,] - sample(die_size, number_of_dice, replace=TRUE)
}

return(rolls)
}

Any thoughts on this function?  Is there a better way of doing it in  
R?  Can you tell I used to play ADD?


Thanks,
Joe

__
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] New to R

2009-02-02 Thread Gabor Grothendieck
Try this:

matrix(sample(dsize, nrolls * ndice, replace = FALSE), nrolls, ndice)

On Mon, Feb 2, 2009 at 12:39 PM, Joe Hughes joe.hug...@earthlink.net wrote:
 Hello All,

A colleague of mine started working with R and out of curiosity I did
 some research on the language.  Very nice.  In my opinion this is one of the
 best languages I've found for getting tasks I'm interested in done.  I wrote
 this simple die roller and was curious to know if it is R enough.

 ##
 #
 # Input:
 #   die_size - 4, 6, 8, 10, 20
 #   number_of_dice - How many dice to roll
 #   number_of_rolls - How many times to roll the dice
 #
 # Output:
 #rolls - The array holding the values of the dice
 #
 ##
 #
 function(die_size, number_of_dice, number_of_rolls)
 {
rolls - array(0, dim=c(number_of_rolls, number_of_dice))

for (i in 1:number_of_rolls)
{
rolls[i,] - sample(die_size, number_of_dice, replace=TRUE)
}

return(rolls)
 }

 Any thoughts on this function?  Is there a better way of doing it in R?  Can
 you tell I used to play ADD?

 Thanks,
 Joe

 __
 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-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] New to R

2009-02-02 Thread Joe Hughes

Gabor,

Shouldn't the replace be TRUE instead of FALSE?  I get this error

Error in sample(6, 28, replace = FALSE) :
  cannot take a sample larger than the population when 'replace =  
FALSE'


when I use FALSE.  I don't get the error when it is TRUE.  Examining  
my mental model of what is going on you can't remove a number from a  
die thus each sample(value of the die) when selected has to be  
replaced.  Or am I missing something?


Thanks,
Joe

On Feb 2, 2009, at 1:00 PM, Gabor Grothendieck wrote:


Try this:

matrix(sample(dsize, nrolls * ndice, replace = FALSE), nrolls, ndice)

On Mon, Feb 2, 2009 at 12:39 PM, Joe Hughes  
joe.hug...@earthlink.net wrote:

Hello All,

  A colleague of mine started working with R and out of  
curiosity I did
some research on the language.  Very nice.  In my opinion this is  
one of the
best languages I've found for getting tasks I'm interested in  
done.  I wrote

this simple die roller and was curious to know if it is R enough.

##
#
# Input:
#   die_size - 4, 6, 8, 10, 20
#   number_of_dice - How many dice to roll
#   number_of_rolls - How many times to roll the dice
#
# Output:
#rolls - The array holding the values of the dice
#
##
#
function(die_size, number_of_dice, number_of_rolls)
{
  rolls - array(0, dim=c(number_of_rolls, number_of_dice))

  for (i in 1:number_of_rolls)
  {
  rolls[i,] - sample(die_size, number_of_dice,  
replace=TRUE)

  }

  return(rolls)
}

Any thoughts on this function?  Is there a better way of doing it  
in R?  Can

you tell I used to play ADD?

Thanks,
Joe

__
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-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] New to R

2009-02-02 Thread Gabor Grothendieck
Yes, it should be TRUE.

On Mon, Feb 2, 2009 at 1:16 PM, Joe Hughes joe.hug...@earthlink.net wrote:
 Gabor,

Shouldn't the replace be TRUE instead of FALSE?  I get this error

 Error in sample(6, 28, replace = FALSE) :
  cannot take a sample larger than the population when 'replace = FALSE'

 when I use FALSE.  I don't get the error when it is TRUE.  Examining my
 mental model of what is going on you can't remove a number from a die thus
 each sample(value of the die) when selected has to be replaced.  Or am I
 missing something?

 Thanks,
 Joe

 On Feb 2, 2009, at 1:00 PM, Gabor Grothendieck wrote:

 Try this:

 matrix(sample(dsize, nrolls * ndice, replace = FALSE), nrolls, ndice)

 On Mon, Feb 2, 2009 at 12:39 PM, Joe Hughes joe.hug...@earthlink.net
 wrote:

 Hello All,

  A colleague of mine started working with R and out of curiosity I
 did
 some research on the language.  Very nice.  In my opinion this is one of
 the
 best languages I've found for getting tasks I'm interested in done.  I
 wrote
 this simple die roller and was curious to know if it is R enough.


 ##
 #
 # Input:
 #   die_size - 4, 6, 8, 10, 20
 #   number_of_dice - How many dice to roll
 #   number_of_rolls - How many times to roll the dice
 #
 # Output:
 #rolls - The array holding the values of the dice
 #

 ##
 #
 function(die_size, number_of_dice, number_of_rolls)
 {
  rolls - array(0, dim=c(number_of_rolls, number_of_dice))

  for (i in 1:number_of_rolls)
  {
  rolls[i,] - sample(die_size, number_of_dice, replace=TRUE)
  }

  return(rolls)
 }

 Any thoughts on this function?  Is there a better way of doing it in R?
  Can
 you tell I used to play ADD?

 Thanks,
 Joe

 __
 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-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] New to R

2009-02-02 Thread Greg Snow
If you are interested in rolling dice with R (as opposed to using this as a 
simple test case to start writing your own programs), then you may want to look 
at the dice function from the TeachingDemos package.  The core line in this 
function is basically the same as Gabor's suggestion, but with the added option 
of weighting the dice (you don't like how I graded your exam? I am happy to let 
these computerized dice regrade it for you :-).  There is also an option to 
plot the results (for 6-sided dice).

There is also the plot.rgl.die and roll.rgl.die functions in the same package 
that give an animated rolling of the die (I really need to rewrite it to get a 
better animation, the coin flip works ok as is).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Joe Hughes
 Sent: Monday, February 02, 2009 10:40 AM
 To: R-help@r-project.org
 Subject: [R] New to R
 
 Hello All,
 
   A colleague of mine started working with R and out of curiosity I
 did
 some research on the language.  Very nice.  In my opinion this is one
 of the best languages I've found for getting tasks I'm interested in
 done.  I wrote this simple die roller and was curious to know if it is
 R enough.
 
 ###
 ###
 #
 # Input:
 #   die_size - 4, 6, 8, 10, 20
 #   number_of_dice - How many dice to roll
 #   number_of_rolls - How many times to roll the dice
 #
 # Output:
 #rolls - The array holding the values of the dice
 #
 ###
 ###
 #
 function(die_size, number_of_dice, number_of_rolls)
 {
   rolls - array(0, dim=c(number_of_rolls, number_of_dice))
 
   for (i in 1:number_of_rolls)
   {
   rolls[i,] - sample(die_size, number_of_dice, replace=TRUE)
   }
 
   return(rolls)
 }
 
 Any thoughts on this function?  Is there a better way of doing it in
 R?  Can you tell I used to play ADD?
 
 Thanks,
 Joe
 
 __
 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-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] New to R

2009-02-02 Thread Wacek Kusnierczyk
Joe Hughes wrote:

 #
 function(die_size, number_of_dice, number_of_rolls)
 {

you may want to replace

 rolls - array(0, dim=c(number_of_rolls, number_of_dice))
 
 for (i in 1:number_of_rolls)
 {
 rolls[i,] - sample(die_size, number_of_dice, replace=TRUE)
 }

with, e.g.

rolls = t(replicate(number_of_rolls, sample(die_size, number_of_dice,
replace=TRUE)))

to have it more r-ish

 
 return(rolls)
 }

 Any thoughts on this function?  

as soon as you start wrapping something like subset, lm, or the like
inside your functions, all hell breaks loose.  welcome to the r inferno,
that is. 


vQ

__
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] New to R

2009-02-02 Thread Joe Hughes

All,

	Thanks for taking the time to reply.  I understand a bit more about R  
and the R way then I did before.The final function looks like this:


##
#
# Input:
#   die_size - 4, 6, 8, 10, 20
#   number_of_dice - How many dice to roll
#   number_of_rolls - How many times to roll the dice
#
# Output:
#The array holding the results of the rolls
#
##
#
function(die_size, number_of_dice, number_of_rolls=1)
{
	return(t(replicate(number_of_rolls, sample(die_size, number_of_dice,  
replace=TRUE

}

Before I take a look at the teaching demos, I have one question left.

Here is a sequence of commands and the output

 sample(6, 4, replace=TRUE)
[1] 3  4  5  4
 replicate(7, sample(6, 4, replace=TRUE))
 [,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,]3364566
[2,]4465516
[3,]5145656
[4,]4631122

Why does replicate transpose the vector before assigning it to the  
array?  The way I would output it would be this


 [,1] [,2] [,3] [,4]
[1,]3454
[2,]3416
[3,]6643
[4,]4551
[5,]5561
[6,]6152
[7,]6662

Thanks,
Joe

__
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] New to R

2009-02-02 Thread Greg Snow
It is not transposing (it just looks that way).  The first result is a vector 
which is 1 dimensional, but is neither a row or a column.  The printed version 
of it looks like a row, because that is a more compact representation.  If you 
sample enough points you will see it wrap around and be represented as several 
rows.  If it printed as a single column, then the first values would scroll off 
the screen with only a moderate number of values.

The replicate function then takes these vectors and combines them into a matrix 
and just happens to use each vector as a column of the new matrix, this is 
standard, matrices by default are filled by column, look at the output of 
as.matrix( sample( 6, 4, replace=TRUE ) ) and you will see your vector 
converted to a matrix of 1 column.  It could have been done the other way, but 
way back the decision was made to do it this way and there are probably a lot 
of things that would break if it were changed now, so we get to live with it.  
A single call to 't' is not too much effort to get what we expect.

So in short, a vector is neither a column or a row, but prints as a row for 
practical reasons, and is converted to a column by default if made into a 
matrix.  

Hope this helps,


-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Joe Hughes
 Sent: Monday, February 02, 2009 1:09 PM
 To: R help
 Subject: Re: [R] New to R
 
 All,
 
   Thanks for taking the time to reply.  I understand a bit more
 about R
 and the R way then I did before.The final function looks like this:
 
 ###
 ###
 #
 # Input:
 #   die_size - 4, 6, 8, 10, 20
 #   number_of_dice - How many dice to roll
 #   number_of_rolls - How many times to roll the dice
 #
 # Output:
 #The array holding the results of the rolls
 #
 ###
 ###
 #
 function(die_size, number_of_dice, number_of_rolls=1)
 {
   return(t(replicate(number_of_rolls, sample(die_size,
 number_of_dice,
 replace=TRUE
 }
 
 Before I take a look at the teaching demos, I have one question left.
 
 Here is a sequence of commands and the output
 
   sample(6, 4, replace=TRUE)
 [1] 3  4  5  4
   replicate(7, sample(6, 4, replace=TRUE))
   [,1] [,2] [,3] [,4] [,5] [,6] [,7]
 [1,]3364566
 [2,]4465516
 [3,]5145656
 [4,]4631122
 
 Why does replicate transpose the vector before assigning it to the
 array?  The way I would output it would be this
 
   [,1] [,2] [,3] [,4]
 [1,]3454
 [2,]3416
 [3,]6643
 [4,]4551
 [5,]5561
 [6,]6152
 [7,]6662
 
 Thanks,
 Joe
 
 __
 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-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] New to R

2009-02-02 Thread Gabor Grothendieck
Also you don't need return since it automatically returns the value produced by
the last statement that it executes.

On Mon, Feb 2, 2009 at 3:44 PM, Greg Snow greg.s...@imail.org wrote:
 It is not transposing (it just looks that way).  The first result is a vector 
 which is 1 dimensional, but is neither a row or a column.  The printed 
 version of it looks like a row, because that is a more compact 
 representation.  If you sample enough points you will see it wrap around and 
 be represented as several rows.  If it printed as a single column, then the 
 first values would scroll off the screen with only a moderate number of 
 values.

 The replicate function then takes these vectors and combines them into a 
 matrix and just happens to use each vector as a column of the new matrix, 
 this is standard, matrices by default are filled by column, look at the 
 output of as.matrix( sample( 6, 4, replace=TRUE ) ) and you will see your 
 vector converted to a matrix of 1 column.  It could have been done the other 
 way, but way back the decision was made to do it this way and there are 
 probably a lot of things that would break if it were changed now, so we get 
 to live with it.  A single call to 't' is not too much effort to get what we 
 expect.

 So in short, a vector is neither a column or a row, but prints as a row for 
 practical reasons, and is converted to a column by default if made into a 
 matrix.

 Hope this helps,


 --
 Gregory (Greg) L. Snow Ph.D.
 Statistical Data Center
 Intermountain Healthcare
 greg.s...@imail.org
 801.408.8111


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
 project.org] On Behalf Of Joe Hughes
 Sent: Monday, February 02, 2009 1:09 PM
 To: R help
 Subject: Re: [R] New to R

 All,

   Thanks for taking the time to reply.  I understand a bit more
 about R
 and the R way then I did before.The final function looks like this:

 ###
 ###
 #
 # Input:
 #   die_size - 4, 6, 8, 10, 20
 #   number_of_dice - How many dice to roll
 #   number_of_rolls - How many times to roll the dice
 #
 # Output:
 #The array holding the results of the rolls
 #
 ###
 ###
 #
 function(die_size, number_of_dice, number_of_rolls=1)
 {
   return(t(replicate(number_of_rolls, sample(die_size,
 number_of_dice,
 replace=TRUE
 }

 Before I take a look at the teaching demos, I have one question left.

 Here is a sequence of commands and the output

   sample(6, 4, replace=TRUE)
 [1] 3  4  5  4
   replicate(7, sample(6, 4, replace=TRUE))
   [,1] [,2] [,3] [,4] [,5] [,6] [,7]
 [1,]3364566
 [2,]4465516
 [3,]5145656
 [4,]4631122

 Why does replicate transpose the vector before assigning it to the
 array?  The way I would output it would be this

   [,1] [,2] [,3] [,4]
 [1,]3454
 [2,]3416
 [3,]6643
 [4,]4551
 [5,]5561
 [6,]6152
 [7,]6662

 Thanks,
 Joe

 __
 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-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-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] New to R - Errors in plotting

2008-11-06 Thread BKMooney

I am new to R and am running into trouble with the function plot.  

When I enter in the simple code: 
x-1:4
y-5:8
plot(x,y)

I get a scatter plot with 4 points as expected.  

However, with my own data, A and B are both vectors of length ~85, each
entry a decimal in [0,1].  

Using the same plot(A,B) with this data, the plot function no longer gives
me a simple plot with 85 points.  Instead there are many points, and what
looks to be several boxwhisker plots also included on the plot.  

This is a link to the actual output.  
http://www.nabble.com/file/p20364310/plotAB.bmp plotAB.bmp 

Why is the plot function doing this?  How can I get it to simply give me a
scatterplot?  (From there I want to do a lsline, etc..)

Any help is greatly appreciated...

Thanks!
-- 
View this message in context: 
http://www.nabble.com/New-to-R---Errors-in-plotting-tp20364310p20364310.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] New to R - Errors in plotting

2008-11-06 Thread jim holtman
You need to provide more information. PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Show at least an 'str' of your data if you can not include it and the
commands that you were using.

On Thu, Nov 6, 2008 at 11:18 AM, BKMooney [EMAIL PROTECTED] wrote:

 I am new to R and am running into trouble with the function plot.

 When I enter in the simple code:
 x-1:4
 y-5:8
 plot(x,y)

 I get a scatter plot with 4 points as expected.

 However, with my own data, A and B are both vectors of length ~85, each
 entry a decimal in [0,1].

 Using the same plot(A,B) with this data, the plot function no longer gives
 me a simple plot with 85 points.  Instead there are many points, and what
 looks to be several boxwhisker plots also included on the plot.

 This is a link to the actual output.
 http://www.nabble.com/file/p20364310/plotAB.bmp plotAB.bmp

 Why is the plot function doing this?  How can I get it to simply give me a
 scatterplot?  (From there I want to do a lsline, etc..)

 Any help is greatly appreciated...

 Thanks!
 --
 View this message in context: 
 http://www.nabble.com/New-to-R---Errors-in-plotting-tp20364310p20364310.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

__
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] New to R - Errors in plotting

2008-11-06 Thread Erik Iverson

Hello -

In you example, what are the classes of x and y?

 x-1:4
 y-5:8
 plot(x,y)

class(x)
class(y)

In your 'real' data, what are the classes of A and B

class(A)
class(B)

One may be a factor?

How are you reading your data into R, read.table?  Make sure your data 
are numeric, then plot them, and it should do what you'd like.


Since you're new to R, one of my tips would be to learn the class() and 
str() functions.  Many functions, such as plot, operate differently 
depending on the class of data given to them, therefore it's very 
important to know the classes of your data objects.



BKMooney wrote:
I am new to R and am running into trouble with the function plot.  

When I enter in the simple code: 
x-1:4

y-5:8
plot(x,y)

I get a scatter plot with 4 points as expected.  


However, with my own data, A and B are both vectors of length ~85, each
entry a decimal in [0,1].  


Using the same plot(A,B) with this data, the plot function no longer gives
me a simple plot with 85 points.  Instead there are many points, and what
looks to be several boxwhisker plots also included on the plot.  

This is a link to the actual output.  
http://www.nabble.com/file/p20364310/plotAB.bmp plotAB.bmp 


Why is the plot function doing this?  How can I get it to simply give me a
scatterplot?  (From there I want to do a lsline, etc..)

Any help is greatly appreciated...

Thanks!


__
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] New to R - Errors in plotting

2008-11-06 Thread Duncan Murdoch

On 06/11/2008 11:18 AM, BKMooney wrote:
I am new to R and am running into trouble with the function plot.  

When I enter in the simple code: 
x-1:4

y-5:8
plot(x,y)

I get a scatter plot with 4 points as expected.  


However, with my own data, A and B are both vectors of length ~85, each
entry a decimal in [0,1].  


Using the same plot(A,B) with this data, the plot function no longer gives
me a simple plot with 85 points.  Instead there are many points, and what
looks to be several boxwhisker plots also included on the plot.  

This is a link to the actual output.  
http://www.nabble.com/file/p20364310/plotAB.bmp plotAB.bmp 


Why is the plot function doing this?  How can I get it to simply give me a
scatterplot?  (From there I want to do a lsline, etc..)

Any help is greatly appreciated...


Most likely your A vector is not numeric:  it's being read as strings 
like 0.4688, etc.  Take a look at str(A) and str(B) to see their 
structure.  (I can't tell from the plot, but I'd guess it's being read 
as a factor, because some of the values are not recognized as numeric.)


Duncan Murdoch

__
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] new to R

2008-09-06 Thread sudeshna

hi im starting with R.have no idea to start...plz help
-- 
View this message in context: 
http://www.nabble.com/new-to-R-tp19342903p19342903.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] new to R

2008-09-06 Thread Paul Smith
On Sat, Sep 6, 2008 at 5:10 AM, sudeshna [EMAIL PROTECTED] wrote:

 hi im starting with R.have no idea to start...plz help

Search the Internet for online tutorials and/or read an introductory
book (search for them, e.g., on Amazon.Com).

Good luck,

Paul

__
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] new to R

2008-09-06 Thread Jim Lemon

sudeshna wrote:

hi im starting with R.have no idea to start...plz help
  

Hi sudeshna,
There are several beginner's guides on the CRAN website. Go to:

http://cran.r-project.org

and select Contributed (second last option on the left).

Jim

__
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] new to R

2008-09-06 Thread Liviu Andronic
On 9/6/08, sudeshna [EMAIL PROTECTED] wrote:

  hi im starting with R.have no idea to start...plz help
  --
http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html
http://www.statmethods.net/index.html
http://rforsasandspssusers.com/

Rcmdr
rattle
http://www.sciviews.org/_rgui/

http://zoonek2.free.fr/UNIX/48_R/all.html
http://cran.r-project.org/other-docs.html
http://www.r-project.org/doc/bib/R-publications.html
http://cran.r-project.org/manuals.html

Also search this Mailing-List archives. You'll find many pointers lying around.
Good luck,
Liviu

__
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] New to R. Question about very large files

2008-08-14 Thread Richard Palmer
.. I am new to R but experienced in SAS.  SAS has the capability to let me
develop a model from a sample and use the results to score the records of
another file which won't fit in memory.  Is this straightforward in R or
does it require coding to do the scoring in segments?  Can someone point me
to sample code that I can copy or modify to do this quickly?

-- 
Richard Palmer

Home 508 877-3862
Cell 508 982-7266

[[alternative HTML version deleted]]

__
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] New to R. Question about very large files

2008-08-14 Thread Mark Lyman
Richard Palmer rhpalmer at gmail.com writes:

 
 .. I am new to R but experienced in SAS.  SAS has the capability to let me
 develop a model from a sample and use the results to score the records of
 another file which won't fit in memory.  Is this straightforward in R or
 does it require coding to do the scoring in segments?  Can someone point me
 to sample code that I can copy or modify to do this quickly?
 

I don't know what you mean by score the records, but the package biglm might 
be able help.

Mark

__
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] New to R. Question about very large files

2008-08-14 Thread paulandpen

Hi Richard,

It is if you use Rattle.  Rattle allows you to do that for quite a few types 
of models and has a really nice GUI interface.  It has been developed for 
the purposes of datamining, and given your use of the term score in your 
post, I assume in part that this is what you are looking for.  You can 
import a random sample of cases (a training percentage from the total 
dataset) and the package will use the remainder of your sample for testing 
and scoring.  Rattle is very sophisticated in terms of the algorithms it 
offers, and once you get going in R, SAS will become obselete (just 
kidding).


Sorry if I am wrong here about what you need.

Welcome . Paul

- Original Message - 
From: Richard Palmer [EMAIL PROTECTED]

To: r-help@r-project.org
Sent: Thursday, August 14, 2008 10:40 PM
Subject: [R] New to R. Question about very large files



.. I am new to R but experienced in SAS.  SAS has the capability to let me
develop a model from a sample and use the results to score the records of
another file which won't fit in memory.  Is this straightforward in R or
does it require coding to do the scoring in segments?  Can someone point 
me

to sample code that I can copy or modify to do this quickly?

--
Richard Palmer

Home 508 877-3862
Cell 508 982-7266

[[alternative HTML version deleted]]

__
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-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.