Re: [R] radial.plot(plotrix) - plotting multiple polygons?

2009-01-16 Thread Jim Lemon
Stefan Uhmann wrote: Dear List, Dear Jim, is it possible to draw multiple polygons with different line types? lty=c or line.lty=c do not work with radial.plot (in the matrix case) as well as add=TRUE. Hi Stefan, As this is the second request for multiple line characteristics this week, I

[R] Value Lookup from File without Slurping

2009-01-16 Thread Gundala Viswanath
Dear all, I have a repository file (let's call it repo.txt) that contain two columns like this: # tag value AAA0.2 AAT0.3 AAC 0.02 AAG 0.02 ATA0.3 ATT 0.7 Given another query vector qr - c(AAC, ATT) I would like to find the corresponding value for each query above,

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Carlos J. Gil Bellosta
On Fri, 2009-01-16 at 18:02 +0900, Gundala Viswanath wrote: Dear all, I have a repository file (let's call it repo.txt) that contain two columns like this: # tag value AAA0.2 AAT0.3 AAC 0.02 AAG 0.02 ATA0.3 ATT 0.7 Given another query vector qr - c(AAC,

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Wacek Kusnierczyk
you might try to iteratively read a limited number of line of lines in a batch using readLines: # filename, the name of your file # n, the maximal count of lines to read in a batch connection = file(filename, open=rt) while (length(lines - readLines(con=connection, n=n))) { # do your stuff

[R] reading data from Excel Spread sheet

2009-01-16 Thread venkata kirankumar
Hi all, I tried to read data from Excel spread sheet with using read.csv(file.choose()) and read.delim(file.choose()) but its showing *ÐÏ.à.*. and also i tried with read.table(file.choose()) then its showing* V1 1

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gabor Grothendieck
The sqldf package can read a large file to a database without going through R followed by extracting it. The package makes it easier to use RSQLite by setting up the database for you and after extracting the portion you want removing the database automatically. You can specify all this in two

Re: [R] reading data from Excel Spread sheet

2009-01-16 Thread Thomas Schwander
Hi, http://tolstoy.newcastle.edu.au/R/e2/help/06/12/6702.html Cheers, Thomas venkata kirankumar schrieb: Hi all, I tried to read data from Excel spread sheet with using read.csv(file.choose()) and read.delim(file.choose()) but its showing *ÐÏ.à.*. and also i tried with

Re: [R] reading data from Excel Spread sheet

2009-01-16 Thread Prof Brian Ripley
See the 'R Data Import/Export' manual (and please study the posting guide, which asked you to check the manuals before posting). On Fri, 16 Jan 2009, venkata kirankumar wrote: Hi all, I tried to read data from Excel spread sheet with using read.csv(file.choose()) and

[R] faster version of split()?

2009-01-16 Thread Simon Pickett
Hi all, I want to calculate the number of unique observations of y in each level of x from my data frame df. this does the job but it is very slow for this big data frame (159503 rows, 11 columns). group.list - split(df$y,df$x) count - function(x) length(unique(na.omit(x)))

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread r...@quantide.com
Something like this should work library(R.utils) out = numeric() qr = c(AAC, ATT) n =countLines(test.txt) file = file(test.txt, r) for (i in 1:n){ line = readLines(file, n = 1) A = strsplit (line, split = )[[1]][1] if(is.element(A, qr)) { value = as.numeric(strsplit (line, split = )[[1]][2])

[R] function return output

2009-01-16 Thread threshold
Hi, I wrote the function which outputs a matrix 'c' and a single value 'd', as follows (simplified example): procedure - function(a,b){ ... list(c,d) } now I want to use 'c' and 'd' in code as follows: d - matrix(0,1,1) value - procedure(a,b) and d[1,1] - value[2] breaks telling that: Error in

Re: [R] faster version of split()?

2009-01-16 Thread Henrique Dallazuanna
Maybe: with(df, tapply(y, x, count)) On Fri, Jan 16, 2009 at 8:10 AM, Simon Pickett simon.pick...@bto.orgwrote: Hi all, I want to calculate the number of unique observations of y in each level of x from my data frame df. this does the job but it is very slow for this big data frame

[R] Smooth periodic splines

2009-01-16 Thread cmr.p...@gmail.com
Hello group! Is there a package that allows to fit smooth *periodic* splines to data? I'm interested in a function which combines the functionality of smooth.spline and splines::periodicSpline. Thanks, Andrey __ R-help@r-project.org mailing list

Re: [R] faster version of split()?

2009-01-16 Thread r...@quantide.com
df = data.frame(x = sample(7:9, 100, rep = T), y = sample(1:5, 100, rep = T)) fun = function(x){length(unique(x))} by(df$x, df$y, fun) Simon Pickett wrote: Hi all, I want to calculate the number of unique observations of y in each level of x from my data frame df. this does the job but it

[R] Fitting of lognormal distribution to lower tail experimental data

2009-01-16 Thread Mattias Brännström
Hi, I am beginner with R and need firm guidance with my problem. I have seen some other threads discussing the subject of right censored data, but I am not sure whether or not this problem can be regarded as such. Data: I have a vector with laboratory test data (strength of wood specimens,

Re: [R] snow and different R versions

2009-01-16 Thread Gábor Csárdi
Just for the records. The problem was that the R version Rscript starts is determined at compile time, and I had to move my R installation to another place for some technical reasons. At the compile-time place there was another R version and Rscript started that one. The solution was to create a

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Wacek Kusnierczyk
if the file is really large, reading it twice may add considerable penalty: r...@quantide.com wrote: Something like this should work library(R.utils) out = numeric() qr = c(AAC, ATT) n =countLines(test.txt) # 1st pass file = file(test.txt, r) for (i in 1:n){ # 2nd pass line =

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread r...@quantide.com
I agree on the database solution. Database are the rigth tool to solve this kind of problem. Only consider the start up cost of setting up the database. This could be a very time consuming task if someone is not familiar with database technology. Using file() is not a real reading of all the

Re: [R] faster version of split()?

2009-01-16 Thread Søren Højsgaard
Hi, R version 2.2.1 is slightly old. You may want to upgrade to the current version, R.2.8.1!!! You can for example do library(doBy) dd - data.frame(x=c(1,1,1,2,2,2), y=c(1,1,2, 1,1,1)) summaryBy(y~x, data=dd, FUN=function(x)length(unique(x))) Regards Søren -Oprindelig meddelelse-

Re: [R] problems with extractPrediction in package caret

2009-01-16 Thread Uwe Ligges
Häring, Tim (LWF) wrote: Hi list, I´m working on a predictive modeling task using the caret package. I found the best model parameters using the train() and trainControl() command. Now I want to evaluate my model and make predictions on a test dataset. I tried to follow the instructions in

Re: [R] [r] How to Solve the Error( error:cannot allocate vector of size 1.1 Gb)

2009-01-16 Thread Uwe Ligges
Kum-Hoe Hwang wrote: Hi, Gurus Thanks to your good helps, I have managed starting the use of a text mining package so called tm in R under the OS of Win XP. However, during running the tm package, I got another mine like memory problem. What is a the best way to solve this memory problem

Re: [R] function return output

2009-01-16 Thread Uwe Ligges
threshold wrote: Hi, I wrote the function which outputs a matrix 'c' and a single value 'd', as follows (simplified example): procedure - function(a,b){ ... list(c,d) } now I want to use 'c' and 'd' in code as follows: d - matrix(0,1,1) value - procedure(a,b) and d[1,1] - value[2] breaks

Re: [R] Adressing list-elements

2009-01-16 Thread Uwe Ligges
Thomas Schwander wrote: Dear all, I'm using R 2.8.1 under Vista. I programmed a Simulation with the code enclosed at the end of the eMail. After the simulation I want to analyse the columns of the single simulation-runs, i.e. e.g. Simulation[[1]][,1] sth. like that but I cannot address

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Wacek Kusnierczyk
r...@quantide.com wrote: Using file() is not a real reading of all the file. This function will simply open a connection to the file without reading it. countLines should do something lile wc -l from a bash shell just for a test: cat(rep('', 10^7), file='test.txt', fill=1) library(R.utils)

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Wacek Kusnierczyk
r...@quantide.com wrote: I agree on the database solution. Database are the rigth tool to solve this kind of problem. Only consider the start up cost of setting up the database. This could be a very time consuming task if someone is not familiar with database technology. and won't pay if you

Re: [R] How to create a chromosome location map by locus ID

2009-01-16 Thread Neil Shephard
Sake wrote: Hi, I'm trying to make a chromosomal map in R by using the locus. I have a list of genes and their locus, and I want to visualise that so you can see if there are multiple genes on a specific place on a chromosome. A example of what I more or less want is below:

Re: [R] How to create a chromosome location map by locus ID

2009-01-16 Thread Sake
Neil Shephard wrote: Whats wrong with things like the HapMap Genome Browser that allows you to zoom in and out and to produce customised annotations of chromosomal regions at varying resolutions (see http://www.hapmap.org/)? Of course I'm assuming that you are looking at human

Re: [R] PDF slided (beamer or prosper) to an editable PPT

2009-01-16 Thread Neil Shephard
zubin-2 wrote: Hello, I am getting requests to place our PDF slides (output from beamer) into Microsoft Powerpoint formats (.ppt). What's the best practice or any recommended software packages (any success with open or commercial) that we can use to convert PDF slides into an EDITABLE

[R] Predictions with GAM

2009-01-16 Thread Robbert Langenberg
Dear, I am trying to get a prediction of my GAM on a response type. So that I eventually get plots with the correct values on my ylab. I have been able to get some of my GAM's working with the example shown below: * model1-gam(nsdall ~ s(jdaylitr2), data=datansd) newd1 -

Re: [R] Smooth periodic splines

2009-01-16 Thread Duncan Murdoch
cmr.p...@gmail.com wrote: Hello group! Is there a package that allows to fit smooth *periodic* splines to data? I'm interested in a function which combines the functionality of smooth.spline and splines::periodicSpline. I don't know one, but you could use the same technique that

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gabor Grothendieck
On Fri, Jan 16, 2009 at 5:52 AM, r...@quantide.com r...@quantide.com wrote: I agree on the database solution. Database are the rigth tool to solve this kind of problem. Only consider the start up cost of setting up the database. This could be a very time consuming task if someone is not

[R] re name vector

2009-01-16 Thread canadiangirl19
I´m a really R beginer, so I have a simply question. I would like to rename a vector in a loop. I´d like to have as output: vector1-whatever vector2-whatever vector3-whatever etc.. so I thought it´s easily for (s in c(1:3)){ vectorn- whatever } but I´m getting an error. cheers -- View

Re: [R] re name vector

2009-01-16 Thread Gabor Grothendieck
Its a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f On Fri, Jan 16, 2009 at 6:58 AM, canadiangirl19 canadiangir...@sms.at wrote: I´m a really R beginer, so I have a simply question. I would like to rename a vector in a loop. I´d like to

Re: [R] reading data from Excel Spread sheet

2009-01-16 Thread John Sorkin
Kiran, One, not very elegant way, to solve your problem is to first save the Excel spreadsheet as a CSV file (open the Excel file in Excel and the use file-save as CSV, i.e. xxx.CSV) and then use read.csv() John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of

Re: [R] Predictions with GAM

2009-01-16 Thread Gavin Simpson
On Fri, 2009-01-16 at 12:36 +0100, Robbert Langenberg wrote: Dear, I am trying to get a prediction of my GAM on a response type. So that I eventually get plots with the correct values on my ylab. I have been able to get some of my GAM's working with the example shown below: *

[R] Efficiency challenge: MANY subsets

2009-01-16 Thread Johannes Graumann
Hello, I have a list of character vectors like this: sequences - list( c(M,G,L,W,I,S,F,G,T,P,P,S,Y,T,Y,L,L,I,M, N,H,K,L,L,L,I,N,N,N,N,L,T,E,V,H,T,Y,F, N,I,N,I,N,I,D,K,M,Y,I,H,*) ) and another list of subset ranges like this: indexes - list( list( c(1,22),c(22,46),c(46,

Re: [R] function return output

2009-01-16 Thread David Winsemius
On Jan 16, 2009, at 5:22 AM, threshold wrote: Hi, I wrote the function which outputs a matrix 'c' and a single value 'd', as follows (simplified example): procedure - function(a,b){ ... list(c,d) } now I want to use 'c' and 'd' in code as follows: d - matrix(0,1,1) value - procedure(a,b)

[R] data frames with å, ä, and ö (=n on-ASCII-characters) from windows to mac os x

2009-01-16 Thread Gustaf Rydevik
Hi, I ran into this issue previously and managed to solve it, but I've forgotten how and am getting frustrated... I have a data frame (see below) with scandinavian characters in R (2.7.1) running on a Win Xp-computer. I save the data frame in an RData-file on a usb stick, and load() it in R

Re: [R] Efficiency challenge: MANY subsets

2009-01-16 Thread Jorge Ivan Velez
Dear Johannes, Try this: sequences - c(M,G,L,W,I,S,F,G,T,P,P,S,Y,T, Y,L,L,I,M,N,H,K,L,L,L,I,N,N,N,N,L,T,E,V, H,T,Y,F,N,I,N,I,N,I,D,K,M,Y,I,H,*) indexes - matrix(c(1,22,22,46,46,51,1,46,22,51,1,51),ncol=2,byrow=TRUE) apply(indexes,1,function(x){ ind- x[1]:x[2]

Re: [R] Efficiency challenge: MANY subsets

2009-01-16 Thread Henrique Dallazuanna
Try this: lapply(indexes[[1]], function(g)sequences[[1]][do.call(seq, as.list(g))]) On Fri, Jan 16, 2009 at 11:06 AM, Johannes Graumann johannes_graum...@web.de wrote: Hello, I have a list of character vectors like this: sequences - list( c(M,G,L,W,I,S,F,G,T,P,P,S,Y,T,Y,L,L,I,M,

Re: [R] [R-SIG-Mac] data frames with å, ä , and ö (=non-ASCII-characters) from win dows to mac os x

2009-01-16 Thread Prof Brian Ripley
You need to use CP1252 not UTF-8 to read the data. It tells you how to do so on the help page ... under 'encoding'. So something like A - read.table(con - file(myfile, encoding=CP1252));close(con) Please don't cross-post ... I am being brief because you did. On Fri, 16 Jan 2009, Gustaf

[R] basic boxplot questions

2009-01-16 Thread ivo welch
dear R experts: I am playing with boxplots for the first time. most of it is intuitive, although there was less info on the web than I had hoped. alas, for some odd reason, my R boxplots have some fat black dots, not just the hollow outlier plots. Is there a description of when R draws hollow

Re: [R] Predictions with GAM

2009-01-16 Thread Robbert Langenberg
Thanks for the swift reply, I might have been a bit sloppy with describing my datasets and problem. I showed the first model as an example of the type of GAM that I had been able to use the predict function on. What I am looking for is how to predict my m3:

Re: [R] reading data from Excel Spread sheet

2009-01-16 Thread Pedro Mardones
or maybe by using the xlsReadWrite package: mydata - read.xls(mydata.xls, sheet = 'Sheet1) On Fri, Jan 16, 2009 at 4:32 AM, venkata kirankumar kiran4u2...@gmail.com wrote: Hi all, I tried to read data from Excel spread sheet with using read.csv(file.choose()) and

Re: [R] basic boxplot questions

2009-01-16 Thread K. Elo
ivo welch kirjoitti: dear R experts: I am playing with boxplots for the first time. most of it is intuitive, although there was less info on the web than I had hoped. alas, for some odd reason, my R boxplots have some fat black dots, not just the hollow outlier plots. Is there a

Re: [R] basic boxplot questions

2009-01-16 Thread K. Elo
Hi Ivo, ivo welch wrote: alas, for some odd reason, my R boxplots have some fat black dots, not just the hollow outlier plots. Is there a description of when R draws hollow vs. fat dots somewhere? [and what is the parameter to change just the size of these dots?] Have you tried the command

Re: [R] How to create a chromosome location map by locus ID

2009-01-16 Thread Martin Morgan
Sake tlep.nav.e...@hccnet.nl writes: Neil Shephard wrote: Whats wrong with things like the HapMap Genome Browser that allows you to zoom in and out and to produce customised annotations of chromosomal regions at varying resolutions (see http://www.hapmap.org/)? Of course I'm assuming

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
Hi, Robbert Langenberg mcrelay at gmail.com writes: I am trying to get a prediction of my GAM on a response type. So that I eventually get plots with the correct values on my ylab. The problem I am encountering now is that I cannot seem to get it done for the following type of model:

[R] Lattice: how to have multiple wireframe nice intersection?

2009-01-16 Thread Guillaume Chapron
Hello, This code builds a simple example of 2 wireframes : require(lattice) x - c(1:10) y - c(1:10) g - expand.grid(x = 1:10, y = 1:10, gr = 1:2) g$z - c(as.vector(outer(x,y,*)), rep(50,100)) wireframe(z ~ x * y, data = g, groups = gr, scales = list(arrows = FALSE)) However, the

[R] Odp: basic boxplot questions

2009-01-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.01.2009 15:24:26: dear R experts: I am playing with boxplots for the first time. most of it is intuitive, although there was less info on the web than I had hoped. alas, for some odd reason, my R boxplots have some fat black dots, not just

Re: [R] data frames with å, ä, and ö (=n on-ASCII-characters) from windows to mac os x

2009-01-16 Thread Ivan Alves
Hi, On my system (see below), it works fine (inputing the code below at the R prompt). Make sure that the encoding of the input file is encoded UTF-8. Rgds, Ivan sessionInfo() R version 2.8.1 Patched (2009-01-14 r47602) i386-apple-darwin9.6.0 locale:

Re: [R] Fitting of lognormal distribution to lower tail experimental data

2009-01-16 Thread Mattias Brännström
Thank you, David! I agree and apprechiate your analysis, which definitely will influence my analysis of this data, but still I would like you to disregard from it(!) The standard routine in the field is, beyond my control, to assume lognormal distribution to achieve comparable results also with

Re: [R] autocorrelation

2009-01-16 Thread Michael Denslow
Hi Is any multiple regression-like test with correction for autocorrelation ? If I understand your question, yes. Take a look at the spdep package for starters. Also you may find the following references helpful. Dormann et al. 2007. Methods to account for spatial autocorrelation in the

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gundala Viswanath
Hi Gabor, Do you mean storing data in sqldf', doesn't take memory? For example, I have 3GB data file. with standard R object using read.table() the object size will explode twice ~6GB. My current 4GB RAM cannot handle that. Do you mean with sqldf, this is not the issue? Why is that? Sorry for

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gabor Grothendieck
Only the portion your extract is ever in R -- the file itself is read into a database without ever going through R so your memory requirements correspond to what you extract, not the size of the file. On Fri, Jan 16, 2009 at 10:49 AM, Gundala Viswanath gunda...@gmail.com wrote: Hi Gabor, Do

[R] Missing file to run Rcmd batch on Windows

2009-01-16 Thread Brigid Mooney
Hi, I'm trying to run an R script using Rcmd Batch from the command line on a Windows Vista machine. I am using R version 2.8.1. I installed the batch files 4-3 found at http://cran.r-project.org/contrib/extra/batchfiles/ and added them to my path. I also had to install the latest version of

Re: [R] Missing file to run Rcmd batch on Windows

2009-01-16 Thread Gabor Grothendieck
Try writing BATCH in upper case. On Fri, Jan 16, 2009 at 10:51 AM, Brigid Mooney bkmoo...@gmail.com wrote: Hi, I'm trying to run an R script using Rcmd Batch from the command line on a Windows Vista machine. I am using R version 2.8.1. I installed the batch files 4-3 found at

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gundala Viswanath
Hi, Unless you specify an in-memory database the database is stored on disk. Thanks for your explanation. I just downloaded 'sqldf'. Where can I find the option for that? In sqldf I can't see the command. I looked at: envir = parent.frame() doesn't appear to be the one. - Gundala Viswanath

[R] Use of [:alnum:] or . in gsub() etc..

2009-01-16 Thread ppaarrkk
test = c ( AAABBB, CCC ) This works : gsub ( [A-Z], 2, test ) None of these do : gsub ( [A-Z], [:alnum:], test ) gsub ( [A-Z], [[:alnum:]], test ) gsub ( [A-Z], [:alnum:], test ) gsub ( [A-Z], [[:alnum:]], test ) gsub ( [A-Z], ^[:alnum:]$, test ) What am I doing wrong, please ? --

Re: [R] Value Lookup from File without Slurping

2009-01-16 Thread Gabor Grothendieck
If that refers to using a database on disk to temporarily hold the file then example 6 on the home page shows it, as mentioned, and you may wish to look at the other examples there too and there is further documentation in the ?sqldf help file. On Fri, Jan 16, 2009 at 11:11 AM, Gundala Viswanath

Re: [R] Use of [:alnum:] or . in gsub() etc..

2009-01-16 Thread Marc Schwartz
on 01/16/2009 10:13 AM ppaarrkk wrote: test = c ( AAABBB, CCC ) This works : gsub ( [A-Z], 2, test ) None of these do : gsub ( [A-Z], [:alnum:], test ) gsub ( [A-Z], [[:alnum:]], test ) gsub ( [A-Z], [:alnum:], test ) gsub ( [A-Z], [[:alnum:]], test ) gsub ( [A-Z],

Re: [R] Missing file to run Rcmd batch on Windows

2009-01-16 Thread Duncan Murdoch
On 1/16/2009 10:51 AM, Brigid Mooney wrote: Hi, I'm trying to run an R script using Rcmd Batch from the command line on a Windows Vista machine. I am using R version 2.8.1. I installed the batch files 4-3 found at http://cran.r-project.org/contrib/extra/batchfiles/ and added them to my path.

[R] Sweave documents have corrupted double quotes

2009-01-16 Thread Paul Johnson
I'm attaching a file foo.Rnw and I'm hoping some of you might run it through your R latex systems to find out if the double-quotes in typewriter font turn out as black boxes (as they do for me). If you don't use Sweave, but you have a system with a working version of R and LaTeX, the file gives

Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread Ben Bolker
Paul Johnson pauljohn32 at gmail.com writes: I'm attaching a file foo.Rnw and I'm hoping some of you might run it through your R latex systems to find out if the double-quotes in typewriter font turn out as black boxes (as they do for me). If you don't use Sweave, but you have a system

Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread Vincent Goulet
Paul, The file did not make it to the list. Did you try loading Sweave with the 'noae' option, that is: \usepackage[noae]{Sweave} This *may* solve your issue. HTH Vincent Le ven. 16 janv. à 11:31, Paul Johnson a écrit : I'm attaching a file foo.Rnw and I'm hoping some of you might

[R] (no subject)

2009-01-16 Thread Henning Wildhagen
Dear users, i just installed the lastest version of R, 2.8.1 on my computer (OS Windows XP). Then i tried to update the packages copied from my old R version by update.packages(ask=F) However i get the following warning: Warning: unable to access index for repository

Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread Paul Johnson
On Fri, Jan 16, 2009 at 10:43 AM, David Winsemius dwinsem...@comcast.net wrote: Dear Dr Johnson; I'm not sure if you get copies of your posts. If you do can you check to see if the list-server kept the attachment? My copy did not have one. -- Best David winsemius Hm. Well, I do get the

[R] installing mclust and flexmix on linux

2009-01-16 Thread Tim F Liao
I've been trying to install some R packages such as mclust and flexmix on linux but have had the following error messages. I've been trying to install mclust on my notebook which has linpus linux lite os and I have installed R as well as some packages all right. However, when I tried to

[R] (no subject)

2009-01-16 Thread ursachi
Dear all, Can anybody help me with an RExcel tutorial? Maybe some example on which functions can be used/how to use it... I have installed it on my computer, using the R(D)COM server. Thank you all in advance, Irina Ursachi. __ R-help@r-project.org

[R] Using optim with exponential power distribution

2009-01-16 Thread Ronald Bialozyt
Hello, I am trying to fit a exponential power distribution y = b/(2*pi*a^2*gamma(2/b))*exp(-(x/a)^b) to a bunch of data for x and y I have in a table. data x y 1 2527 2 7559 3125 219 ... 25912925 1 26012975

Re: [R] faster version of split()?

2009-01-16 Thread David Winsemius
Henrique's solution seems sensible. Another might be: df = data.frame(x = sample(7:9, 10, rep = T), y = sample(1:5, 10, rep = T)) table(df) y x 1 2 3 4 5 7 1 0 1 0 2 8 0 1 0 0 1 9 0 1 1 2 0 rowSums(table(df) 0) 7 8 9 3 2 3 #-same as Henrique's count -

[R] Updating packages under R 2.8.1

2009-01-16 Thread Henning Wildhagen
Dear users, i just installed the lastest version of R, 2.8.1 on my computer (OS Windows XP). Then i tried to update the packages copied from my old R version by update.packages(ask=F) However i get the following warning: Warning: unable to access index for repository

Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread Paul Johnson
On Fri, Jan 16, 2009 at 11:06 AM, Vincent Goulet vincent.gou...@act.ulaval.ca wrote: Paul, The file did not make it to the list. Did you try loading Sweave with the 'noae' option, that is: \usepackage[noae]{Sweave} This *may* solve your issue. HTH Vincent Wow. That does fix it.

Re: [R] (no subject)

2009-01-16 Thread milton ruser
Dear Henning, Try other repositories. Best wishes, miltinho brazil On Fri, Jan 16, 2009 at 2:08 PM, Henning Wildhagen hwildha...@gmx.dewrote: Dear users, i just installed the lastest version of R, 2.8.1 on my computer (OS Windows XP). Then i tried to update the packages copied from my old

Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread David Winsemius
Looking at the display I see this line: \texttt{Typewriter Font has ``double quotes''} ... displayed with leading backquotes but trailing singlequotes. Was that intended? -- David Winsemius On Jan 16, 2009, at 12:21 PM, Paul Johnson wrote: On Fri, Jan 16, 2009 at 10:43 AM, David Winsemius

Re: [R] Using optim with exponential power distribution

2009-01-16 Thread Stefan Evert
I know optim should do a minimisation, therefor I used as the optimisation function opt.power - function(val, x, y) { a - val[1]; b - val[2]; sum(y - b/(2*pi*a^2*gamma(2/b))*exp(-(x/a)^b)); } I call: (with xm and ym the data from the table) a1 - c(0.2, 100) opt - optim(a1, opt.power,

[R] Weighted Kaplan-Meier Statistics

2009-01-16 Thread Ritwik Sinha
Dear All, I could not locate an implementation of the Weighted Kaplan-Meier Statistics proposed by Pepe and Fleming, Biometrics. 1989 Jun;45(2):497-507 (http://www.ncbi.nlm.nih.gov/pubmed/2765634) in R. I am wondering if anyone is aware of a R implementation of the test statistics proposed in

Re: [R] problems with extractPrediction in package caret

2009-01-16 Thread Max Kuhn
The issue is the usage of extractPrediction. expred - extractPrediction(rftrain) should really be expred - extractPrediction(list(rftrain)) Since this function is intended to get predictions across multiple models, the man file has a description of the first argument to teh funtion being

Re: [R] faster version of split()?

2009-01-16 Thread Peter Dalgaard
Simon Pickett wrote: Hi all, I want to calculate the number of unique observations of y in each level of x from my data frame df. this does the job but it is very slow for this big data frame (159503 rows, 11 columns). group.list - split(df$y,df$x) count - function(x)

Re: [R] Updating packages under R 2.8.1

2009-01-16 Thread Uwe Ligges
Henning Wildhagen wrote: Dear users, i just installed the lastest version of R, 2.8.1 on my computer (OS Windows XP). Then i tried to update the packages copied from my old R version by update.packages(ask=F) However i get the following warning: Warning: unable to access index for

Re: [R] installing mclust and flexmix on linux

2009-01-16 Thread Uwe Ligges
Tim F Liao wrote: I've been trying to install some R packages such as mclust and flexmix on linux but have had the following error messages. I've been trying to install mclust on my notebook which has linpus linux lite os and I have installed R as well as some packages all right. However,

[R] Memory allocation

2009-01-16 Thread Gabriel Margarido
Hello everyone, I have the following issue: one function generates a very big array (can be more than 1 Gb) and returns a few variables, including this big one. Memory allocation is OK while the function is running, but the final steps make some copies that can be problematic. I looked for a way

[R] glmer documentation

2009-01-16 Thread Raphaelle
Hello, I am fitting a gmler using poisson, and I was looking for a documentation to interpret correctly the output. I'm quite a beginner with these kind of models. I couldn't find something in the lme4 package manual. and on the internet neither... Thank you, Raphaelle -- View this message in

[R] PHP and R

2009-01-16 Thread Applejus
Hi, I know I've already asked this question, but I am really getting trouble getting a PHP document execute an R function on windows. I would appreciate if someone could give me a simple example code where a php calls an R function and passes to it arguments, specifying also how to set up the

Re: [R] Missing file to run Rcmd batch on Windows

2009-01-16 Thread Gabor Grothendieck
Regarding Perl, the batchfiles distribution batch files do not use Perl but R's own Rcmd.exe does. Based on comments recently I understand that Perl will be eliminated from the R batch scripts soon but in the meantime if you install Rtools (which is a set of tools that includes perl and is simple

Re: [R] Memory allocation

2009-01-16 Thread Duncan Murdoch
On 1/16/2009 12:46 PM, Gabriel Margarido wrote: Hello everyone, I have the following issue: one function generates a very big array (can be more than 1 Gb) and returns a few variables, including this big one. Memory allocation is OK while the function is running, but the final steps make some

[R] bootstrap validation of LR error message

2009-01-16 Thread A Van Dyke
when i try to validate my logistic regression model: fit-glm(y~x,binomial,data=dataname,x=TRUE,y=TRUE) validate(fit,method=boot,B=150,...) i get the following error message: Error in UseMethod(validate) : no applicable method for validate any insight would be appreciated. many thanks! --

Re: [R] Efficiency challenge: MANY subsets

2009-01-16 Thread Johannes Graumann
Thanks. Very elegant, but doesn't solve the problem of the outer for loop, since I now would rewrite the code like so: fragments - list() for(iN in seq(length(sequences))){ cat(paste(iN,\n)) fragments[[iN]] - lapply(indexes[[1]], function(g)sequences[[1]][do.call(seq, as.list(g))]) }

[R] specifying model terms when using predict

2009-01-16 Thread VanHezewijk, Brian
I've recently encountered an issue when trying to use the predict.glm function. I've gotten into the habit of using the dataframe$variablename method of specifying terms in my model statements. I thought this unambiguous notation would be acceptable in all situations but it seems models

Re: [R] bootstrap validation of LR error message

2009-01-16 Thread Marc Schwartz
on 01/16/2009 02:19 PM A Van Dyke wrote: when i try to validate my logistic regression model: fit-glm(y~x,binomial,data=dataname,x=TRUE,y=TRUE) validate(fit,method=boot,B=150,...) i get the following error message: Error in UseMethod(validate) : no applicable method for validate any

[R] Error when running Kendall Package

2009-01-16 Thread gqkou
I am new to R and am trying to run data through using the Kendall package. My first question is that I have NA values for certain criterias, will that be a problem or will they be ignored? ie:FallSpring Summer 1988 NA 1.321 1.564 1999 1.333 1.452NA

[R] User input in batch mode

2009-01-16 Thread Sebastien Bihorel
__ R-help@r-project.org 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] Lattice: how to have multiple wireframe nice intersection?

2009-01-16 Thread David Winsemius
On Jan 16, 2009, at 9:43 AM, Guillaume Chapron wrote: Hello, This code builds a simple example of 2 wireframes : require(lattice) x - c(1:10) y - c(1:10) g - expand.grid(x = 1:10, y = 1:10, gr = 1:2) g$z - c(as.vector(outer(x,y,*)), rep(50,100)) wireframe(z ~ x * y, data = g, groups = gr,

[R] Winsorizing Multiple Variables

2009-01-16 Thread Karl Healey
Hi All, I want to take a matrix (or data frame) and winsorize each variable. So I can, for example, correlate the winsorized variables. The code below will winsorize a single vector, but when applied to several vectors, each ends up sorted independently in ascending order so that a given

Re: [R] Smooth periodic splines

2009-01-16 Thread Spencer Graves
1. RSiteSearch('{periodic spline}') produced 12 hits. I looked at the first five and found that four of them seemed relevant to your question. 2. The third hit in this list notes that the DierckxSpline package has periodic splines, while 'fda' recommends finite Fourier series

[R] matching more than two vectors (?)

2009-01-16 Thread Juliane Struve
Dear listmembers,   I am trying to obtain values for pointdistance from another dataframe by matching UTMX and UTMY coordinates, but I am not sure how to introduce the second coordinate.   PointDF$pointdistance=DistanceDF$distance[match(PointDF$UTMX,DistanceDF$UTMX

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread David Winsemius
Might work better to determine top and bottom for each column with quantile() using an appropriate quantile option, and then process each variable in place with your ifelse logic. I did find a somewhat different definition of winsorization with no sorting in this code copied from a

[R] Barchart in lattice package: controlling order of bars in plot and color of a selected bar

2009-01-16 Thread Matthew Pettis
Hi, I'm using the lattice function 'barchart' to make a series of 4 histograms. Currently, the y-axis values are graphed in order of the y-axis variable. I'd like to have the y-axis values sorted in ascending order of the x-axis values so that the longest bar horizontally is on top of the graph

Re: [R] Efficiency challenge: MANY subsets

2009-01-16 Thread jim holtman
Try this one; it is doing a list of 7000 in under 2 seconds: sequences - list( + + + c(M,G,L,W,I,S,F,G,T,P,P,S,Y,T,Y,L,L,I + ,M, + + + N,H,K,L,L,L,I,N,N,N,N,L,T,E,V,H,T,Y,F, N,I,N,I,N,I,D,K,M,Y,I,H,*) + ) indexes - list( + list( + c(1,22),c(22,46),c(46,

Re: [R] Winsorizing Multiple Variables

2009-01-16 Thread Michael Conklin
Don't sort y. Calculate xbot and xtop using xtemp-quantile(y,c(tr,1-tr),na.rm=na.rm) xbot-xtemp[1] xtop-xtemp[2] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Karl Healey Sent: Friday, January 16, 2009 2:51 PM To:

  1   2   >