Re: [R] Loss of precision in read.csv.

2010-10-09 Thread Joshua Wiley
On Sat, Oct 9, 2010 at 2:38 PM, Joshua Wiley wrote: > Hi Steven, > > As near as I can tell, no precision is lost.  R is just being > courteous and not excessively filling our consoles.  Try: > > print(airports[1,"latitude_deg"], digits = 22) > > which is the most digits R will print (although inte

Re: [R] Mapping the coordinates!

2010-10-09 Thread Johannes Huesing
Mehdi Zarrei [Sun, Oct 10, 2010 at 06:11:23AM CEST]: > > > > > > > > > > > Hello, > > > > I have a series of coordinates > (latitudes and longitudes) each one/several associated to a code > (from 1 to 28). I used function points (latitude, longitude

Re: [R] read.table issue

2010-10-09 Thread jim holtman
The problem is that you have an unbalanced quote (') in your input . you need to specifiy quote = '' in read.table: > tempTxt <- "103272;Canara Robeco Fortune '94;30.07;30.07;30.75;02-Apr-2007 + " > read.table(textConnection(tempTxt), sep=';', quote = '') V1V2V3

Re: [R] How to add a new column to a matrix?

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 11:16 PM, Lakshmi Kastury wrote: Hi - I am a beginner to the R language. I have written the following matrix: Z.mat=matrix(c(2,2,2,1,1,1,3,2,1,6,5,4,9,1,1,2,3,2), nrow=6) I would like to add a 4th column consisting of: 6, 9, 8, 15, 16, 17 ?cbind I would also like to n

[R] Mapping the coordinates!

2010-10-09 Thread Mehdi Zarrei
Hello, I have a series of coordinates (latitudes and longitudes) each one/several associated to a code (from 1 to 28). I used function points (latitude, longitudes) to transfer them to a per-prepared map. 1- I wonder how I might be

Re: [R] How to add a new column to a matrix?

2010-10-09 Thread Joshua Wiley
Hi, This should do it. I tried to comment to explain things. Z.mat <- matrix(c(2,2,2,1,1,1,3,2,1,6,5,4,9,1,1,2,3,2), nrow=6) # column bind data together Z.mat <- cbind(Z.mat, c(6,9,8,15,16,17)) # add names to the 2 dimensions of Z.mat # the first element of the list is the row names, left as e

Re: [R] read.xls??

2010-10-09 Thread Gabor Grothendieck
On Sat, Oct 9, 2010 at 11:56 PM, Matt Curcio wrote: > Greeting all, > I am having a little trouble finding the 'right' package that will > read in .xls Excel spreadsheets. My Ubuntu base does not seem to have > the ability to read them. For various alternatives see: http://rwiki.sciviews.org/doku

[R] How to add a new column to a matrix?

2010-10-09 Thread Lakshmi Kastury
Hi - I am a beginner to the R language. I have written the following matrix: Z.mat=matrix(c(2,2,2,1,1,1,3,2,1,6,5,4,9,1,1,2,3,2), nrow=6) I would like to add a 4th column consisting of: 6, 9, 8, 15, 16, 17 I would also like to name each column a, b, c, d as well. Thanks!

[R] read.xls??

2010-10-09 Thread Matt Curcio
Greeting all, I am having a little trouble finding the 'right' package that will read in .xls Excel spreadsheets. My Ubuntu base does not seem to have the ability to read them. Any suggestions? Cheers, M __ R-help@r-project.org mailing list https://stat

Re: [R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 10:54 PM, missvanilla wrote: Dear all, I'm totally new to R. Recently I've been trying to use getYahooData in TTR package in order to download stock index daily open/high/low/close. The downloaded data is in the format of Open High Low

[R] Help needed for getYahooData in TTR package & writing the Yahoo data to excel

2010-10-09 Thread missvanilla
Dear all, I'm totally new to R. Recently I've been trying to use getYahooData in TTR package in order to download stock index daily open/high/low/close. The downloaded data is in the format of Open High Low Close Volume 2000-01-04 18937.45 19187.61 18

[R] read.table issue

2010-10-09 Thread Santosh Srinivas
Dear R-Group, I am getting this error message "incomplete final line found by readTableHeader" in the code below. It seems to me that the error message is because of quote in the text data. Is there any easy way to handle this? Or should I do a substitute. > tempTxt <- "100589;Canara Robeco Exp

Re: [R] Loss of precision in read.csv.

2010-10-09 Thread steven mosher
Ha Thanks, That was it. On Sat, Oct 9, 2010 at 2:38 PM, Joshua Wiley wrote: > Hi Steven, > > As near as I can tell, no precision is lost. R is just being > courteous and not excessively filling our consoles. Try: > > print(airports[1,"latitude_deg"], digits = 22) > > which is the most digit

Re: [R] GC verbose=false still showing report

2010-10-09 Thread Robin Jeffries
invisible(gc()) worked perfectly. Thanks Jeff. @ Josh: I know how to toggle showing/hiding command echos, but I haven't figured out how to toggle on/off any printed output. On Sat, Oct 9, 2010 at 5:10 PM, Robin Jeffries wrote: > I must be reading the help file for gc() wrong. I thought it sa

Re: [R] StrSplit

2010-10-09 Thread Santosh Srinivas
Thanks Jim. Exactly what I needed! -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: 09 October 2010 22:01 To: Santosh Srinivas Cc: r-help@r-project.org Subject: Re: [R] StrSplit Is this what you are after: > x <- c("Scheme Code;Scheme Name;Net Asset Value;Repurchas

Re: [R] svg plot and dashed lines

2010-10-09 Thread Paul Murrell
Hi On 29/09/2010 11:15 p.m., Ivan Calandra wrote: Dear users, When I boxplot(), the lines of the whiskers are dashed. However, when I save in an svg file, the dashed lines of the whiskers are not dashed anymore. How can I have the dashed lines in the svg file? I don't have this problem with

Re: [R] GC verbose=false still showing report

2010-10-09 Thread Jeff Newmiller
Try invisible(gc()) ? "Robin Jeffries" wrote: >I must be reading the help file for gc() wrong. I thought it said that >gc(verbose=FALSE) will run the garbage collection without printing the >Ncells/Vcells summary. However, this is what I get: > >gc(verbose = FALSE) > used (Mb) gc trig

[R] GC verbose=false still showing report

2010-10-09 Thread Robin Jeffries
I must be reading the help file for gc() wrong. I thought it said that gc(verbose=FALSE) will run the garbage collection without printing the Ncells/Vcells summary. However, this is what I get: gc(verbose = FALSE) used (Mb) gc trigger (Mb) max used (Mb) Ncells 267097 14.3 531268 28

Re: [R] Memory management in R

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 4:23 PM, Lorenzo Isella wrote: My suggestion is to explore other alternatives. (I will admit that I don't yet fully understand the test that you are applying.) Hi, I am trying to partially implement the Lempel Ziv compression algorithm. The point is that compressibility

Re: [R] Plot time range with rect or boxplot

2010-10-09 Thread jim holtman
Try this. You also had some typos on the names and weren't using the dataframe correctly. x <- read.table(textConnection(" CompanyPt Pri Pub 1AWO520 8/5/09 2/11/10 2BWO893 7/30/03 2/24/05 3A

Re: [R] same random numbers in different sessions

2010-10-09 Thread jim holtman
You need to set the set.seed yourself. There are some simulation where I do want the same numbers generated and can use the set.seed to set it to a know value. If you want something random each time, then use the time of day in the call to set.seed. On Sat, Oct 9, 2010 at 5:14 PM, Liviu Andronic

Re: [R] GPS data!

2010-10-09 Thread Spencer Graves
Have you tried "sos": install.packages('sos') # if not already installed library(sos) (gps <- ???GPS) This found 63 matches for me right now. The results open as a table in a web browser with the package with the most matches first and with hot links to the help page for each m

Re: [R] GPS data!

2010-10-09 Thread jim holtman
No need for a function; you can just write the expression yourself: > x <- read.table(textConnection(" 32 31.85 +59 48.74 + 34 05.7 +58 50.79 + 34 05.7 +58 50.79 +

Re: [R] same random numbers in different sessions

2010-10-09 Thread G. Jay Kerns
Dear Liviu, On Sat, Oct 9, 2010 at 5:14 PM, Liviu Andronic wrote: > Dear all > I'm using Xubuntu Lucid and I keep getting the same random numbers > whenever I start a new session of R. For example, I keep getting >> sample(1:1000, 1) > [1] 87 > > or >> rnorm(1:10) >  [1] -1.3618103  0.4241701  1.

Re: [R] same random numbers in different sessions

2010-10-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Liviu Andronic > Sent: Saturday, October 09, 2010 2:15 PM > To: r-help@r-project.org Help > Subject: [R] same random numbers in different sessions > > Dear all > I'm using Xubuntu

Re: [R] Loss of precision in read.csv.

2010-10-09 Thread Joshua Wiley
Hi Steven, As near as I can tell, no precision is lost. R is just being courteous and not excessively filling our consoles. Try: print(airports[1,"latitude_deg"], digits = 22) which is the most digits R will print (although internally it can store more I believe). Alternately, you can convert

[R] same random numbers in different sessions

2010-10-09 Thread Liviu Andronic
Dear all I'm using Xubuntu Lucid and I keep getting the same random numbers whenever I start a new session of R. For example, I keep getting > sample(1:1000, 1) [1] 87 or > rnorm(1:10) [1] -1.3618103 0.4241701 1.0720076 0.2208145 -0.5375314 -0.4846588 [7] 0.7576768 0.6527407 -0.6868786 0.8

[R] Loss of precision in read.csv.

2010-10-09 Thread steven mosher
Given a csv file from this location Airports<-"http://www.ourairports.com/data/airports.csv"; download.file(Airports,basename(Airports)) airports <-read.csv("airports.csv",encoding="UTF-8") > airports[1,] id ident type name latitude_deg longitude_deg elevation_ft continen

Re: [R] Memory management in R

2010-10-09 Thread Lorenzo Isella
My suggestion is to explore other alternatives. (I will admit that I don't yet fully understand the test that you are applying.) Hi, I am trying to partially implement the Lempel Ziv compression algorithm. The point is that compressibility and entropy of a time series are related, hence my fi

[R] Plot time range with rect or boxplot

2010-10-09 Thread Eric Hu
Hi, I am trying to use rect (R2.11) to plot a set of data as following > data CompanyPt Pri Pub 1AWO520 8/5/09 2/11/10 2BWO893 7/30/03 2/24/05 3AWO258 12/8/08

[R] GPS data!

2010-10-09 Thread Mehdi Zarrei
Hello R-experts, I have some coordinates that look like this: lat   long 32 31.85 59 48.74

Re: [R] StrSplit

2010-10-09 Thread Jeffrey Spies
Obviously Jim's solution does work, and I did not intend to imply it didn't. In fact, his read.table solution would work both if the OP had a semi-colon delimited file to begin with (which I was trying to say was ideal from a workflow standpoint) or a vector of strings (for use when paired with te

Re: [R] own TAB expansion

2010-10-09 Thread Sebastian Gibb
Am Samstag, 9. Oktober 2010, 08:39:36 schrieb Deepayan Sarkar: > On Fri, Oct 8, 2010 at 6:19 AM, Sebastian Gibb wrote: > > Hello Duncan, > > > > thank for your advice, but it doesn't work like expected: > > > > setClass(Class="A", representation=representation(slotA="numeric", > > slotB="numeri

Re: [R] Hausman test for endogeneity

2010-10-09 Thread Liviu Andronic
Hello On Sat, Oct 9, 2010 at 2:37 PM, Holger Steinmetz wrote: > can anybody point me in the right direction on how to conduct a hausman test > for endogeneity in simultanous equation models? > Try install.packages('sos') require(sos) findFn('hausman') Here I get these results: > findFn('hausman'

Re: [R] Counting unique items in a list of matrices

2010-10-09 Thread Jeffrey Spies
If you just want a list of matrices and their counts, you can use Peter's list of matrices, L, and then: With plyr: require(plyr) count(unlist(lapply(L, toString))) Without plyr: as.data.frame(table(unlist(lapply(L, toString Cheers, Jeff. On Sat, Oct 9, 2010 at 12:44 PM, Peter Ehlers wr

Re: [R] problem with colors

2010-10-09 Thread ANJAN PURKAYASTHA
Hi Phil and Thomas, Thanks for your helpful feedback. I must admit my solution to creating the vector of colors lacked your elegance. In brief, I saved the output of colors() into a text file, saved all but 47 colours in that file and read it back as a data frame and used the first column of the d

Re: [R] StrSplit

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 12:46 PM, Jeffrey Spies wrote: Jim's solution is the ideal way to read in the data: using the sep=";" argument in read.table. However, if you do for some reason have a vector of strings like the following (maybe someone gives you an Rdata file instead of the raw data file):

Re: [R] StrSplit

2010-10-09 Thread Jeffrey Spies
Jim's solution is the ideal way to read in the data: using the sep=";" argument in read.table. However, if you do for some reason have a vector of strings like the following (maybe someone gives you an Rdata file instead of the raw data file): MF_Data <- c("106506;AIG India Liquid Fund-Institutio

Re: [R] Counting unique items in a list of matrices

2010-10-09 Thread Peter Ehlers
On 2010-10-07 10:10, Jim Silverton wrote: Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help

Re: [R] StrSplit

2010-10-09 Thread jim holtman
Is this what you are after: > x <- c("Scheme Code;Scheme Name;Net Asset Value;Repurchase Price;Sale > Price;Date" + , "" + ,"Open Ended Schemes ( Liquid )" + , "" + , "" + , "AIG Global Investment Group Mutual Fund" + , "106506;AIG India Liquid Fund-Institutional Plan-Daily Dividend Option;1001.

Re: [R] Hausman test for endogeneity

2010-10-09 Thread Giuseppe Marinelli
On Saturday 09 October 2010 14:37:35 Holger Steinmetz wrote: > Dear folks, > > can anybody point me in the right direction on how to conduct a hausman > test for endogeneity in simultanous equation models? > > Best, > Holger hausman.systemfit [1] should be what you are looking for. Cheers Giusepp

[R] StrSplit

2010-10-09 Thread Santosh Srinivas
Newbie question ... I am looking something equivalent to read.delim but which accepts a text line as parameter instead of a file input. Below is my problem, I'm unable to get the exact output which is a simple data frame of the data where the delimiter exists ... coming quite close though I

Re: [R] Possible Bug in Effects Package

2010-10-09 Thread John Fox
Dear Peter and Luciano, I agree that this is a bug, and I'll try to fix it as soon as I have a chance -- probably the week after next. I was rather surprised that effect() works in a model without a constant, but it does seem to: > model2<- glm( prop ~ -1 + tra, weights = tries, data = test, fam

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread johannes rara
Thanks Michael! dbBuildTableDefinition is something I was looking for but it does not seem to support SQL Server table definitions (CREATE TABLE statements may vary between different RDBMS). Thanks anyway, -J 2010/10/9 Michael Bedward : > Package RSQLite has a dbBuildTableDefinition that create

Re: [R] Unsubscribe me from mailing list

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 10:45 AM, cr...@sharkdefense.com wrote: Please unsubscribe me from this list. Thank you. You need to do that yourself ... none of us can do that for you. Login and unsubscribe through the web page where you subscribed. You can also just leave yourself subscribed but tur

Re: [R] Memory management in R

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 9:45 AM, Lorenzo Isella wrote: Hi David, I am replying to you and to the other people who provided some insight into my problems with grepl. Well, at least we now know that the bug is reproducible. Indeed it is a strange sequence the one I am postprocessing, probably pat

[R] Unsubscribe me from mailing list

2010-10-09 Thread craig
Please unsubscribe me from this list. Thank you. <>< Marine Biologist Elasmobranch Bycatch Reduction Scientist SharkDefense Technologies, LLC (845) 702-7087 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Possible Bug in Effects Package

2010-10-09 Thread Peter Ehlers
On 2010-10-02 11:47, Luciano Selzer wrote: Dear List, I find Effects package very useful, but I believe I have found a bug in allEffects function. Please consider the following code: test<- data.frame(tries= round(runif(40, 5, 300)), tra = gl(4, 10, labels = c("V", "D", "C", "L")), pr

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread David Winsemius
On Oct 9, 2010, at 9:02 AM, johannes rara wrote: Thanks, but I'm not looking for a function to save dataframes into a RDBMS. I'm looking for a function which creates CREATE TABLE and INSERT statements from a dataframe. (My first comment is speculation that Eric was intending that you look a

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread Spencer Graves
Have you considered the DBI and RODBC packages? I'm trying to do something like this myself right now, and a post of my own (to R-SIG-DB) produced recommendations for these two packages. Both have vignettes. Hope this helps. Spencer On 10/9/2010 6:52 AM, Michael Bedward

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread Michael Bedward
Package RSQLite has a dbBuildTableDefinition that creates the CREATE TABLE statement for a given a data.frame. I think other db related packages for MySQL and PostgreSQL also have such a function. Michael On 10 October 2010 00:39, Gabor Grothendieck wrote: > On Sat, Oct 9, 2010 at 9:02 AM, joha

Re: [R] Memory management in R

2010-10-09 Thread Lorenzo Isella
Hi David, I am replying to you and to the other people who provided some insight into my problems with grepl. Well, at least we now know that the bug is reproducible. Indeed it is a strange sequence the one I am postprocessing, probably pathological to some extent, nevertheless the problem is g

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread Gabor Grothendieck
On Sat, Oct 9, 2010 at 9:02 AM, johannes rara wrote: > Thanks, but I'm not looking for a function to save dataframes into a > RDBMS. I'm looking for a function which creates CREATE TABLE and > INSERT statements from a dataframe. > If the reason you want that is so you can manipulate R data frames

Re: [R] Package for converting R datasets into SQL Server (create table and insert statements)?

2010-10-09 Thread johannes rara
Thanks, but I'm not looking for a function to save dataframes into a RDBMS. I'm looking for a function which creates CREATE TABLE and INSERT statements from a dataframe. -J 2010/10/5 Eric Lecoutre : > Hi, > > You can have a look at RODBC and its function sqlSave. > > HTH, > > Eric > > > 2010/10/3

[R] Hausman test for endogeneity

2010-10-09 Thread Holger Steinmetz
Dear folks, can anybody point me in the right direction on how to conduct a hausman test for endogeneity in simultanous equation models? Best, Holger -- View this message in context: http://r.789695.n4.nabble.com/Hausman-test-for-endogeneity-tp2969522p2969522.html Sent from the R help mailing

[R] A competition to create a recommendation engine for R packages

2010-10-09 Thread Tal Galili
Hello everyone. There is a new competition, outlined on the blog dataists, inviting us to analyse statistics of the use of R packages (collected from 52 R users), to create a R-package suggestion engi

Re: [R] R: Why this deosn't work?, matrix, rounding error?

2010-10-09 Thread Peter Ehlers
On 2010-10-09 4:47, skan wrote: Hello I've seen the answer at stackoverflow. They also said I must use zapsmall to avoid roundup problems. I didn't expect this behaviour when division gives an integer number. The trouble is that your expectations may not coincide with reality. That's why peop

Re: [R] R: Why this deosn't work?, matrix, rounding error?

2010-10-09 Thread skan
Hello I've seen the answer at stackoverflow. They also said I must use zapsmall to avoid roundup problems. I didn't expect this behaviour when division gives an integer number. -- View this message in context: http://r.789695.n4.nabble.com/R-Why-this-deosn-t-work-matrix-rounding-error-tp2968527

Re: [R] font question on pdf device

2010-10-09 Thread Kari Ruohonen
On Fri, 2010-10-08 at 14:19 +0100, Ted Harding wrote: > On 08-Oct-10 12:44:12, Kari Ruohonen wrote: > > Hi, > > I wonder if this is something on my machine locally or R in general. > > > > When I do the following: > >> plot(c(0,1),c(0,1),main=expression(paste(symbol("D"),"D",sep=""))) > > > > I g

Re: [R] R: Why this deosn't work?, matrix, rounding error?

2010-10-09 Thread Gavin Simpson
On Fri, 2010-10-08 at 09:30 -0700, skan wrote: > It's a problem much bigger. > I use a matrix to store the results of a bigger problem. > I loop through several variables and store the results of a computation on > that matrix. > At the beginning of the problem I initialize the matrix to zeros and