[R] help exporting to excel via xlsReadWritePro

2009-07-02 Thread Chris Anderson
I’m trying to export a file from R to excel using the xlsReadWritePro function and I keep getting the error below. I get the same error when I use the oledatetime function. My current date format is mm/dd/, which is how I want it in excel. Also is there anyway to export different

Re: [R] Exporting large datasets

2009-07-02 Thread DrDimo
Thanks guys, writing smaller pieces did the trick. Still takes about 4 hours to do but that more manageable than over 30 hours without even writing a line. jholtman wrote: What do you want to export it to and in what format? You will probably have a problem trying to write that large an

Re: [R] productivity tools in R?

2009-07-02 Thread Gene Leynes
I have recently discovered the playwith library, which is great for creating complex lattice objects. If you start with a simple lattice plot then modify it using playwith, you can export the code to produce the spiffed up plot. I noticed this function at the bottom of the xyplot

Re: [R] ?max (so far...)

2009-07-02 Thread Petr PIKAL
Hi what about do inside some function a subset of your whole data frame fff - function( data, rows) { data.1 - data[1:rows,] get all necessary stuf on data.1 return what you want } You can put a dimension check if you want the function to be more robust Regards Petr

Re: [R] productivity tools in R?

2009-07-02 Thread Liviu Andronic
Hello, On 7/1/09, Michael comtech@gmail.com wrote: More pointers about using R for efficiency in development are highly apprecaited! This is more from the point of view of the beginner; something that I wrote recently on r-sig-teaching: skip I will mention a recent discussion [1] on

Re: [R] Neural Networks

2009-07-02 Thread Allan Engelhardt
A reasonable place to start would be to look at the packages recommended in the Machine Learning section of CRAN Task Views: http://cran.r-project.org/web/views/MachineLearning.html . You could also try to search the archive for this list which often recommend the same package (e.g.

Re: [R] locale changing on Windows

2009-07-02 Thread Uwe Ligges
Gabor Grothendieck wrote: It can be done without setting locales using chron: library(chron) as.Date(chron(1970-Jan-01, format = Year-Month-Day)) [1] 1970-01-01 On Wed, Jul 1, 2009 at 10:09 AM, Ben Bolkerbbol...@gmail.com wrote: Dear r-helpers, This is a little bit more of a Windows

[R] R: fitting in logistic model

2009-07-02 Thread Renzi Fabrizio
...Does anybody know more about the way R computes the fitting values of a logistic model? Should I ask to R-devel? Fabrizio Renzi -Messaggio originale- Da: Renzi Fabrizio Inviato: 01 July 2009 09:43 A: 'ted.hard...@manchester.ac.uk'; Marc Schwartz Cc: r-help@r-project.org Oggetto: R:

Re: [R] productivity tools in R?

2009-07-02 Thread Nikos Alexandris
On Thu, 2009-07-02 at 00:01 -0500, Gene Leynes wrote: playwith(xyplot(z3), time.mode = TRUE) WoW! Looks (and is) GrEaT! Nikos __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] productivity tools in R?

2009-07-02 Thread Warren Young
Michael wrote: I saw my friend has a R Console window which has automatic syntax reminder when he types in the first a few letters of R command. And he's using R under MAC. Is that a MAC thing, or I could do the same on my PC Windows? Yes, the Mac GUI for R is a lot nicer than the Windows

Re: [R] streamlines/vectors

2009-07-02 Thread David Winsemius
On Jul 1, 2009, at 4:27 AM, Andrea Storto wrote: Dear all, Does anyone know if there exist a R function in some package to compute streamlines given the two components of a vectorial field? Thanks in advance, Have you looked at arrow.plot {fields}? David Winsemius, MD Heritage

[R] diagram package treearrow help

2009-07-02 Thread rajesh j
Hi, I would like to write text on top of an arrow.How can I do this? -- Rajesh.J [[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

Re: [R] Spatial Statistics on Grids

2009-07-02 Thread Peter Biber
Thanks again David, I apologize for not getting back to you immediately. I do not want to cost too much of your time, but if it's ok for you, I will try to clarify what I'm looking for: Yes, I'm not looking for density estimates. I need to characterize spatial _patterns_ of objects distributed

Re: [R] productivity tools in R?

2009-07-02 Thread Liviu Andronic
On 7/2/09, Warren Young war...@etr-usa.com wrote: reason it has to be that way. Maybe someone will port some of the Mac GUI's features over to the Windows version. Or in the mean-time someone would try JGR to see whether it gets farther than the Windows Rgui. Liviu

[R] MCMC/Bayesian framework in R?

2009-07-02 Thread Carsten Dormann
Dear R-users (and developers), I am looking for an efficient framework to carry out parameter estimations based on MCMC (optionally with specified priors). My goal is as follow: * take ANY R-function returning a likelihood-value (this function may itself call external programmes or other

[R] Computer Modern

2009-07-02 Thread Mr Derik
I am trying to use computer modern fonts in postscript files for a latex document. Ultimately I want to automate this through sweave. I've read the documentation ans have tried the following code to use lattice to produce a graph using computer modern: library(lattice) library(grid) testPlot=(

[R] IFS estimator

2009-07-02 Thread excalibur
Good morning everybody, i'm trying to use the IFS function to estimate a distribution function. But i want to estimate my distribution function at some fixed points. Is it possible ? I see in the R help that we can choose the number of points but i don't see anything which allows me to define

[R] Getting the month out of my date as a number not characters

2009-07-02 Thread Tim Chatterton
I have a data frame (hf) that is all set up and the dates are working fine - however I need to extract the months and hours (2 separate columns) as numbers - however they are coming out as characters. I have tried both the following: hf50$hour= hf50$date hf50$hour=format(hf50[hour],%H) and

[R] From xtabs to matrix

2009-07-02 Thread glaporta
Hi list, is it possible convert the xtabs result xtabs(breaks~tension+wool,data=warpbreaks) wool tension A B L 401 254 M 216 259 H 221 169 to a simple matrix? A B L 401 254 M 216 259 H 221 169 Thanks a lot! Gianandrea -- View this

[R] Getting the month out of my date as a number not characters

2009-07-02 Thread Tim Chatterton
I have a data frame (hf) that is all set up and the dates are working fine - however I need to extract the months and hours (2 separate columns) as numbers - however they are coming out as characters. I have tried both the following: hf50$hour - hf50$date hf50$hour - format(hf50[hour],%H)

Re: [R] diagram package treearrow help

2009-07-02 Thread Soetaert, Karline
Try: openplotmat() pos - coordinates(c(2,4),hor=FALSE) Parr- treearrow(from=pos[1:2,],to=pos[3:6,],arr.side=1:2,path=V) text(Parr,hello) dr. Karline Soetaert NIOO - CEME PO box 140 4400 AC  Yerseke the Netherlands Phone: ++ 31 113 577487 fax: ++ 31 113 573616 e-mail: k.soeta...@nioo.knaw.nl

Re: [R] Question about - assignment

2009-07-02 Thread Kenn Konstabel
On Thu, Jul 2, 2009 at 4:34 AM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global

Re: [R] Map projections - converting latitude/longitude to eastings and northings

2009-07-02 Thread Roger Bivand
Wouldn't grass-users, or maybe R-sig-geo be a more appropriate list? Given points in geographical coordinates, use project() or spTransform() in rgdal. The former will not do datum transformation, the latter will. NAD83 is a US datum specification based on WGS84, UTM is a projection but is

[R] Odp: Getting the month out of my date as a number not characters

2009-07-02 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 02.07.2009 12:40:05: I have a data frame (hf) that is all set up and the dates are working fine - however I need to extract the months and hours (2 separate columns) as numbers - however they are coming out as characters. I have tried both the

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 8:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global environment and modified accordingly. z - 0 works as documented, it's the indexing that

Re: [R] Computer Modern

2009-07-02 Thread Ted Harding
On 02-Jul-09 09:06:44, Mr Derik wrote: I am trying to use computer modern fonts in postscript files for a latex document. Ultimately I want to automate this through sweave. I've read the documentation ans have tried the following code to use lattice to produce a graph using computer modern:

Re: [R] ?max (so far...)

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 9:10 PM, Carl Witthoft wrote: More generally, you can always write a loop. They aren't necesssrily fast or elegant, but they're pretty general. For example, to calculate the max of the previous 50 observations (or fewer near the start of a vector), you could do x -

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 01/07/2009 9:34 PM, Rolf Turner wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to suggest that z will be found in the global environment and modified accordingly. I

Re: [R] MCMC/Bayesian framework in R?

2009-07-02 Thread Ben Bolker
Carsten Dormann wrote: Dear R-users (and developers), I am looking for an efficient framework to carry out parameter estimations based on MCMC (optionally with specified priors). My goal is as follow: * take ANY R-function returning a likelihood-value (this function may itself call

Re: [R] sum_to_zero_constraints

2009-07-02 Thread Uwe Ligges
Iason Christodoulou wrote: Dear kind R-experts. with miximum likelihood method i found the following estimations for my parameters vector: mu H A1 A2 . . . A10 D1 D2 . . . D10 but i want to add sum to zero constraints. sum(a1:a10)=0 and sum(d1:d10)=0 how i will do this? Don't

Re: [R] productivity tools in R?

2009-07-02 Thread Duncan Murdoch
On 02/07/2009 5:10 AM, Warren Young wrote: Michael wrote: I saw my friend has a R Console window which has automatic syntax reminder when he types in the first a few letters of R command. And he's using R under MAC. Is that a MAC thing, or I could do the same on my PC Windows? Yes, the Mac

Re: [R] conditional recoding a variable

2009-07-02 Thread jim holtman
I think you want to use 'ifelse': social$CitizenType-ifelse(social$CitizenType== ||social$PrimaryLanguage==English,US Citizen ) On Wed, Jul 1, 2009 at 5:45 PM, Chris Andersonchris6...@netzero.net wrote: I have a variable that identifies citizen type but some of my rows are blank. I want to

Re: [R] conditional recoding a variable

2009-07-02 Thread jim holtman
Should be (I think): (default condition and the use of | instead of ||) social$CitizenType-if(social$CitizenType== | social$PrimaryLanguage==English,US Citizen, social$CitizenType ) On Thu, Jul 2, 2009 at 7:19 AM, jim holtmanjholt...@gmail.com wrote: I think you want to use 'ifelse':

Re: [R] Odp: Getting the month out of my date as a number not characters

2009-07-02 Thread Petr PIKAL
Hi Tim Chatterton tim.chatter...@uwe.ac.uk napsal dne 02.07.2009 13:19:46: Actually it is a character and you need to convert it to numbers by as.numeric This is the bit I have problems with - I can easily get it out as characters but I cannot work out how to use as.numeric (and had

Re: [R] Error: cannot allocate vector of size 332.3 Mb

2009-07-02 Thread David Winsemius
On Jul 1, 2009, at 4:43 PM, Jonathan Greenberg wrote: By the way, you'll probably have to reinstall some or all of your packages (and dependencies) if you are using R64.app, probably downgrading them in the process. --j This really ought to be on the r-sig-mac list. I am copying that

[R] convert xts vector into matrix

2009-07-02 Thread Murali.MENON
hi folks, if i have an xts object as follows: library(xts) dd - as.POSIXct(strptime(c(2009-06-01 08:00:00, 2009-06-01 08:30:00,2009-06-01 09:00:00,2009-06-02 08:00:00, 2009-06-03 08:00:00, 2009-06-03 08:30:00),%Y-%m-%d %H:%M:%S)) a - xts(1:6,dd) a [[alternative HTML version

Re: [R] Windowing issue with diagram package R 9.1

2009-07-02 Thread Soetaert, Karline
Robert, It is a windows thing: Try: par(mfrow=c(2,2)) for(i in 1:4)plot(i) par(mfrow=c(1,1)) and then scroll/resize. Karline __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] productivity tools in R?

2009-07-02 Thread Tal Galili
Duncan, Thank you for the TAB for command suggestion tip! Tal On Thu, Jul 2, 2009 at 2:17 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 02/07/2009 5:10 AM, Warren Young wrote: Michael wrote: I saw my friend has a R Console window which has automatic syntax reminder when he types in

Re: [R] ncurses for R?

2009-07-02 Thread Stephen J. Barr
I suppose I should rephrase my question. What are good choices available for writing user-interactive programs with R, preferably over the command line. Most of my R scripts have not required user interaction so this is a first for me. On Wed, Jul 1, 2009 at 10:47 PM, Stephen J.

Re: [R] ncurses for R?

2009-07-02 Thread Gabor Grothendieck
There is some material here (but not up to date): http://www.sciviews.org/_rgui/ and a separate list here: https://stat.ethz.ch/mailman/listinfo/r-sig-gui On Thu, Jul 2, 2009 at 7:57 AM, Stephen J. Barrstephenjb...@gmail.com wrote: I suppose I should rephrase my question. What are good choices

Re: [R] Plot cumulative probability of beta-prime distribution

2009-07-02 Thread David Winsemius
I am not at all familiar with that distribution but the obvious solution would appear to be: ?integrate BetaprimeDensity - function(x) x^(shape1-1) * (1+x)^(-shape1- shape2) / beta(shape1,shape2) shape1 - 1 shape2 -1 integrate(BetaprimeDensity, 0 , 1) 0.5 with absolute error 5.6e-15

Re: [R] recoding charactor variables with special charactors

2009-07-02 Thread John Kane
First of all try str(socia) and see what the structure of the data is. R seems to be interpreting that character string as a format If I am reading the error message correctly. --- On Wed, 7/1/09, Chris Anderson chris6...@netzero.net wrote: From: Chris Anderson chris6...@netzero.net

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 6:44 AM, Kenn Konstabel wrote: On Thu, Jul 2, 2009 at 4:34 AM, Rolf Turner r.tur...@auckland.ac.nz wrote: On 2/07/2009, at 12:20 PM, Hsiu-Khuern Tang wrote: Is this expected behavior? z - 1:5 z[1] - 0 Error in z[1] - 0 : object z not found The documentation seems to

Re: [R] Map projections - converting latitude/longitude to eastings and northings

2009-07-02 Thread stephen sefick
Thank you for your reply. Your suggestion for sending this to another list is probably the right one. I have just had so much wonderful help on this one I thought I would try this one first. I am very new to GIS and have a couple of years of experience with R. I will probably join the sig-geo

Re: [R] Select values at random by id value

2009-07-02 Thread James Martin
Hadley, Sunil, and list, This is not quite doing what I wanted it to do (as far as I can tell). I perhaps did not explain it thoroughly. It seems to be sampling one value for each day leaving ~200 observations. I need for it randomly chose one hab value for each bird if there is more than one

Re: [R] Select values at random by id value

2009-07-02 Thread hadley wickham
On Thu, Jul 2, 2009 at 8:15 AM, James Martinjust.strut...@gmail.com wrote: Hadley, Sunil, and list, This is not quite doing what I wanted it to do (as far as I can tell). I perhaps did not explain it thoroughly.  It seems to be sampling one value for each day leaving ~200 observations. I need

Re: [R] productivity tools in R?

2009-07-02 Thread Kevin W
On Wed, Jul 1, 2009 at 12:35 PM, miguel bernal mber...@marine.rutgers.eduwrote: and debugging. I think there is a package to visualize the links between functions in a package, but I don't know its name (if anybody knows it, I will love to know it). See the 'foodweb' function in the

Re: [R] Question about - assignment

2009-07-02 Thread Peter Dalgaard
Duncan Murdoch wrote: - doesn't need to find z. It will replace it if found, or create a new one if not. (Personally I would have limited that to the first case, i.e. it should fail if it doesn't find z.) Possibly. It's a holdover from S, where - assigns to the global environment

[R] matching rows in matrices

2009-07-02 Thread dreamworx
I have a matrix such as this, [,1] [,2] [,3] [1,]112 [2,]255 and a larger matrix such as this, a b [1,] 1 5 [2,] 2 5 [3,] 4 9 [4,] 5 8 [5,] 7 8 [6,] 7 10 [7,] 9 10 what I want to do is check the number of times the columns in the first matrix appear as

[R] Display Median in plot

2009-07-02 Thread Christian Eisen
Hi, I drew a plot with R of my data and now I would like to display the median values of each group above the respective datapoint in the plot. I already search for ages, but maybe I am just blind. I am sure that this has to be an option somewhere... I appreciate any kind of input! Best,

[R] (no subject)

2009-07-02 Thread Andriy Fetsun
Hi Guys, It is very simple question, but I can't find the answer! Please help me. I use R and such simple function as length() doesn't work. The result is always 1 even if my data are more then 1 observations! Do I have to load any additional library? length(Ret_1) [1] 1 length function (x)

[R] (no subject)

2009-07-02 Thread Andriy Fetsun
Hi, Could you please help me? I am trying to load an csv-file in R, but it works wrong! My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret-read.csv(Ret.csv) Ret X0 X0127 1 016 2 0 113 3 037 4 025 Thank you in advance! -- Best regards, Andy

Re: [R] Average of data files in a directory

2009-07-02 Thread Peter Perez
Hi, Thanks to Henrique and Prof. Spector for their kind reply. Indeed, the mean function does work, but the result I want is an average data vector, not an scalar, which is the output of mean(). This is, given these two data frames (each data frame has 500 rows): Time Pressure 0.0 100

Re: [R] (no subject)

2009-07-02 Thread milton ruser
Hi Andriy Fetsun, How about include a subject title on the subject of the email like length funcion not work. By the say, send us the result of str(your_object). Bests milton brazil=toronto On Thu, Jul 2, 2009 at 9:01 AM, Andriy Fetsun fet...@googlemail.com wrote: Hi Guys, It is very

Re: [R] matching rows in matrices

2009-07-02 Thread Gabor Grothendieck
If A and B are first and second matrix respectively then try: rowSums(inner(A, t(B), identical)) where the generalized inner product, inner, is defined in this post: http://tolstoy.newcastle.edu.au/R/e4/help/08/08/19562.html On Thu, Jul 2, 2009 at 8:27 AM, dreamworxandy_wools...@hotmail.com

Re: [R] Display Median in plot

2009-07-02 Thread David Winsemius
If ?text does not answer the question, then you should post an example that illustrates the problem. -- DW On Jul 2, 2009, at 8:46 AM, Christian Eisen wrote: Hi, I drew a plot with R of my data and now I would like to display the median values of each group above the respective datapoint

Re: [R] (no subject)

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 9:01 AM, Andriy Fetsun wrote: Hi Guys, It is very simple question, but I can't find the answer! Please help me. I use R and such simple function as length() doesn't work. The result is always 1 even if my data are more then 1 observations! Do I have to load any

Re: [R] productivity tools in R?

2009-07-02 Thread Miguel Bernal
Thank you very much, the function i was looking for is the one Kevin points out, foodweb. I think that function, together with the whole package mvbutils (which is somehow quite difficult to search for in CRAN!) is one of the best productivity tools in R (if not the best!) On Thursday 02 July

Re: [R] (no subject)

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 6:47 AM, Andriy Fetsun wrote: Hi, Could you please help me? I am trying to load an csv-file in R, but it works wrong! My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret-read.csv(Ret.csv) Ret X0 X0127 1 016 2 0 113 3 037 4 025 ?read.csv

Re: [R] (no subject)

2009-07-02 Thread Henrique Dallazuanna
Use scan: scan(Ret.csv, dec = ,) On Thu, Jul 2, 2009 at 7:47 AM, Andriy Fetsun fet...@googlemail.com wrote: Hi, Could you please help me? I am trying to load an csv-file in R, but it works wrong! My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret-read.csv(Ret.csv) Ret

[R] read.xls: number of sheets

2009-07-02 Thread Lauri Nikkinen
Hi, I'm trying to read several Excel sheets from an Excel file into a list. I'm using read.xls from package 'gdata'. I would like to know how I can check the number of sheets before the loop (in the example below) so that I could adjust the loop counter? Any suggestions? DF.list - list() for (i

Re: [R] Display Median in plot

2009-07-02 Thread Steve Lianoglou
Hi, I drew a plot with R of my data and now I would like to display the median values of each group above the respective datapoint in the plot. I already search for ages, but maybe I am just blind. I am sure that this has to be an option somewhere... Perhaps we could provide better input

Re: [R] Select values at random by id value

2009-07-02 Thread James Martin
ddply(df, c(date, id), function(df) df[sample(nrow(df), 1), ]) Thanks to Hadley and Sunil. The above code solves my problem. jm On Mon, Jun 29, 2009 at 9:11 AM, James Martin just.strut...@gmail.comwrote: All, I have data that looks like below. For each id there may be more than one value

Re: [R] (no subject)

2009-07-02 Thread Sarah Goslee
Well, what's Ret_1 ? It's hard to answer your question without that crucial bit of information. Try str(Ret_1) and let us know what it says. My first guess is that Ret_1 is a list, e.g.: testdata - list(f1=c(1,2,3,4)) length(testdata) [1] 1 length(testdata[[1]]) [1] 4 str(testdata) List of

Re: [R] (no subject)

2009-07-02 Thread Uwe Ligges
Andriy Fetsun wrote: Hi, Could you please help me? I am trying to load an csv-file in R, but it works wrong! See ?read.csv and about decimal different characters. Uwe Ligges My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret-read.csv(Ret.csv) Ret X0 X0127 1 016 2 0

[R] Testing for membership in an array of strings

2009-07-02 Thread Neil Tiffin
As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say mary, bob, danny, sue, and jane. I am trying to determine how to perform a logical test to determine if a variable is an exact

Re: [R] Question about - assignment

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 9:46 AM, Peter Dalgaard wrote: Duncan Murdoch wrote: - doesn't need to find z. It will replace it if found, or create a new one if not. (Personally I would have limited that to the first case, i.e. it should fail if it doesn't find z.) Possibly. It's a holdover from S, where

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Henrique Dallazuanna
Try this: c(mary, sue) %in% c(mary, bob, danny, sue,jane) On Thu, Jul 2, 2009 at 11:13 AM, Neil Tiffin ne...@neiltiffin.com wrote: As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say

Re: [R] Average of data files in a directory

2009-07-02 Thread Henrique Dallazuanna
Peter, Try this: apply(do.call(merge, c(loadfiles, by = Time))[2:3], 1, mean) On Thu, Jul 2, 2009 at 10:39 AM, Peter Perez plp...@gmail.com wrote: Hi, Thanks to Henrique and Prof. Spector for their kind reply. Indeed, the mean function does work, but the result I want is an average data

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Marc Schwartz
On Jul 2, 2009, at 9:13 AM, Neil Tiffin wrote: As an R beginner, I feel brain dead today as I can not find the answer to a relatively simple question. Given a array of string values, for example lets say mary, bob, danny, sue, and jane. I am trying to determine how to perform a logical

Re: [R] matching rows in matrices

2009-07-02 Thread Marc Schwartz
On Jul 2, 2009, at 7:27 AM, dreamworx wrote: I have a matrix such as this, [,1] [,2] [,3] [1,]112 [2,]255 and a larger matrix such as this, a b [1,] 1 5 [2,] 2 5 [3,] 4 9 [4,] 5 8 [5,] 7 8 [6,] 7 10 [7,] 9 10 what I want to do is check the number of

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Neil Tiffin
Worked like a champ. Thank you. Neil On Jul 2, 2009, at 9:20 AM, Henrique Dallazuanna wrote: Try this: c(mary, sue) %in% c(mary, bob, danny, sue,jane) On Thu, Jul 2, 2009 at 11:13 AM, Neil Tiffin ne...@neiltiffin.com wrote: As an R beginner, I feel brain dead today as I can not find

Re: [R] (no subject)

2009-07-02 Thread Steve Lianoglou
Hi, I am trying to load an csv-file in R, but it works wrong! My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret-read.csv(Ret.csv) Ret X0 X0127 1 016 2 0 113 3 037 4 025 This looks correct to me. The read.csv function assumes the first line in the file is a

Re: [R] Learning S3

2009-07-02 Thread Hadley Wickham
On Thu, Jun 18, 2009 at 12:08 PM, Dirk Eddelbuettele...@debian.org wrote: On 18 June 2009 at 09:36, Bert Gunter wrote: | -- or Chapter 4 in S PROGRAMMING? (you'll need to determine if it's reader | friendly) +1 It helped me a lot too back in the day.  But I am wondering if there are good

Re: [R] (no subject)

2009-07-02 Thread ONKELINX, Thierry
Andriy, It does exactly what you want it to do. So if the result is not what you expected, then you are supplying R with a wrong command. If you would have read the helpfile of read.csv you would have noticed the sep and dec argument would be very useful in this case. Thierry

[R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I wanted to write it's time for me to start learning about how to make output that better suits my needs. I think I have two sort of charts I

Re: [R] Testing for membership in an array of strings

2009-07-02 Thread Dirk Eddelbuettel
On 2 July 2009 at 09:13, Neil Tiffin wrote: | Given a array of string values, for example lets say mary, bob, | danny, sue, and jane. | | I am trying to determine how to perform a logical test to determine if | a variable is an exact match for one of the string values in the array | when

Re: [R] Difficulty in calculating MLE through NLM

2009-07-02 Thread Ravi Varadhan
Madan, I did tell you in my previous email about what you should do. Did you try my suggestions? Did any of them work for you? If not, please send me the details of what you tried and what the results were. Ravi.

[R] lokern package

2009-07-02 Thread Ravi Varadhan
Dear Martin, I have been playing a lot with the glkerns() function in the lokern package for automatic smoothing of time-series data. This kernel smoothing approach of Gasser and Mueller seems to perform quite well for estimating the function and its derivatives (first and second derivatives).

Re: [R] (no subject)^2

2009-07-02 Thread Ted Harding
Putting your two queries together [see revised Subject ... ]: [R] (no subject)^1: Could you please help me? I am trying to load an csv-file in R, but it works wrong! My data is 0,0127 -0,0016 0,0113 0,0037 -0,0025 Ret X0 X0127 1 016 2 0 113 3 0

Re: [R] matching rows in matrices

2009-07-02 Thread Ravi Varadhan
Here is another approach : rowmatch.count - function(a,b) { f - function(...) paste(..., sep=:) a2 - do.call(f, as.data.frame(a)) b2 - do.call(f, as.data.frame(b)) c(table(c(a2,unique(b2)))[b2] - 1) } # example a - matrix(c(1,2,1,5,2,5), 2, 3) b - matrix(c(1,2,4,5,7,7,9,2,

Re: [R] productivity tools in R?

2009-07-02 Thread Bert Gunter
-- (The Windows GUI does have syntax completion using TAB, but not the hints.) I never knew that! Where is this documented? -- i.e. where are all the features of the Windows GUI documented (as there may well be others I don't know about). -- Bert Gunter Genentech Nonclinical Statistics

Re: [R] read.xls: number of sheets

2009-07-02 Thread Henrique Dallazuanna
Try this: library(RDCOMClient) xl - COMCreate(Excel.Application) xl$Workbooks()$Open(teste.xls)$Sheets()$Count() On Thu, Jul 2, 2009 at 11:22 AM, Lauri Nikkinen lauri.nikki...@iki.fiwrote: Hi, I'm trying to read several Excel sheets from an Excel file into a list. I'm using read.xls

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I wanted to write it's time for me to start learning about how to make output that better

Re: [R] Getting the month out of my date as a number not characters

2009-07-02 Thread Don MacQueen
Try hf$hour - as.POSIXlt(hf$date)$hour hf$month - as.POSIXlt(hf$date)$mon+1 To see why, use the man pages to study the structure of POSIXlt objects. Try: tmp - strptime(20/2/06 11:16:16.683, %d/%m/%y %H:%M:%OS) unclass(tmp) For example: tmp - strptime(20/2/06 11:16:16.683,

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I wanted to write

Re: [R] productivity tools in R?

2009-07-02 Thread Gene Leynes
I have recently discovered the playwith library, which is great for creating complex lattice objects. If you start with a simple lattice plot then modify it using playwith, you can export the code to produce the spiffed up plot. I noticed this function at the bottom of the xyplot documentation in

Re: [R] Need to study and learn about better plots

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 11:26 AM, Mark Knecht wrote: On 7/2/09, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics

Re: [R] read.xls: number of sheets

2009-07-02 Thread Gabor Grothendieck
If you are on Windows and have Excel on the same machine then the code here: http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7736.html will return the number of worksheets as well as a vector of the worksheet names. It seems that the email has somehow caused some of the lines to wrap so you

[R] to creates an array

2009-07-02 Thread Barbara . Rogo
Is there a command as mat.or.vec(nr,nc) to create an array that I must calculate with more cicle? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] productivity tools in R?

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 10:53 AM, Bert Gunter wrote: -- (The Windows GUI does have syntax completion using TAB, but not the hints.) I never knew that! Where is this documented? -- i.e. where are all the features of the Windows GUI documented (as there may well be others I don't know about). The

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Mark Knecht markkne...@gmail.com wrote: On 7/2/09, Steve Lianoglou mailinglist.honey...@gmail.com wrote: SNIP In particular, the graph below looks *somehow* similar to the chart you link to. http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109 SNIP What a

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Dirk Eddelbuettel
On 2 July 2009 at 11:14, Steve Lianoglou wrote: | On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: | 2) The closest example of the second would be a multi-study chart sort | of like is typical in a lot of stock charting programs. Here's (I | hope) a simple example: | |

[R] multiple comparisons and generalized least squares

2009-07-02 Thread Alaerts Katrijn
Dear R users, I 'm working on a dataset consisting of 4 different dataframes with tree, leaf, fruit and seed measurements made on 300 trees, coming from 10 provenances (30 trees per provenance, 10 leaves/fruits/seeds per tree). Provenances are fixed effects (they were not randomly chosen), but

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Gabor Grothendieck
plot.zoo and xyplot.zoo in the zoo package both produce multipanel plots with one panel per series (or optionally all on one panel or a mixture). library(zoo) example(plot.zoo) example(xyplot.zoo) and see the three zoo vignettes. The quantmod package has charting specifically oriented to

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 11:26 AM, Mark Knecht wrote: On 7/2/09, Steve Lianoglou mailinglist.honey...@gmail.com wrote: [snip] One thing you could do is to peruse the R Graph Gallery to see what people can do: http://addictedtor.free.fr/graphiques/ In particular, the graph below looks

Re: [R] productivity tools in R?

2009-07-02 Thread Mark Knecht
On 7/1/09, seeliger.c...@epamail.epa.gov seeliger.c...@epamail.epa.gov wrote: ... I saw my friend has a R Console window which has automatic syntax reminder when he types in the first a few letters of R command. ... You might be thinking of JGR (Jaguar) at

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Dirk Eddelbuettel e...@debian.org wrote: On 2 July 2009 at 11:14, Steve Lianoglou wrote: | On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: | 2) The closest example of the second would be a multi-study chart sort | of like is typical in a lot of stock charting programs. Here's

Re: [R] to creates an array

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 11:13 AM, barbara.r...@uniroma1.it wrote: Is there a command as mat.or.vec(nr,nc) to create an array that I must calculate with more cicle? I'm not sure your question is very clear: what do you mean by calculate with more cicle? Could you give an example of what

[R] R package to analyze time course microarray data

2009-07-02 Thread ss
Hello! Just want to get some suggestions on which R package is good for analyzing time course microarray data. Thank you so much for your input! Sincerely, Allen [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

  1   2   >