[R] rewrite a data file use write.table(), count.fields() show different pattern, any suggestion appreciated.

2007-05-22 Thread Yong Wang
Dear all: I read in a tab delimited dataset, and then write it out as another file as following: I did this simply to make sure I understand the behavior of this command. data-read.table(file,header=F,sep=\t,fill=T,colClasses=character);

Re: [R] rewrite a data file use write.table(), count.fields() show different pattern, any suggestion appreciated.

2007-05-22 Thread Yong Wang
unquoted fields, how do you know they do not contain tabs? The default is quote=TRUE for a good reason. On Tue, 22 May 2007, Yong Wang wrote: Dear all: I read in a tab delimited dataset, and then write it out as another file as following: I did this simply to make sure I understand

[R] A subscript out of bonds and write.table problem on manipulating a large size dataset

2007-05-21 Thread Yong Wang
Dear all: Described below is a large data set problem (data size 2G after unzipping, table delimited). I know R is not the appropriate tool for such task, anyway I did it on a server and get some straightforward problems. 1. The first is count.fields can count all the rows, however, when I

[R] Why a multi column, tab delimited file has only one column after reading in with read.table specification sep=\t

2007-05-20 Thread Yong Wang
Dear all: I have a tab delimited file as following AGE WEIGHTPROTEIN 6 20 3 8 39 4 I tried to read it as following: data - read.table(file,sep=\t,header=T); but there is only column for the data after reading in,: dim(data);

[R] read dataset with blank space as missing value

2006-04-19 Thread Yong Wang
Dear R users As specified in the subject, a dataset as following: 56 a 1 2 3 4 5 6 7 234 b 2 3 5 . 8 1 9 457 b 2 4 6 7 3 3--the blank space should be missing value 658 f 2 3 5 6 8 1 9 the blank space at thethird row should be missing value. how should I

[R] How to do varimax rotation for principal component based factor analysis, any packages?

2006-04-16 Thread Yong Wang
Dear R users the factanal pacakge is always MLE, which package can do varimax rotation with the results from princomp ? thank you yong __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] A problem on sink() and format,suggestions appreciated

2005-05-31 Thread Yong Wang
Dear R users I get a weired problem when use sink: since the data set pretty big, I sink intermediate result for further use,following lines are consistently used when write data ### sink(dataname.txt) data sink() ## at first couples of run, all

[R] a quick ? on using read.table()

2005-05-12 Thread Yong Wang
Dear all I have a data set like following *** name ticker price # how to specify attributes for differet colums a ta 1 a ta 1 a ta 1 name ticker price # the extra headline is a problem a ta 1 a ta 1 b2 b2 b

[R] How to transform the date format as 20050425

2005-04-25 Thread Yong Wang
Dear R user, if the dates are in format as 20050425 i.e., Apr. 25 2004 can you suggest an easy way to transfom it to standard form as 2005-04-25 or 2004Apr25 or 2005/04/25 or any other format which is R recognizable? if there is no easy way to do that, can you let me know what is the function in R

[R] How to updating R to the newest version conveniently

2004-11-11 Thread Yong Wang
Dear R users I have been using R for a while. However, I don't know what is the convenient way to update R to the newest version while keep all packages I previously downloaded and installed from CRAN, if updating all those packages the same will be even better. for the time being, I reinstall

[R] How to plot PDF which is in the form of orthogonal polynomial

2004-11-01 Thread Yong Wang
Dear all using the orthogonal polymial on a set of data, I get an approximate density which basically is in the form: exp(-polynomial), as you know, the parameters are the converged coeeficients. obviously, It is hard, if not impossible, to use the inverse CDF method to get a sample and then

[R] How to plot PDF which is in the form of orthogonal polynomial

2004-10-30 Thread Yong Wang
Dear all using the orthogonal polymial on a set of data, I get an approximate density which basically is in the form: exp(-polynomial), as you know, the parameters are the converged coeeficients. obviously, It is hard, if not impossible, to use the inverse CDF method to get a sample and then

[R] Re: R-help Digest, Vol 18, Issue 3

2004-08-04 Thread Yong Wang
__ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] Re:

2004-07-14 Thread Yong Wang
use unique(data) or table(data) __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] your reference on this problem highly appreciated

2004-07-10 Thread Yong Wang
please help me on this - Message Text - Dear all R users first, sorry for that this question might not be appropriate to ask here. I wanna know theories or techinques aimed at following questions:

[R] the commands to easily find the dual variables of a standard LP problem

2004-07-03 Thread Yong Wang
Dear all I use simplex to resolve a standard LP problem, further, I want to know the dual variables of the LP problem (the dual variables when the standard LP ,or the primal problem, get its optimal solution). Is there any command for me to easily get them(the dual variables)? any suggestions

[R] a question on useage of table

2004-06-22 Thread Yong Wang
Hi, all the question is as follows v [1] 1 2 3 4 5 2 3 4 5 6 sv-sort(table(v)) sv v 1 6 2 3 4 5 1 1 2 2 2 2 what is the easy and quick way to extract the numerical vector (1,6,2,3,4,5) from sv? thank you in advance for any suggestion. regards y.w

[R] Double centering matrix construction

2004-06-18 Thread Yong Wang
Dear All do you know how to transform a matrix to a so-called double centering matrix such that sum(col) and sum(row) of the transformed matrix are all 0 vector. thanks regards yong wang __ [EMAIL PROTECTED] mailing list https

[R] any linear programming routine in R

2004-06-15 Thread Yong Wang
Dear all is there any linear programming routine available for R? if not, can you suggest any alternatives? not need to be very powerful, I get only a samll problem to resolve. many thanks yong __ [EMAIL PROTECTED] mailing list

[R] how to remove . or replace it with NA?

2004-05-29 Thread Yong Wang
Hi,all a quick question A larger file include many. (stands for missing value) for variable, say, x. after read in the file and assign it another name such as : x1-data$x but x1 is always a facotor but not numerical. so How can I get a numeric vector from the read in data frame. how can I

[R] What's wrong with this simple code???

2004-05-29 Thread Yong Wang
Hi, all I can not figure this out, please have a look and help me out. thank you! Note: this is in SPLUS, not R. I have following code *** modfit-function(yir,yew, ft) { n-length(yew) yew-yew[1:(n-1)] yy-yir-ft xx-yew-ft n-length(xx) xx0-xx[2:n] yy0 -yy [2:n]

RE: [R] how to remove . or replace it with NA?

2004-05-29 Thread Yong Wang
Samir, can you give an example for the use of sed? On Sun, 30 May 2004, Samir Mishra wrote: If the data file is in text format, is large with a lot of .s, use sed. It's MUCH faster than any other tool for this sort of thing. -Original Message- From: Yong Wang [mailto:[EMAIL

[R] A data selection problem, suggestions highly appreciated

2004-05-26 Thread Yong Wang
Hi, All I get following question: A data format like following: [Day time x y] Jan1 18:56:24 x1 y1 Jan1 18:56:25 x2 y2 Jan1 18:56:27 x3 y3 Jan1 18:56:28 x4 y4 Jan1 18:56:31 x5 y5 . . what I wanna do is to partion the time interval by unit of 5 seconds.

[R] a replacement problem

2004-03-12 Thread Yong Wang
hi,all a quick question: a vector v-c(g,r,y,g,y,y,r) needs to be v-c(1,2,3,1,3,3,2) i.e., replace g,r,y as 1,2,3 how to do that, by the way, what key words I should use to search for such basic operation command? thank you best __ [EMAIL

[R] Re: R-help Digest, Vol 13, Issue 8

2004-03-08 Thread Yong Wang
On Mon, 8 Mar 2004 [EMAIL PROTECTED] wrote: Send R-help mailing list submissions to [EMAIL PROTECTED] To subscribe or unsubscribe via the World Wide Web, visit https://www.stat.math.ethz.ch/mailman/listinfo/r-help or, via email, send a message with subject or body 'help' to

[R] how to replace NaN in a vector

2004-03-08 Thread Yong Wang
Hi, all a vector such as (1,2,4,-1,NaN,2,4,NaN) if try to replace all the NaN with a numerical value, what's the easiest way? thanks a lot best yong __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] LME, where is the package?

2004-02-27 Thread Yong Wang
Hi, all My R 1.7.1 can not find lme, I just downloaded and installed the file lme4 from Crane, is this the same as lme? the problem is R still print no function named lme, how should I do. thank you __ [EMAIL PROTECTED] mailing list

[R] how to keep functions while remove all other commands

2004-01-24 Thread Yong Wang
Dear all: a quick question: I am used to apply rm(list=()) regularly to remove all old codes in preventing them creeping in current analysis.however, with that application, functions I wrote are also removed. please let me know how to keep the thing you want while remove those you don't. thank

[R] where to get the leaps package

2003-11-22 Thread Yong Wang
Dear all I am supposed to use Mallow's Cp creterion to select a model which require a leaps package. the version right now I am using is R 1.7.1(os:windows), the leaps package is not included. please let me know how and where can I get this package and add it to the current version, any caution on

[R] how to seperate R's input and output screen?

2003-10-12 Thread Yong Wang
Dear all can anybady tell me how to seperate R's input and output screen?I mean just like SAS or some others, the commands does not mixed with results. thank you __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

[R] please help me on this problem

2003-10-05 Thread Yong Wang
Dear all: I am totally new to R, actually, statistics software.I get two very simple, even stupid question: 1) where I should put the data file in order to use it , I tried to build a work dir in library( package:base) and save the text file (data) there, then, I use read.table(filename), not