[R] strings as factors

2006-12-11 Thread Alexander Nervedi
Hi,
To be able to match cases with a benchmark I need to have a data.frame with 
a character id variable. however, I am surprised why this seems to be so 
hard. In fact I was  unable to succeed. Here is what I tried:

test1 -expand.grid(ID = 1:2, sex = c(male,female))
is(test1[,2])
[1] factor   oldClass
test2 -expand.grid(ID = 1:2, sex = c('male','female'))
is(test2[,2])
[1] factor   oldClass
test3 -expand.grid(ID = 1:2, sex = I(c(male,female)))
is(test3[,2])
[1] factor   oldClass
test4 -expand.grid(ID = 1:2, sex = I(c('male','female')))
is(test4[,2])
[1] factor   oldClass
options(stringsAsFactors = FALSE)
options(stringsAsFactors)
$stringsAsFactors
[1] FALSE

test5 -expand.grid(ID = 1:2, sex = I(c('male','female')))
is(test5[,2])
[1] factor   oldClass


is there anyway I can get sex to be a character?

Arnab

_
Visit MSN Holiday Challenge for your chance to win up to $50,000 in Holiday

__
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.


Re: [R] RSQLite +textConnection()

2006-11-28 Thread Alexander Nervedi
Hi Seth,

Thank you for taking the trouble to look. I have created some code that 
simulates the problem. SOme additional observations are:

a) After giving the error Error in textConnection(readLines(f, n = 2)) : 
all connections are in use I cannot ask for sessionInfo(). I get the error 
message
sessionInfo()
Error in gzfile(file, rb) : all connections are in use

So I am presenting the sessionInfo() output after reading in the first 124 
files.

sessionInfo()
R version 2.4.0 (2006-10-03)
i686-pc-linux-gnu

locale:
LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] methods   stats graphics  grDevices utils datasets
[7] base

other attached packages:
RSQLite  DBI
0.4-1 0.1-10

Next, below is the code that I used to generate this. Its not too big so i 
just pasted it into the email. it creates 130 files first and then tries to 
read them in and save them in alexander.db, it then performs a query and 
then closes.

Hopefully, this will be helpful in tracking down the source of the problem.

thank you,

Alex.

# R Script

test.dir - /home/alex/test
setwd(test.dir)
N  - 130
dat -data.frame(ID = 1:N, Marks = runif(N)*100, Class = sample(c(I, 
II,III,IV),size = N, replace = TRUE) )
for (i in 1:N){
write.csv(dat[i,], paste(test-, i,.csv, sep = ), row.names = 
FALSE)
}

# getting the filenames
filename - list.files()
library(RSQLite)
driver-dbDriver(SQLite)
connect-dbConnect(driver, dbname = alexander.db)

lapply(filename[1:124], FUN = function(x){
cat(paste(doing,x, \n))
testID - as.data.frame((scan(file = x, what = list(ID = 1, Marks = 
35.0861437153071, Class = II), skip = 1, sep = ,)))
dbWriteTable(connect, grades, testID, row.names = FALSE, append = 
TRUE, eol = \r\n )
})

# LIST ALL TABLES IN THE DATABASE
dbListTables(connect)

# QUERY DATA AGAINST TBL_ratings IN THE DATABASE
query01-dbSendQuery(connect, statement = select * from tbl_ratings);

# FETCH 10 RECORDS OF DATA INTO A DATA FRAME
(data01-fetch(query01, n = 10));

# CLOSE THE CONNECTION
sqliteCloseConnection(connect);



From: Seth Falcon [EMAIL PROTECTED]
To: Alexander Nervedi [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], r-help@stat.math.ethz.ch
Subject: Re: [R] RSQLite +textConnection()
Date: Mon, 27 Nov 2006 21:50:23 -0800

Alexander Nervedi [EMAIL PROTECTED] writes:

  They are uptodate. When I run it on windows the i can load upto 200
  files, while on Linux it stops after loading 125.

Could you provide as much of a reproducible example as possible (along
with sessionInfo())?  I will try and have a look.

+ seth

__
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] comma delimiter comma in text

2006-11-28 Thread Alexander Nervedi

Hi

I have data like

1, A, 24, The Red House
2, A, 25, King's Home, by the Sea
...

I'd like to read this in as three variables. I first tried

temp -read.csv(addresses, sep = , ) it worked but line 2 was broken after 
King's Home, and by the Sea as placed in another line. and so i eneded up 
with more number of rows than in the data. when i tried
temp -read.csv(addresses, sep = , , flush = TRUE) i got things right 
number of rows, but column 3 was truncated till the 3rd comma.


Is there a way i can specify to R that King's Home, by the Sea is one 
word?


u r pal, al

_
All-in-one security and maintenance for your PC.  Get a free 90-day trial!

__
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] RSQLite basic

2006-11-27 Thread Alexander Nervedi
Hi.

I am still trying to figure out how connection and RSQLIte function. When i 
run the following commands

library(RSQLite)
m - dbDriver(SQLite, max.con = 25)
con - dbConnect(m, dbname=sqlite.db)

on my windows laptop everthing works fine. For example:

m - dbDriver(SQLite, max.con = 25)
con - dbConnect(m, dbname=sqlite.db)
version
   _
platform   i386-pc-mingw32
arch   i386
os mingw32
system i386, mingw32
status
major  2
minor  4.0
year   2006
month  10
day03
svn rev39566
language   R
version.string R version 2.4.0 (2006-10-03)


However, this gives all kinds of errors when I run it on a linux box and I 
am not sure what the error message is telling me. I thought I'd crave your 
indulgence and ask for advice.


m - dbDriver(SQLite, max.con = 25)
con - dbConnect(m, dbname=sqlite.db)
Error in sqliteNewConnection(drv, ...) : RS-DBI driver: (could not connect 
to dbname sqlite.db
)


version
   _
platform   i686-pc-linux-gnu
arch   i686
os linux-gnu
system i686, linux-gnu
status
major  2
minor  4.0
year   2006
month  10
day03
svn rev39566
language   R
version.string R version 2.4.0 (2006-10-03)

thanks

- the nerdy.

_
Share your latest news with your friends with the Windows Live Spaces 
friends module.

__
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] RSQLite +textConnection()

2006-11-27 Thread Alexander Nervedi
Hi !

I am trying to read in 1000 really small text files.  When on adams, R bails 
out after reading 125 files with the error message

Error in textConnection(readLines(f, n = 2)) :
all connections are in use

I have traced this to a call to the scan() function which is at that point 
trying to read tge 126th data file.  I have tried specifically closing each 
connection i open after loading a file to avoid this. But that fails and I 
get the same error message. I googled and hit on a conversation between 
Professor Ripley and Dirk Eddelbuettel  
https://stat.ethz.ch/pipermail/r-sig-db/2006-July/000208.html that talks 
about a similar problem  - there the suggestion made which apparently worked 
was to fix a function called mysqlImportFile(). But i dont see this function 
being even in memory now.

Peculiarly, I am able to read upto 200 files when i am in windows.

I am hoping someone with more expereince with linux and/or RSQLite will have 
some suggestions. thanks!

Alex

_
Fixing up the home? Live Search can 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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RSQLite basic

2006-11-27 Thread Alexander Nervedi
Hi Seth,

I didn't realize that this conversation went off the list with Bentilon. It 
turns out the source of the problem was that I was trying to write into a 
linux sub-directory to which I didn't have write permissions. I am able to 
read and write now using dbWriteTale()

thanks for suggesting using sessionInfo() - i didn't know of the command.

Al




From: Seth Falcon [EMAIL PROTECTED]
To: Alexander Nervedi [EMAIL PROTECTED]
CC: r-help@stat.math.ethz.ch
Subject: Re: [R] RSQLite basic
Date: Mon, 27 Nov 2006 16:47:40 -0800

Hi Alexander,

Alexander Nervedi [EMAIL PROTECTED] writes:
  However, this gives all kinds of errors when I run it on a linux box and 
I
  am not sure what the error message is telling me. I thought I'd crave 
your
  indulgence and ask for advice.
 
 
 m - dbDriver(SQLite, max.con = 25)
 con - dbConnect(m, dbname=sqlite.db)
  Error in sqliteNewConnection(drv, ...) : RS-DBI driver: (could not 
connect
  to dbname sqlite.db
  )

What is your working directory when you run this command?  getwd()
will tell you.  You should verify that you have write access there.

Does sqlite.db already exist?  If so, was it created with a different
version of sqlite than you are running?

Which brings me to:

it would be helpful to see the output of sessionInfo() so we know what
versions of DBI and RSQLite you are running.

+ seth

_
Share your latest news with your friends with the Windows Live Spaces 
friends module.

__
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.


Re: [R] RSQLite +textConnection()

2006-11-27 Thread Alexander Nervedi

They are uptodate. When I run it on windows the i can load upto 200 files, 
while on Linux it stops after loading 125.

From: Seth Falcon [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: Re: [R] RSQLite +textConnection()
Date: Mon, 27 Nov 2006 17:22:57 -0800

Alexander Nervedi [EMAIL PROTECTED] writes:

  Hi !
 
  I am trying to read in 1000 really small text files.  When on adams, R 
bails
  out after reading 125 files with the error message
 
  Error in textConnection(readLines(f, n = 2)) :
  all connections are in use

Please try updating your version of DBI and RSQLite, I believe this
has been fixed.

+ seth

__
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.

_

by Pandora http://radio.msn.com/?icid=T002MSN03A07001

__
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] dotchart() help

2006-09-11 Thread Alexander Nervedi
Hi

I am having trouble with dotcharts, and I keep getting the error message:

Error in Summary.data.frame(..., na.rm = na.rm) :
only defined on a data frame with all numeric or complex variables

I am sure there is a really simple fix, but I am missing it and I wondered 
if you may have some advice. Test code from R help works prefectly, but I 
cant seem to recreate it

# example
dotchart(VADeaths)
VADeaths
  Rural Male Rural Female Urban Male Urban Female
50-54   11.7  8.7   15.4  8.4
55-59   18.1 11.7   24.3 13.6
60-64   26.9 20.3   37.0 19.3
65-69   41.0 30.9   54.6 35.1
70-74   66.0 54.3   71.1 50.0

# it works with mssing data

test -VADeaths
test[2,]- NA
test
  Rural Male Rural Female Urban Male Urban Female
50-54   11.7  8.7   15.4  8.4
55-59 NA   NA NA   NA
60-64   26.9 20.3   37.0 19.3
65-69   41.0 30.9   54.6 35.1
70-74   66.0 54.3   71.1 50.0
dotchart(test)

# So i created my own test data
test- expand.grid( Educ = c(B, I, A),
Prof = c(L, M,C),
Blacks = NA,
Asian = NA,
Hispanic = NA,
Native = NA,
Female = NA)
rownames(test) - with(test, paste(Educ,Prof, sep = -))
test[2:9,3:7] - 2
temp - test[,3:7]
temp[1, 2:3] -5

# I want to plot temp which looks like
temp
Blacks Asian Hispanic Native Female
B-L NA 55 NA NA
I-L2 22  2  2
A-L   2 22  2  2
B-M  2 22  2  2
I-M   2 22  2  2
A-M  2 22  2  2
B-C  2 22  2  2
I-C  2 22  2  2
A-C  2 22  2  2
dotchart(temp)
Error in Summary.data.frame(..., na.rm = na.rm) :
only defined on a data frame with all numeric or complex variables

Everything in temp is numeric and hence I dont understand the error message. 
Any leads would be most helpful. thank you

Al Nerdy.

_
Get the new Windows Live Messenger!

__
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] simple matrix division.

2006-09-02 Thread Alexander Nervedi
Hi

I have

x-matrix(c(1,2,3,4), ncol = 2)
x
 [,1] [,2]
[1,]13
[2,]24

I'd like these two be divided by their column totals. so 1/3 and 2/3 and 3/7 
and 4/7. The obvious
x/colSums(x)
  [,1]  [,2]
[1,] 0.333 1.000
[2,] 0.2857143 0.5714286

gives me the wrong results for off diagnal ones,  since it divides the first 
row by 3 and second by 7. The inelegant
t(t(x)/colSums(x))
  [,1]  [,2]
[1,] 0.333 0.4285714
[2,] 0.667 0.5714286

gives me the right thing. I was wondering if there is any better way of 
getting what I want.

thanks

Alex

_
Get real-time traffic reports with Windows Live Local Search

__
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.


Re: [R] Creating Vectors

2006-06-30 Thread Alexander Nervedi
Hi all.

I have a factor variable distributed over time. I am looking for an elegant 
way to code duration of a state. Suppose,

rainfall.shocks - factor(sample(c(1,2,3), size = 15, replace = TRUE, prob 
= unit.p),
+  label = c(Drought, Normal, High))

rainfall.shocks
[1] Normal  HighHighDrought Normal  Normal  HighNormal  Drought
[10] Normal  Drought Normal  Normal  Normal  Normal


So capture the duration of say drought, I'd need a variable that is able to 
keep track of rainfall.shocks as well as its past values. I was wondering if 
there is any obvious way to do this. the Drought variable in this case would 
have values

0 0 0 1 0 0 0 0 1 0 1 0 0 0 0

many thanks for the suggestions you are likely to make.

Alexander Nervedi

__
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] weird error message

2006-06-30 Thread Alexander Nervedi
Hi!

In the example below why is x[[1]] == 0.2237724 false?

Alexander Nervedi


x - runif(10)
x[[1]]
[1] 0.2237724

x
[1] 0.2237724 0.2678944 0.9375811 0.5963889 0.6180519 0.6449580 0.7308510
[8] 0.7347386 0.4837286 0.1416100

x[[1]] == 0.2237724
FALSE






From: Alexander Nervedi [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Creating Vectors
Date: Fri, 30 Jun 2006 21:57:35 +

Hi all.

I have a factor variable distributed over time. I am looking for an elegant
way to code duration of a state. Suppose,

 rainfall.shocks - factor(sample(c(1,2,3), size = 15, replace = TRUE, 
prob
 = unit.p),
+  label = c(Drought, Normal, High))
 
 rainfall.shocks
[1] Normal  HighHighDrought Normal  Normal  HighNormal  Drought
[10] Normal  Drought Normal  Normal  Normal  Normal


So capture the duration of say drought, I'd need a variable that is able to
keep track of rainfall.shocks as well as its past values. I was wondering 
if
there is any obvious way to do this. the Drought variable in this case 
would
have values

0 0 0 1 0 0 0 0 1 0 1 0 0 0 0

many thanks for the suggestions you are likely to make.

Alexander Nervedi

__
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-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] contour help

2006-05-29 Thread Alexander Nervedi
Hi

I'd like to draw some level plots but I just cant for the live of me figure 
out how to control the axis here.  The axis for both the contour plots below 
appear to be the same, although one is a subset of the other. I was 
wondering how I could explicitly specify the xand y axis locations here.

al

dat-matrix(runif(50)*20, ncol = 5)
contour(dat)
contour(dat[1:2, 1:2])

__
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] contour help

2006-05-29 Thread Alexander Nervedi
Hi

I'd like to draw some level plots but I just cant for the live of me figure 
out how to control the axis here.  The axis for both the contour plots below 
appear to be the same, although one is a subset of the other. I was 
wondering how I could explicitly specify the xand y axis locations here.

al

dat-matrix(runif(50)*20, ncol = 5)
contour(dat)
contour(dat[1:2, 1:2])

__
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] boxplot group labels

2006-05-14 Thread Alexander Nervedi
Hi All,

I would like to control the order in which my boxplots are drawn. When i 
issue the lines below I find that group a get plotted lowest, while the 
highest letter grade is plotted on the top. I want to plot the letter grades 
in descending order and I was wondering if tere is a quick way to do that.

thanks.
Alex.


play - data.frame(code = letters[round(runif(100)*10+1)], income = 
runif(100))
with(play, boxplot(income~code, horizontal = TRUE, boxwex = 0.1))

__
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


Re: [R] function to collapse data by factor/group

2006-05-08 Thread Alexander Nervedi
Dear R-users,

are there pre-programmed packages that implement integer maximization? A 
preliminary google search didnt uncover anything that seemed to match.

I want to solve something like Max{U(x) + beta*U(x+y)} with respect to y, 
where y can take only integer values.

thanks.

Alnuddy

__
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] R.matlab anyone ?

2006-05-08 Thread Alexander Nervedi
Hi

I have some code up and runnning in Matlab and need it for some stuff better 
handled in R. So R.matlab sounded terrific. However, I am having trouble 
getting it to go.
I am using R v 2.2.1 (i know i know i need to upgrade), and Windows XP and 
Matlab 6.0.0.88 (R12).

here is what I get.
# in R GUI
library(R.matlab)
Loading required package: R.oo
R.oo v1.1.6 (2006-04-03) successfully loaded. See ?R.oo for help.
R.matlab v1.1.1 (2006-01-21) successfully loaded. See ?R.matlab for help.
Matlab$startServer()
Loading required package: R.utils
R.utils v0.7.7 (2006-03-30) successfully loaded. See ?R.utils for help.
[1] 0

#

However, Matlab does open up on seperate window, but with an error message. 
This reads,

  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.

??? Error: File: C:\R\R-2.2.1\MatlabServer.m Line: 109 Column: 45
) expected, identifier found.



So I went to MatlabServer.m  and found that

108 if (port  1023 | port  49151)
109  error('Cannot not open connection. Port ('MATLABSERVER_PORT') is out of 
range [1023,49151]: %d', port);
110 end

(the numbers are the line numbers).  my guess is that I haven't been able to 
connect and the 0 i see from within R is a sign of this.  Can anyone advice 
me as to what is going on. I feel there is something missing - i can get the 
matlab command window to come up but  the connection i guess is not 
there.

Any ideas would be really helpful.

Alex.

__
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] function to collapse data by factor/group

2006-05-07 Thread Alexander Nervedi
Hi

is there an R equivalent of the Stata collpase command?

suppose i have:

classes - 1:5
schools - letters[1:5]
stud - 1:10

dat - expand.grid(School = schools, Grade = classes, Student.ID = stud)
with(dat, table(Student.ID, School))
dat$marks - rnorm(nrow(dat), 50, 25)


I  want to get the mean score by school and class  while the data is at the 
school-class-student level. I could write something up but I was wondering 
if there is already something otu there.

Alex

__
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] mle package

2006-05-02 Thread Alexander Nervedi
Hi !

There used to be a package called mle for maximum likelihood estimation. I 
couldn't find it when I tried to get the package.  Is this still available? 
Perhaps under another package?

I'd appreciate any suggestion on this.

Alex

__
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] cloud() works but wireframe() is blank

2006-04-28 Thread Alexander Nervedi
I have to be making a riddiculously silly ommission.
when I run the fillowing i get the cloud plot ok. But I cant figure out what 
I am missing out when I call wireframe.

Any help would be appreciated.

x-runif(100)
y-rnorm(100)
z-runif(100)

temp -data.frame(x,y,z)
wireframe(x~y*z,temp)
cloud(x~y*z,temp)

__
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] plot control

2006-04-24 Thread Alexander Nervedi
Dear R gurus,

I'd like to plot a distribution with the tickmarks always at the quantiles 
of the y-axis, as opposed to the quantiles of the distribution I am 
plotting. plot seems to place these ticks based on some calculations that I 
cant see (?plot doesnt show the innards of plot).

Below is some functional code, but the tick marks are placed unattractively 
since I am referencing the quantiles of the distribution. I'd ideally like 
the tickmarks to be able to reference fixed points on the y-axis and the 
show the associted values.

I'd be very grateful for ideas, suggestion and leads.

- alex.

# some code

y1-rnorm(100)
y2-runif(100)
x -1:100

l -length(y1)
mat-scale(cbind(y1,y2))

plot(x, mat[,1], col = blue, yaxt = n, ylab=)
axis(2, at = sort(mat[,1])[c(0.25*l,0.5*l,0.75*l)],
labels = round(sort(y1)[c(0.25*l, 0.5*l,0.75*l)],2))

points(x, mat[,2], col = red)
axis(4, at = sort(mat[,2])[c(0.25*l,0.4*l,0.75*l)],
labels = round(sort(y2)[c(0.25*l, 0.5*l,0.75*l)],2))

__
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] another memory size question

2006-04-13 Thread Alexander Nervedi

Hi.

I am having trouble figuring this out. Please help if you know what I am 
goffing up on.



rm(list=ls(all=TRUE))
dat-expand.grid(village.code = c(1,2,3), household.id = 1:99, member.id = 
1:41, year.code = 75:85, DOI = 1:366)

Error: cannot allocate vector of size 191502 Kb


memory.limit()

[1] 3145728000


Shouldn't I have ample memory to greate this gigantic grid?

mucho gracias el signors and signioritas,

Alnerdy

_
Don’t just search. Find. Check out the new MSN Search!

__
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

Re: [R] Binning question (binning rows of a data.frame according toa variable)

2006-03-19 Thread Alexander Nervedi


I dont as yet fully understand how trellis works. Advice would be much 
appreciated.

I have a factor variable (2 levels) and a continuous variable and I am able 
to plot a histogram of the frequencies of the continuous variable for each 
level of the factor variable using :


histogram( ~ class | one, data = data,
xlab = Grades, type = density,
 panel = function(x, ...) {
  panel.histogram(x, ...)
  
panel.mathdensity(dmathjavascript:G('/cgi-bin/hmhome?');
Today = dnorm, col = black,
args = list(mean=mean(x),sd=sd(x)))
The two distributions overlap over an area and I would like to draw vertical 
lines to demark the lower tail of the distribution which has a higher 
median, and the right tail of the distribution with lower  median.

Any suggestion would be really helpful.
thanks

ul-nadi

__
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] trellis help

2006-03-19 Thread Alexander Nervedi
apoplogies for the repeat post - i just realized i forgot to change the 
subject line


I dont as yet fully understand how trellis works. Advice would be much 
appreciated.

I have a factor variable (2 levels) and a continuous variable and I am able 
to plot a histogram of the frequencies of the continuous variable for each 
level of the factor variable using :

histogram( ~ e.ps | vdc, data = est.prop.score,
xlab = Propensity Score, type = 
density,
 panel = function(x, ...) {
  panel.histogram(x, ...)
  panel.mathdensity(dmath = dnorm, col = 
black,
args = list(mean=mean(x),sd=sd(x)))

The two distributions overlap over an area and I would like to draw vertical 
lines to demark the lower tail of the distribution which has a higher 
median, and the right tail of the distribution with lower  median.

Any suggestion would be really helpful.
thanks

ul-nadi

__
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] Map archives

2006-03-19 Thread Alexander Nervedi

Hi R Map packages users.

I just drew my first few plots using map() and am trying to see if I can 
configure it to my needs. Are there any known archives out there from where 
I can get additional data files for the map library to read? I am 
specifically look for sub-district level administrative boundary lines for 
Madhya Pradesh, India. Kind of like county lines I guess.

thanks.
Aleks

__
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


Re: [R] collocation methods

2006-03-06 Thread Alexander Nervedi
Hi All,

I have found the function poly(), that computes orthogonal polynomials. I 
was wondering if there are users of this function on the list. What kind of 
an orthognal polynomial is this fititng ? Is it, for example,  least square, 
galerkin, or collocation ?

It references Chambers and Hastie, and Kennedy and Gentle, but I dont have 
access to either.

thanks
Alex

__
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] collocation methods

2006-02-26 Thread Alexander Nervedi
Hi R Users,

I have been trying to google (in general and specifically r-project) to see 
if I can find listing that may point me to understand the state of the art 
in R for functional approximation. Unfortunately, I have been unable to find 
anything concrete.

I hope I am missing something, and hence this message. Are there packages 
out there that may implement collocation. Specifically I am trying to 
implement Chebychev polynomial approximations.

Much more generally, has the R-management thought of some kind of 
encycopaedia that will allow developers/users to figure out what kinds of 
different routines are implemented and packaged under different packages?

thanks,
currently,

R Neeu B.

__
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