[R] Difficulty with formatting scatter.smooth output

2007-04-13 Thread Bing Ho
Hello,

I have been using scatter.smooth and been trying to format my plots  
and been unable to adjust the line type or color of the smooth curve.

When I specify col in scatter.smooth, I can adjust the color of the  
scatter plot points, but the line always stays black and solid. lty  
has no effect.

When I specify par prior to calling scatter.smooth, col will change  
the color of the points, smoothed line, and bounding box. lty,  
col.axis, col.lab work as expected.

What I would like to be able to do is format each element of the graph  
specifically - bounding box, points, and smoothed curve.

Thank you for any advice.

__
[EMAIL PROTECTED] 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] DBI + RSQLite or SQLiteDF?

2007-03-21 Thread Bing Ho
Hello,

I've finally reached the wall - my 2gb RAM machine simply can't handle
the datasets that I am working with. I've tried a 64-bit compile of R on
a 8gb RAM machine but that's not always available to use.

Now there are several proposed ways around this, but it seems the most
general solution is to leverage a SQL database to manage large datasets.

I thought I'd ask around to see what is the best approach before I went
off and expended a bunch of time being unable to get anything to work. I
have no experience with SQL or database administration.

My dataframes are in the 100,000 x 10,000 range (at the most) with a mix
of numerical, factor, and character data.

What works best right now - DBI + RSQLite, or would SQLiteDF be better,
for somebody with basically NO experience?

Thank you,
Bing

__
R-help@stat.math.ethz.ch 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] Problem using reshape with missing values in idvar

2005-10-31 Thread Bing Ho
Hello everybody,

I have been recently using reshape to convert long data to wide 
data. Everything was going well until I reached some problematic 
datasets. It has taken me a couple of weeks to finally figure out 
what might be happening.

The problem is reproducible with test cases, and on two versions of R 
(Windows 2.2.0 and x86-64 Fedora Core 3 R 2.2.0).

The data started out in Microsoft Excel 2003 before being saved as a 
.csv file. The data stores the records of study participants which 
may return a variable number of times for follow up (between one to 
several dozen follow up visits). The research staff would start a row 
of data for each study participant, and each follow up visit would be 
row underneath the previous row for that study participant. Because 
of the variable nature of follow up, many fields will be NA since 
some participants may have only one study.

A sample is as follows (note that the ID appears consecutively for 
each follow up, or in other words, all the ID are grouped chronologically)
ID  DOB  GENDER  ETHNICITY  TESTDATE TESTRESULT
1 1/1/1900 1 1 1/1/2005 100
1 1/1/1900 1 1 1/2/2005 110
2 8/1/1930 2 1 2/1/2005 80
3 12/1/1990 2 2 3/1/2005 200
3 12/1/1990 2 2 3/2/2005 205
3 12/1/1990 2 2 3/3/2005 220

My code is as follows:
df - read.csv(df.csv)  # Read .csv file into R
df.tt - sequence(rle(df$ID)$length)  # Create a sequence vector tt 
based on the number of times ID appears
# Then reshape from long into wide format, with only the time-varying 
variables repeated
df_wide - reshape(cbind(df.tt,df), 
idvar(ID,DOB,GENDER,ETHNICITY), timevar=tt,direction=wide)

This testcase works fine.

Now taking a similar test case, with some missing values in the 
idvar, like so,
ID  DOB  GENDER  ETHNICITY  TESTDATE TESTRESULT
1 1/1/1900 1 1 1/1/2005 100
1 1/1/1900 1 1 1/2/2005 110
2 8/1/1930 NA NA 2/1/2005 80
3 12/1/1990 NA NA 3/1/2005 200
3 12/1/1990 NA NA 3/2/2005 205
3 12/1/1990 NA NA 3/3/2005 220

Will result with a wide dataframe that only has id 1 and 2 (3 is dropped).

It took me some time to figure out that missing values in idvar will 
result in the problem. As long as the idvar does not have any missing 
values, all works out well.

Is there a way to use reshape to handle missing values in the idvar? 
I'm just trying to avoid unnecessary expansion of my dataset with the 
reshape command by holding the six dozen or so demographic variables 
in my actual datasets constant.

Thank you for your help!

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] (no subject)

2005-10-07 Thread Bing Ho


Hello,

I noticed that the README found in /bin/windows/contrib/ATLAS indicates that
the ATLAS version is 3.4.1. According to the ATLAS sourceforge site, 3.6.0
the latest stable version.

Does anybody know if the ATLAS Rblas.dll are 3.4.1 or 3.6.0, and if they are
not the latest version, is there a technical reason why they have not been
updated?

Thank you,
Bing Ho

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Transform variable number of rows per subject to column variables?

2005-09-19 Thread Bing Ho
Hello,

I am very new to R, but I am having trouble with my dataset.

I have a data frame where a subject has a variable number of multiple 
observations for each row, which I wish the transform these 
observations to column variables.

An example of the data frame
ID  TEST.A  TEST.B
1   10  1
1   13  2
1   11  1
2   15  2
2   17  3

And I wish to transform it to the following:
ID  TEST.A1 TEST.A2 TEST.A3 TEST.B1 TEST.B2 TEST.B3
1   10  13  11  1   2   
1
2   15  17  NA  2   3   
NA

In other words, for the variable number of repeated follow up 
studies, a new column variable for each subject, but they are grouped 
by the original test.

Thank you for any help - I'm realizing that I am a terrible programmer!

Bing Ho

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Trouble with SciViews-R 0.7-3, SciViews R 0.8-7, and Tinn-R 1.16.1.5

2005-08-02 Thread Bing Ho
Hello everybody,

I am new to using Windows and R, and have been experimenting with various
packages.

I recently installed R 2.1.1 under Windows XP SP2, and tried installing the
latest versions of SciViews (0.7-6, and R package 0.8-7 found on the
sciviews.org website), and also Tinn-R 1.16.1.5 stable. I have also been
experimenting with R Commander 0.9-14 stable, 1.0-2 stable, and also tried
1.1 unstable (along with dependent packages).

Oddly, although the installer for SciViews says version 0.7-3, the About
dialog box says 0.7.6. I am not certain which is the correct version.

I have confirmed incompatibility with the latest stable and unstable R
Commander and SciViews (recently noted by Grosjean in R-help). R Commander
0.9-14 does work with SciViews 0.7.6 (.3?), but also produces the
previously reported error that R Commander is not installed (answering No
to installing, will allow the correct dialog box to open).

I have noticed the following additional two behaviours which have
consistently been produced.

1. After installing SciViews 0.8-7 package from the SciViews website, the
call-tip functionality is broken in Tinn-R 1.16.1.5 stable. Downgrading, or
installing, the SciViews 0.8-6 from CRAN restores, or enables, this
functionality.

2. The Packages menu in SciViews-R 0.7.3 is hopelessly broken for me (at
least under R 2.1.1). The only menu option that works sometimes, for
reasons I am unable to elucidate, is Load packages (the first option);
however, many times Rconsole crashes altogether. The other menu choices
result in nothing happening. I am able to replicate this behaviour with
multiple fresh installs of R 2.1.1, SciViews 0.7-6 (3?) (and SciViews 0.8.7
package), and tcltk2 0.7-4.

I am not sure that these reports matter since it appears that SciViews will
shortly be updated, but since I found no mention of these issues, I am
hopeful that the next version may fix them.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html