[R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread mgilgen
i'm trying to convert a zoo object of the following specifications: str(z) atomic [1:15642] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, index)='POSIXct', format: chr [1:15642] 2004-09-01 02:00:00 2004-09-01 03:00:00 2004-09-01 04:00:00 2004-09-01 05:00:00 ... - attr(*, frequency)= num 0.000278 to

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Achim Zeileis
On Thu, 23 Aug 2007 [EMAIL PROTECTED] wrote: i'm trying to convert a zoo object of the following specifications: str(z) atomic [1:15642] 0 0 0 0 0 0 0 0 0 0 ... - attr(*, index)='POSIXct', format: chr [1:15642] 2004-09-01 02:00:00 2004-09-01 03:00:00 2004-09-01 04:00:00 2004-09-01

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Marc Gilgen
Thanks for the inputs, but it's not exactly what I want... My problem is, that my timeseries (precipitation) contain lots of NA-values and when I apply the code: z- data.frame(a=p1$time.date, precip=p1$m1) #gives a dataframe with precipitation and time (2004-01-01 02:12:00) z-

Re: [R] Conversion of zoo object (with POSIXct-attributes) to dataframe

2007-08-23 Thread Achim Zeileis
On Thu, 23 Aug 2007, Marc Gilgen wrote: Thanks for the inputs, but it's not exactly what I want... You did not provide sufficient information. In particular, you still do not provide a small reproducible example. My problem is, that my timeseries (precipitation) contain lots of NA-values

[R] conversion into capital letter

2007-05-15 Thread jessica . gervais
Dear all, I would need a function which convert small letter into capital letter (at least the first letter of a character variable). Does such a function exist in R ? Thanks by advance Jessica __ R-help@stat.math.ethz.ch mailing list

Re: [R] conversion into capital letter

2007-05-15 Thread Patnaik, Tirthankar
Try ?toupper -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, May 15, 2007 12:11 PM To: R-help@stat.math.ethz.ch Subject: [R] conversion into capital letter Dear all, I would need a function which convert small letter

Re: [R] conversion into capital letter

2007-05-15 Thread Benilton Carvalho
help(toupper) b On May 15, 2007, at 2:41 AM, [EMAIL PROTECTED] wrote: Dear all, I would need a function which convert small letter into capital letter (at least the first letter of a character variable). Does such a function exist in R ? Thanks by advance Jessica -- Benilton

Re: [R] conversion into capital letter

2007-05-15 Thread Marc Schwartz
On Tue, 2007-05-15 at 08:41 +0200, [EMAIL PROTECTED] wrote: Dear all, I would need a function which convert small letter into capital letter (at least the first letter of a character variable). Does such a function exist in R ? Thanks by advance Jessica See ?toupper and take note

Re: [R] Conversion from string to date type

2007-03-24 Thread Toby Gass
Hello, Andreas I'm glad the previous replies helped you solve your problem. I think your original problem, though, was caused by a typo. Note the comma between the month and the year in your script and the period between the month and the year in Jim Holtman's script. From Jim Holtman:

[R] Conversion from string to date type

2007-03-23 Thread Andreas Tille
Hi, I'm on my very first steps to R and so I hope that I do not ask a really stupid questions but I did not found it via R-Search, in the FAQ or Google (BTW, the name R is not a really good seekiong criterion ;-) ). I have a data file containing a table that containes dates and values like

Re: [R] Conversion from string to date type

2007-03-23 Thread jim holtman
Here is how you can convert them to a Date object: x - c('01.03.2007','02.03.2007','03.03.2007') y - as.Date(x, format=%d.%m.%Y) y [1] 2007-03-01 2007-03-02 2007-03-03 str(y) Class 'Date' num [1:3] 13573 13574 13575 On 3/23/07, Andreas Tille [EMAIL PROTECTED] wrote: Hi, I'm on my

Re: [R] Conversion from string to date type

2007-03-23 Thread Andreas Tille
On Fri, 23 Mar 2007, jim holtman wrote: Here is how you can convert them to a Date object: x - c('01.03.2007','02.03.2007','03.03.2007') y - as.Date(x, format=%d.%m.%Y) y Well, this is what I tried when reading the docs, but mydata - read.csv(file='mydata.dat', sep = '\t', quote='',

Re: [R] Conversion from string to date type

2007-03-23 Thread Gabor Grothendieck
Read the help desk article in R-News 4/1 and see ?as.Date ?strptime (for setting the as.Date format= argument) Also, you might be interested in the zoo package library(zoo) ?read.zoo vignette(zoo) vignette(zoo-quickref) On 3/23/07, Andreas Tille [EMAIL PROTECTED] wrote: Hi, I'm on my very

Re: [R] Conversion from string to date type

2007-03-23 Thread Dirk Eddelbuettel
Hi Andreas, Welcome to r-help :) On 23 March 2007 at 22:21, Andreas Tille wrote: | I'm on my very first steps to R and so I hope that I do | not ask a really stupid questions but I did not found it | via R-Search, in the FAQ or Google (BTW, the name R is | not a really good seekiong criterion

Re: [R] Conversion from string to date type

2007-03-23 Thread Andreas Tille
On Fri, 23 Mar 2007, Dirk Eddelbuettel wrote: Nit 1: read.csv() is for csv files which tend to have , as a separator; read.table() is more useful here. Well, that's correct. read.csv was just a leftover from former tests and finally it worked also this way - but thanks for the hint anyway.

[R] Conversion of column matrix into a vector without duplicates

2007-01-24 Thread Shubha Vishwanath Karanth
Hi R, I have a matrix A, A= [,1] [,2] [1,] a u [2,] b v [3,] c x [4,] d x [5,] e x I want to put the 2nd column of this matrix in a vector without duplicates. i.e., my vector v should be (u, v, x), whose length is 3. Can anybody help me on this?

Re: [R] Conversion of column matrix into a vector without duplicates

2007-01-24 Thread Dimitris Rizopoulos
://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: Shubha Vishwanath Karanth [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Wednesday, January 24, 2007 2:12 PM Subject: [R] Conversion of column matrix into a vector without duplicates Hi R, I have

Re: [R] Conversion of column matrix into a vector without duplicates

2007-01-24 Thread ONKELINX, Thierry
dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Shubha Vishwanath Karanth Verzonden: woensdag 24 januari 2007 14:13 Aan: r-help@stat.math.ethz.ch Onderwerp: [R] Conversion of column matrix

Re: [R] Conversion of column matrix into a vector without duplicates

2007-01-24 Thread Chuck Cleland
Shubha Vishwanath Karanth wrote: Hi R, I have a matrix A, A= [,1] [,2] [1,] a u [2,] b v [3,] c x [4,] d x [5,] e x I want to put the 2nd column of this matrix in a vector without duplicates. i.e., my vector v should be (u, v, x), whose length

[R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
Dear All I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2 However, the following does not work: x - expression(62/100) as.numeric(as.character(x)) [1] NA Warning message: NAs introduced by

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Barry Rowlingson
Paul Smith wrote: x - expression(62/100) as.numeric(as.character(x)) [1] NA Warning message: NAs introduced by coercion Any idea about how to deal with the second case? eval-uate the expression: x - expression(62/100) eval(x) [1] 0.62 Barry

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
On 11/23/06, Barry Rowlingson [EMAIL PROTECTED] wrote: x - expression(62/100) as.numeric(as.character(x)) [1] NA Warning message: NAs introduced by coercion Any idea about how to deal with the second case? eval-uate the expression: x - expression(62/100) eval(x) [1]

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Peter Dalgaard
Paul Smith [EMAIL PROTECTED] writes: Dear All I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2 However, the following does not work: x - expression(62/100)

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Paul Smith
On 23 Nov 2006 18:20:17 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2 However, the following does not work: x -

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Gabor Grothendieck
On 11/23/06, Paul Smith [EMAIL PROTECTED] wrote: On 23 Nov 2006 18:20:17 +0100, Peter Dalgaard [EMAIL PROTECTED] wrote: I am trying to convert from the type expression to the type numeric. The following works: x - expression(6.2) as.numeric(as.character(x)) [1] 6.2

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Peter Dalgaard
Paul Smith [EMAIL PROTECTED] writes: Thanks, Peter. I did not know about the existence of the command 'eval', in spite of the fact of having searched the Internet for a solution for my problem. 'eval' seems not working in connection with Ryacas: library(Ryacas) x - yacas(2/3*5/7) x

Re: [R] Conversion from expression to numeric

2006-11-23 Thread Gabor Grothendieck
Also note that Ryacas provides an Eval which has a yacas method that simplifies writing this: library(Ryacas) Eval(yacas(1/2)) See ?Eval On 11/23/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: On 11/23/06, Paul Smith [EMAIL PROTECTED] wrote: On 23 Nov 2006 18:20:17 +0100, Peter Dalgaard

[R] conversion of LL coordenates to UTM problems (ED50-WGS84 format)

2006-10-18 Thread Berta
Hi R-Users, I have plotted a region whose polygon coordinates are given in shp format ED50 UTM (zone=30) ) using readShapePoly in library(maptools). Now I need to plot a set of points in that region (my.dataframe, with X and Y geographic coordinates), which have been read using GPS in

Re: [R] conversion of LL coordenates to UTM problems (ED50-WGS84 format)

2006-10-18 Thread Roger Bivand
On Wed, 18 Oct 2006, Berta wrote: Hi R-Users, I have plotted a region whose polygon coordinates are given in shp format ED50 UTM (zone=30) ) using readShapePoly in library(maptools). Now I need to plot a set of points in that region (my.dataframe, with X and Y geographic coordinates),

Re: [R] conversion from RData to R file

2005-11-21 Thread Loncar, Dejan
I would highly appreciate some hints regarding this issue. Regards, Dejan _ From: Loncar, Dejan Sent: 15 November 2005 10:32 To: 'r-help@stat.math.ethz.ch' Subject: conversion from RData to R file Dear all I am beginner in

Re: [R] conversion from RData to R file

2005-11-21 Thread Berton Gunter
. Box -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Loncar, Dejan Sent: Monday, November 21, 2005 8:22 AM To: r-help@stat.math.ethz.ch Subject: Re: [R] conversion from RData to R file I would highly appreciate some hints regarding this issue

Re: [R] conversion from RData to R file

2005-11-21 Thread Ted Harding
On 21-Nov-05 Berton Gunter wrote: Please read the docs! -- especially An Introduction to R. There is no need whatever to have your **data** in text format (other than, perhaps, to read into into R), which is generally what R format (a .R suffix in the filename, I presume) indicates. I would

[R] conversion from RData to R file

2005-11-15 Thread Loncar, Dejan
Dear all I am beginner in R coding and have a problem to figure out how to convert RData format into R format. After I converted csv file using read.csv I got RData file but to run some R code need R format Many Thanks Dejan [[alternative HTML version deleted]]

Re: [R] conversion from RData to R file

2005-11-15 Thread Sean Davis
On 11/15/05 4:31 AM, Loncar, Dejan [EMAIL PROTECTED] wrote: Dear all I am beginner in R coding and have a problem to figure out how to convert RData format into R format. After I converted csv file using read.csv I got RData file but to run some R code need R format You can simply load

[R] conversion from SAS

2005-07-28 Thread alessandro carletti
Hi, I wonder if anybody could help me in converting this easy SAS program into R. (I'm still trying to do that!) PROC IMPORT OUT= WORK.CHLA_italian DATAFILE= C:\Documents and Settings\carleal\My Documents\REBECCA\stat\sas\Allnutrients.xls DBMS=EXCEL2000 REPLACE;

Re: [R] conversion from SAS

2005-07-28 Thread Frank E Harrell Jr
alessandro carletti wrote: Hi, I wonder if anybody could help me in converting this easy SAS program into R. (I'm still trying to do that!) Converting that program into R will be very feasible and the solution will be far more elegant than SAS. But I think you are expecting other people to

[R] conversion

2005-06-28 Thread Anna Oganyan
Dear List, How can I convert a list with elements being character strings, like: c(1,2,3,4), “c(1,3,4,2) … to a list with elements as numerical vectors: c(1,2,3,4), c(1,3,4,2)…? Thanks! Anna __ R-help@stat.math.ethz.ch mailing list

Re: [R] conversion

2005-06-28 Thread Sundar Dorai-Raj
Anna Oganyan wrote: Dear List, How can I convert a list with elements being character strings, like: c(1,2,3,4), “c(1,3,4,2) … to a list with elements as numerical vectors: c(1,2,3,4), c(1,3,4,2)…? Thanks! Anna Try: x - list(c(1,2,3,4), c(1,3,4,2)) lapply(x, function(x)

Re: [R] conversion

2005-06-28 Thread Marc Schwartz (via MN)
On Tue, 2005-06-28 at 17:23 -0400, Anna Oganyan wrote: Dear List, How can I convert a list with elements being character strings, like: c(1,2,3,4), “c(1,3,4,2) … to a list with elements as numerical vectors: c(1,2,3,4), c(1,3,4,2)…? Thanks! Anna l - list(c(1,2,3,4), c(1,3,4,2)) l [[1]]

Re: [R] conversion

2005-06-28 Thread Spencer Graves
as.numeric? spencer graves Anna Oganyan wrote: Dear List, How can I convert a list with elements being character strings, like: c(1,2,3,4), “c(1,3,4,2) … to a list with elements as numerical vectors: c(1,2,3,4), c(1,3,4,2)…? Thanks! Anna

[R] conversion factor into numeric

2005-05-06 Thread Smit, R. \(Robin\) \(IenT\)
Thank you all for your (fast) comments. Unfortunately I could not make the advise work: mass [1] 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 910 910 910 910 910 910 910 [26] 910 910 910 910 910 910 910

Re: [R] conversion factor into numeric

2005-05-06 Thread Koen Pelleriaux
Robin, It will work if you use decimal points (not comma) HTH Koen On 5/6/05, Smit, R. (Robin) (IenT) [EMAIL PROTECTED] wrote: Thank you all for your (fast) comments. Unfortunately I could not make the advise work: mass [1] 800 800 800 800 800 800 800 800 800 800

Re: [R] conversion factor into numeric

2005-05-06 Thread Dimitris Rizopoulos
@stat.math.ethz.ch Sent: Friday, May 06, 2005 2:17 PM Subject: [R] conversion factor into numeric Thank you all for your (fast) comments. Unfortunately I could not make the advise work: mass [1] 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800 800

Re: [R] conversion factor into numeric

2005-05-06 Thread Douglas Bates
://www.med.kuleuven.ac.be/biostat/ http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm - Original Message - From: Smit, R. (Robin) (IenT) [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Sent: Friday, May 06, 2005 2:17 PM Subject: [R] conversion factor into numeric Thank you

[R] Conversion of Affy IDs , LocusLink IDs etc...

2005-02-10 Thread Pankaj Chopra
Hi, I was trying to compare differential expression data from multiple studies ( 4 dataset downloaded from NCBI GEO). The expression dataset are from Affy, as well as cDNA (dual channel) platforms. Before I conduct analysis, I have to map the gene IDs so that the different genes are comparable.

Re: [R] Conversion of Affy IDs , LocusLink IDs etc...

2005-02-10 Thread Uwe Ligges
Pankaj Chopra wrote: Hi, I was trying to compare differential expression data from multiple studies ( 4 dataset downloaded from NCBI GEO). The expression dataset are from Affy, as well as cDNA (dual channel) platforms. Before I conduct analysis, I have to map the gene IDs so that the different

RE: [R] Conversion of Affy IDs , LocusLink IDs etc...

2005-02-10 Thread Berton Gunter
Chopra Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Conversion of Affy IDs , LocusLink IDs etc... Pankaj Chopra wrote: Hi, I was trying to compare differential expression data from multiple studies ( 4 dataset downloaded from NCBI GEO). The expression dataset are from Affy, as well

[R] conversion of a data.frame of numerics to a data.frame of factors

2004-10-09 Thread Patrick Giraudoux
Hi, I am trying to convert a data.frame of numerics (this could be a matrix as well in this case) into a data.frame of factors. I did it in a way that is less than direct... myforet2-t(myforet) for (i in 1:length(myforet2[1,])) { if (i == 1)myforetfact-list(as.factor(myforet2[,i]))

Re: [R] conversion of a data.frame of numerics to a data.frame of factors

2004-10-09 Thread Prof Brian Ripley
On Sat, 9 Oct 2004, Patrick Giraudoux wrote: mydf[] - lapply(mydf, as.factor) would appear to be what you want. For a matrix, I presume you want a factor matrix as the result. Something like my - matrix(1:12, 3, 4) dmy - dim(my) my - as.factor(my) dim(my) - dmy my which does not print as a

Re: [R] conversion of a data.frame of numerics to a data.frame of factors

2004-10-09 Thread Patrick Giraudoux
] To: Patrick Giraudoux [EMAIL PROTECTED] Cc: r-help [EMAIL PROTECTED] Sent: Saturday, October 09, 2004 4:32 PM Subject: Re: [R] conversion of a data.frame of numerics to a data.frame of factors On Sat, 9 Oct 2004, Patrick Giraudoux wrote: mydf[] - lapply(mydf, as.factor) would appear

RE: [R] R conversion

2004-09-09 Thread John Fox
PROTECTED] On Behalf Of Mark Strivens Sent: Thursday, September 09, 2004 7:26 PM To: [EMAIL PROTECTED] Subject: [R] R conversion I am a newcomer to R trying to convert a SAS program to R. Does anyone know if there is a functional equivalent of the SAS 'Factor' procedure? For example in SAS

Re: [R] R conversion

2004-09-09 Thread Mark Strivens
Thanks John for the post - I had found factanal However factanal it seems you have specify the number of factors to be fitted up front, whereas with the SAS procedure you don't - this is apparently important to the analysis! Perhaps I could emulate this function by breaking it down using factor

[R] conversion of some lines of matlab code to R

2003-10-06 Thread Christoph Lehmann
Dear R-users I got some matlab code (just a few lines) for the deconvolution of a signal: function q=Dconvolve(funct) w=squeeze(size(funct)); % gets the length t=0:3:(w(1,1)-1)*3; h=Dehemo(t,1.25,3); r=fft(h); rinv = 1./r; q = real(ifft( fft(funct(:)).*rinv(:)));

[R] Conversion to S4 classes and methods

2003-02-20 Thread Douglas Bates
Recently on R-help there has been some discussion of the use of S4 classes and methods from the methods package in R. I will be presenting a paper (joint work with Saikat DebRoy) at DSC-2003 entitled Converting a large R package to S4 classes and methods. A preprint copy of the paper is now

[R] conversion of a list of matrices into a dataframe

2003-01-23 Thread Wolfram Fischer
DATA I have data from two (or more) locations with ID: 'A' and 'B' for three (or more) YEARS: 1999 to 2001 of two (or more) variables: VAR1, VAR2. x ID YEAR VAR1 VAR2 1 A 199992 2 B 199989 3 A 200023 4