Re: [R] basic inquiry regarding write.csv

2009-02-17 Thread CJ Rubio
this is the code that i have so far: > data.path <- file.path ("D:/documents/research/5 stations") > setwd(data.path) > getwd() > data <- dir(".") > num.files <- length(data) > for(i in 1:num.files) { + station.id <- substring(data[i], 1,8) + DF <- read.table(data[i], sep=",", blank.lines.sk

Re: [R] basic inquiry regarding write.csv

2009-02-17 Thread ronggui
So far, I cannot see any mistake, though the sep="" will be more elegant that sep=",". Are you sure your working directory is "E:/my_work_directory"? and is there any error msg? BTW, a reproducible example will help to get better response from the list. 2009/2/18 CJ Rubio : > > thanks for your re

[R] using stepAIC with negative binomial regression - error message help

2009-02-17 Thread t c
Dear List, I am having problems running stepAIC with a negative binomial regression model.  I am working with data on manta ray abundance, using 20 predictor variables.  Predictors include variables for location (site), time (year, cos and sin of calendar day, length of day, percent lunar illumi

Re: [R] basic inquiry regarding write.csv

2009-02-17 Thread CJ Rubio
thanks for your reply.. is there something wrong with the code i have? because it doesn't write the file in the directory that i am using... for (i in names(y)) > {write.csv(y[[i]], file=paste(i, ".csv", sep=","))} thanks again.. ronggui-2 wrote: > > If the "file" is a relative path,

Re: [R] basic inquiry regarding write.csv

2009-02-17 Thread ronggui
If the "file" is a relative path, then it should be in the working directory. Say, the working directory is E:/my_work_directory (of course, you can get it by getwd()), and you export a data frame "a" to csv by: write.csv(a, file="a.csv"), then the file should be "E:/my_work_directory/a.csv". Best

Re: [R] Fwd: Percentiles/Quantiles with Weighting

2009-02-17 Thread Dieter Menne
Stavros Macrakis alum.mit.edu> writes: > > Some minor improvements and corrections below > > # Simple weighted quantile > # > # v A vector of sortable observations > # w A numeric vector of positive weights > # p The quantile 0<=p<=1 > # > # Nothing fancy: no interpolation etc.; NA cases not

[R] basic inquiry regarding write.csv

2009-02-17 Thread CJ Rubio
i have a loop which looks likes this: > data.info <- rbind(data.info, cbind(station.id, year, date, > max.discharge)) + y <- split(data.info, data.info[station.id]) + for (i in names(y)) {write.csv(y[[i]], file=paste(i, ".csv", sep=","))} i am wondering, where the file (which i am ab

[R] Possible Cause of Segmentation Fault

2009-02-17 Thread Moumita Das
Hi All, If you have already finished reading my previous emails regarding segmentation fault , please have a look at this .I think this may help you to diagnose the reason for the segmentation fault and help me,because i don't understand much. Rather than running the script using the command " s

[R] Added system Info:--Segmentation Fault occured while connecting to the database

2009-02-17 Thread Moumita Das
Oops !! I had also included just one library in my script i.e RMySQL.So sorry for the inconvenience:( -- Thanks Moumita [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

[R] Added system Info:--Segmentation Fault occured while connecting to the database

2009-02-17 Thread Moumita Das
Hi All, Wanted to add some more information ,regarding my problem. configuration of teh OS and R:--- Linux 2.6.18-6-686 > R.Version() $platform [1] "i486-pc-linux-gnu" $arch [1] "i486" $os [1] "linux-gnu" $system [1] "i486, linux-gnu" $status [1] "Patched" $major [1] "2" $minor [1] "4.0" $ye

[R] Segmentation Fault occured while connecting to the database

2009-02-17 Thread Moumita Das
Hi All, Can anyone help me please?I don't know much about segmentation faults.I understand what it is,but why my script's throwing the error i don't know. This is my main function: *main<-function()* *{* *dbName<-"xyz_database"* *hostName<-"xyz.com"* *

[R] Index-G1 error

2009-02-17 Thread mauede
I am using some functions from package clusterSim to evaluate the best clusters layout. Here is the features vector I am using to cluater 12 signals: > alpha.vec [1] 0.8540039 0.8558350 0.8006592 0.8066406 0.8322754 0.8991699 0.8212891 [8] 0.8815918 0.9050293 0.9174194 0.8613281 0.8425293 In t

[R] How to: C# / R interface

2009-02-17 Thread Baggett, Jonathan W
This is my situation: I have a significant amount of data, and need to send it in pieces to R. I need R to return certain parameters for further use. I am sending files from C# (that are being queried from a database) into R. Currently I am trying to use the R(D)-Com package to figure out how t

[R] Fwd: Percentiles/Quantiles with Weighting

2009-02-17 Thread Stavros Macrakis
Some minor improvements and corrections below # Simple weighted quantile # # v A vector of sortable observations # w A numeric vector of positive weights # p The quantile 0<=p<=1 # # Nothing fancy: no interpolation etc.; NA cases not thought through wquantile <- function(v,w=rep(1,length(v)),p

Re: [R] Help with rgl

2009-02-17 Thread Yihui Xie
"Chinese extend a helping hand to Russians who happen to be in Brazil about a package written in Germany," which gladdened an American. Trotsky would be even more proud -- and amazed!! :-) Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homep

[R] Plotting Binned Data

2009-02-17 Thread Gundala Viswanath
Dear all, I have a binned data that looks like this: > dat (-1,9] (9,19] (19,29] (29,39] (39,49] (49,59] (59,69] (69,79] 10063374 79 1643443 (79,89] (89,99] 62 I tried to plot a histogram overlayed with curve. With th

Re: [R] Help with rgl

2009-02-17 Thread roger koenker
Why I love R [Number 6]: Chinese extend a helping hand to Russians who happen to be in Brazil about a package written in Germany. Trotsky would be proud -- and amazed! url:www.econ.uiuc.edu/~rogerRoger Koenker email rkoen...@uiuc.edu Departmen

Re: [R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009

2009-02-17 Thread Paul Heinrich Dietrich
Hi Uwe, Thank you for your guidance. I have installed R2WinBUGS and WinBUGS14 under wine. Using ?bugs for help, it tells me: useWINE: logical; attempt to use the Wine emulator to run 'WinBUGS', defaults to 'FALSE' on Windows, and 'TRUE' otherwise. Not available in S-PLUS. WINE: character, path

Re: [R] FW: Can't access CRAN

2009-02-17 Thread Gabor Grothendieck
Maybe the suggestions here help: http://cran.r-project.org/bin/windows/base/rw-FAQ.html#The-Internet-download-functions-fail_002e On Tue, Feb 17, 2009 at 8:19 PM, Charles Annis, P.E. wrote: > Dear R-Helpers: > > I'm running R version 2.8.1 on a 1 year old HP Pavilion with a AMD Athelon > 64 Dual

Re: [R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
Gene Leynes wrote: This is my first help post, hope it works! Just check out the "sample" function At the command line type: ?sample I think it will be pretty clear from the documentation. Yes, most excellent suggestion and quite helpful! Thanks, Esmail _

Re: [R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Gene Leynes
This is my first help post, hope it works! Just check out the "sample" function At the command line type: ?sample I think it will be pretty clear from the documentation. On Tue, Feb 17, 2009 at 9:13 PM, Esmail Bonakdarian wrote: > (sorry if this is a duplicate-problems with posting at my end) >

Re: [R] rbind: number of columns of result is not a multiple of vector length (arg 1)

2009-02-17 Thread jim holtman
You could 'split' the dataframe and then write out each element: something like x <- split(data.info, data.info$station.id) for (i in names(x)) write.csv(x[[i]], file=paste(i, ".csv", sep="")) On Tue, Feb 17, 2009 at 10:11 PM, CJ Rubio wrote: > > it works perfectly thank you for your help...

[R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
(sorry if this is a duplicate-problems with posting at my end) Hello all, I need some help with a nice R-idiomatic and efficient solution to a small problem. Essentially, I am trying to eliminate randomly half of the entries in a vector that contains index values into some other vectors. Mo

Re: [R] rbind: number of columns of result is not a multiple of vector length (arg 1)

2009-02-17 Thread CJ Rubio
it works perfectly thank you for your help what if i want to seperate each stations data and save in a .csv file?? while i'm asking you these i'm also finding some ways to do so.. thank you again. jholtman wrote: > > try using: > > data.info <- rbind(data.info, cbind(station.id, y

Re: [R] rbind: number of columns of result is not a multiple of vector length (arg 1)

2009-02-17 Thread jim holtman
try using: data.info <- rbind(data.info, cbind(station.id, year, date, max.discharge)) On Tue, Feb 17, 2009 at 9:26 PM, CJ Rubio wrote: > > i have the following constructed and running very well,, thanks to Gabor > Grothendieck for his help. > >>data.info <- c("station.id", "year", "date", "max.

Re: [R] Help with rgl

2009-02-17 Thread Yihui Xie
(1) you'll need ImageMagick installed to use the command "convert" to convert image sequences into GIF animations; see ?movie3d (2) "viewport" is read only!! see ?open3d carefully Regards, Yihui -- Yihui Xie Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086 Mobile: +86-15810805877 Homepage: http:

[R] rbind: number of columns of result is not a multiple of vector length (arg 1)

2009-02-17 Thread CJ Rubio
i have the following constructed and running very well,, thanks to Gabor Grothendieck for his help. >data.info <- c("station.id", "year", "date", "max.discharge") > > for(i in 1:num.files) { + station.id <- substring(data[i], 1,8) + DF <- read.table(data[i], sep=",", blank.lines.skip = TRUE) + z

Re: [R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Jeremiah Rounds
Here is what I got for script through your third question: set.seed(1) x1 = rbinom(200,1,.5) x2 = rbinom(200,1,.5) differ = x1 != x2 differ.indexes = (1:length(x1))[differ == TRUE] #you were unclear if you want to round up or round down on odd index of differ.indexes n = floor( length(d

Re: [R] cumsum vs. sum

2009-02-17 Thread Gabor Grothendieck
Check out sum.exact and cumsum.exact in the caTools package. > library(caTools) Loading required package: bitops > x <- 1/(12:14) > sum(x) - cumsum(x)[3] [1] 2.775558e-17 > sum.exact(x) - cumsum.exact(x)[3] [1] 0 On Tue, Feb 17, 2009 at 5:12 PM, Stavros Macrakis wrote: > I recently traced a bug

[R] FW: Can't access CRAN

2009-02-17 Thread Charles Annis, P.E.
Dear R-Helpers: I'm running R version 2.8.1 on a 1 year old HP Pavilion with a AMD Athelon 64 Dual Core Processor 4800+ 2.50GHz chip, Vista Home Premium SP1, and 2 GB RAM. I can't add packages (even running as Administrator) because I can't connect to a CRAN mirror. > chooseCRANmirror() (After

[R] how to randomly eliminate half the entries in a vector?

2009-02-17 Thread Esmail Bonakdarian
Hello all, I need some help with a nice R-idiomatic and efficient solution to a small problem. Essentially, I am trying to eliminate randomly half of the entries in a vector that contains index values into some other vectors. More details: I am working with two strings/vectors of 0s and 1s. T

Re: [R] ylim in plot.ts?

2009-02-17 Thread Gabor Grothendieck
Check out: https://www.stat.math.ethz.ch/pipermail/r-help/2009-February/187562.html On Tue, Feb 17, 2009 at 6:45 PM, Oliver Bandel wrote: > Hello, > > > I tried to use ylim=c(x,y) in a plot.ts(). > > This was ignored. > > How can I achieve it to create such graphics? > > > Ciao, > Oliver Bande

Re: [R] :How to insert a column in a data frame

2009-02-17 Thread Rolf Turner
On 18/02/2009, at 12:51 PM, Laura Rodriguez Murillo wrote: Hi dear list, I wonder if somebody can help me with this. I have a text file with 300 rows and around 30 columns and I need to insert a column that has the number 1 in every row. This new column should be placed between columns 6 a

[R] Normal cdf modified function

2009-02-17 Thread Fernando Saldanha
I wonder if an R package would have a function that calculates the following. Let Y be a normal multivariate function. For example, let Y have 4 dimensions. I want to calculate P(Y1 < Z1, Y2 < Z2, Y3 > Z3, Y4 > Z4). There are R functions to do the calculation if all the inequalities are of the t

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
On Tue, Feb 17, 2009 at 6:05 PM, Barry Rowlingson wrote: > 2009/2/17 Esmail Bonakdarian : > When I need to use the two together, it's easiest with 'rpy'. This > lets you call R functions from python, so you can do: > > from rpy import r > r.hist(z) wow .. that is pretty straight forward, I'll

[R] :How to insert a column in a data frame

2009-02-17 Thread Laura Rodriguez Murillo
Hi dear list, I wonder if somebody can help me with this. I have a text file with 300 rows and around 30 columns and I need to insert a column that has the number 1 in every row. This new column should be placed between columns 6 and 7. As an example: I would want to insert a column (consitin

[R] ylim in plot.ts?

2009-02-17 Thread Oliver Bandel
Hello, I tried to use ylim=c(x,y) in a plot.ts(). This was ignored. How can I achieve it to create such graphics? Ciao, Oliver Bandel __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting g

[R] Saving data to a MS Access Database

2009-02-17 Thread Bill Cunliffe
I have the following dataframe: ad <- data.frame(dates, av, sn$SectorName) colnames(ad) <- c("Date", "Value", "Tag") which has data (rows 10 to 20, for example) as follows: DateValue Tag 10 2008-01-16-0.20875Co

Re: [R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello! On Tue, Feb 17, 2009 at 5:58 PM, Warren Young wrote: > > Esmail Bonakdarian wrote: >> >> I am just wondering if any of you are doing most of your scripting >> with Python instead of R's programming language and then calling >> the relevant R functions as needed? > > No, but if I wanted to

Re: [R] Python and R

2009-02-17 Thread Barry Rowlingson
2009/2/17 Esmail Bonakdarian : > Hello all, > > I am just wondering if any of you are doing most of your scripting > with Python instead of R's programming language and then calling > the relevant R functions as needed? I tend to use R in its native form for data analysis and modelling, and pytho

Re: [R] Python and R

2009-02-17 Thread Warren Young
Esmail Bonakdarian wrote: I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? No, but if I wanted to do such a thing, I'd look at Sage: http://sagemath.org/ It'll give you acc

Re: [R] frequency table for multiple variables

2009-02-17 Thread Hans Ekbrand
On Tue, Feb 17, 2009 at 10:00:40AM -0600, Marc Schwartz wrote: > on 02/17/2009 09:06 AM Hans Ekbrand wrote: > > Hi r-help! > > > > Consider the following data-frame: > > > >var1 var2 var3 > > 1 314 > > 2 223 > > 3 223 > > 4 44 NA > > 5 4

Re: [R] Percentiles/Quantiles with Weighting

2009-02-17 Thread Stavros Macrakis
Here is one kind of weighted quantile function. The basic idea is very simple: wquantile <- function( v, w, p ) { v <- v[order(v)] w <- w[order(v)] v [ which.max( cumsum(w) / sum(w) >= p ) ] } With some more error-checking and general clean-up, it looks like this: # Simple weigh

[R] Python and R

2009-02-17 Thread Esmail Bonakdarian
Hello all, I am just wondering if any of you are doing most of your scripting with Python instead of R's programming language and then calling the relevant R functions as needed? And if so, what is your experience with this and what sort of software/library do you use in combination with Python

Re: [R] matrix output

2009-02-17 Thread Duncan Murdoch
On 17/02/2009 5:31 PM, phoebe kong wrote: Hi friends, I have questions about printing a pretty big size matrix. As you could see from below, the matrix wasn't showed in R at full size (11X11), but it was cut partly into three smaller matrices (11X4,11X4,11X3). I'm wondering if there is a way to

[R] matrix output

2009-02-17 Thread phoebe kong
Hi friends, I have questions about printing a pretty big size matrix. As you could see from below, the matrix wasn't showed in R at full size (11X11), but it was cut partly into three smaller matrices (11X4,11X4,11X3). I'm wondering if there is a way to show the whole matrix with dimension 11X11,

Re: [R] using sapply to apply function to some columns of a dataframe

2009-02-17 Thread Duncan Murdoch
On 17/02/2009 4:42 PM, mwestp...@worldbank.org wrote: Hello: I would like to sum every x columns of a dataframe for each row. For instance, if x is 10, then for dataframe df, this function will sum the first ten elements together and then the next ten: sapply(list(colnames(df)[1:10], colnames(

[R] cumsum vs. sum

2009-02-17 Thread Stavros Macrakis
I recently traced a bug of mine to the fact that cumsum(s)[length(s)] is not always exactly equal to sum(s). For example, x<-1/(12:14) sum(x) - cumsum(x)[3] => 2.8e-17 Floating-point addition is of course not exact, and in particular is not associative, so there are various possible r

Re: [R] Subset Regression Package

2009-02-17 Thread Hans W. Borchers
Alex Roy gmail.com> writes: > > Dear all , > Is there any subset regression (subset selection > regression) package in R other than "leaps"? Lars and Lasso are other 'subset selection' methods, see the corresponding packages 'lars' and 'lasso2' and its description in The Elem

[R] using sapply to apply function to some columns of a dataframe

2009-02-17 Thread mwestphal
Hello: I would like to sum every x columns of a dataframe for each row. For instance, if x is 10, then for dataframe df, this function will sum the first ten elements together and then the next ten: sapply(list(colnames(df)[1:10], colnames(df)[11:20]),function(x)apply( df[,x], 1, sum)) If the

[R] Cross classified or Multiple membership or Hierarchical (3 level ) logistic models using Umacs

2009-02-17 Thread Luwis Tapiwa Diya
Dear R users, I would like to fit cross classified or multiple membership logistic models or a 3 level hierarchical logistic model using the Umacs package. Can anyone advise me on how to proceed or better point me to examples of how its done. Regards, -- Luwis Diya, Leuven Biostatistics and St

Re: [R] Whitening Time Series

2009-02-17 Thread Pele
Hi Bob - your suggesting worked out great... Many thanks! Also, thanks everyone for the other suggestions! Bob McCall wrote: > > Look in the package "forecast" for the function "Arima". It will do what > you want. It's different than arima function in the stats package. > Bob > > Pele wrote

Re: [R] Subset Regression Package

2009-02-17 Thread Ben Bolker
Alex Roy wrote: > > Dear all , > Is there any subset regression (subset selection > regression) package in R other than "leaps"? > > RSiteSearch("{subset regression}") doesn't turn up much other than special-purpose tools for ARMA models etc.. What does leaps not do that y

Re: [R] printing out the summary for lm into a txt file

2009-02-17 Thread kayj
this is the error message that I was getting "In sink() ... : no sink to remove" i got it to work . thanks for the help David Winsemius wrote: > > " did not work." > > Might that mean errors? Care to share? > > Running that through my wetware R interpreter, I think I am seeing you

Re: [R] printing out the summary for lm into a txt file

2009-02-17 Thread kayj
Thanks a lot for your help, it worked. Greg Snow-2 wrote: > > The sink() command stops the sinking, so you send the lm output to the > file, then stop the sinking before printing out the anova result. So the > simplest thing to try is to put the first sink (with the filename and > append=T)

Re: [R] Percentiles/Quantiles with Weighting

2009-02-17 Thread roger koenker
url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On Feb 17, 2009, at 1:58 PM, Brigid Mooney wrote: Than

Re: [R] Percentiles/Quantiles with Weighting

2009-02-17 Thread Brigid Mooney
Thanks for pointing me to the quantreg package as a resource. I was hoping to ask be able to address one quick follow-up question... I get slightly different variants between using the rq funciton with formula = mydata ~ 1 as I would if I ran the same data using the quantile function. Example:

Re: [R] printing out the summary for lm into a txt file

2009-02-17 Thread Greg Snow
The sink() command stops the sinking, so you send the lm output to the file, then stop the sinking before printing out the anova result. So the simplest thing to try is to put the first sink (with the filename and append=T) before you start the loop, remove all calls to sink within the loop, th

Re: [R] creating a map

2009-02-17 Thread Greg Snow
It should be in the datasets package that is automatically loaded with R (at least my copy), try ?state and you should see the help for it and others. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 From: Alina Sheyman [mailto:ali

Re: [R] Overdispersion with binomial distribution

2009-02-17 Thread Ben Bolker
Thanks for the clarification. I actually had MASS open to that page while I was composing my reply but forgot to mention it (trying to do too many things at once) ... Ben Bolker Prof Brian Ripley wrote: > On Tue, 17 Feb 2009, Ben Bolker wrote: > >> Jessica L Hite/hitejl/O/VCU vcu.edu> writ

Re: [R] printing out the summary for lm into a txt file

2009-02-17 Thread David Winsemius
" did not work." Might that mean errors? Care to share? Running that through my wetware R interpreter, I think I am seeing you ask for creation of models with variable outcomes from a the first 100 columns of "data". And then you are specifying a formula that includes a weird mixture o

Re: [R] Overdispersion with binomial distribution

2009-02-17 Thread Prof Brian Ripley
On Tue, 17 Feb 2009, Ben Bolker wrote: Jessica L Hite/hitejl/O/VCU vcu.edu> writes: I am attempting to run a glm with a binomial model to analyze proportion data. I have been following Crawley's book closely and am wondering if there is an accepted standard for how much is too much overdisper

[R] multiple levels of nesting with trellis plots

2009-02-17 Thread R User R User
Hi guys, I have a tricky problem that I'd appreciate your help with. I have two categorical variables, say varA and varB and an associated frequency Freq for combinations of the levels of varA and varB. This was created with a table() call. I'd now like to make panel plots of the frequency. I can

Re: [R] how to control the overall shape of a figure?

2009-02-17 Thread Oliver
Thanks very much, exactly what I need. Oliver On Feb 16, 10:36 pm, Marc Schwartz wrote: > on 02/16/2009 07:51 PM Oliver wrote: > > > > > hi, > > > I am a R beginner. One thing I notice is that when do graphing is, > > > if I want to draw two figures in a row such as this: > > > par(mfrow(1, 2))

[R] printing out the summary for lm into a txt file

2009-02-17 Thread kayj
Hi All, I am trying to run several linear regressions and print out the summay and the anova reslts on the top of each other for each model. Below is a sample progarm that did not work. is it possible to print the anova below the summary of lm in one file? thanks for your help #

[R] Error with "make" with R-devel

2009-02-17 Thread Lana Schaffer
Hi, I am getting an error compiling the R-devel on a suse architecture 64-bit architecture. The cp attribute is sending 'trusted.lov' and an error. This is a sample of the output: > make[3]: Entering directory >`/lustre/people/schaffer/R-devel/src/library/base' >building package 'base' >make[4]

Re: [R] creating a map

2009-02-17 Thread Alina Sheyman
Thanks Greg, do you know where i can find the sate.center dataset that you mention? On Tue, Feb 17, 2009 at 12:28 PM, Greg Snow wrote: > You need to give the symbols function the locations where you want the > centers of the circles to be. Some datesets with map information also have > center

Re: [R] Overdispersion with binomial distribution

2009-02-17 Thread Ben Bolker
Jessica L Hite/hitejl/O/VCU vcu.edu> writes: > I am attempting to run a glm with a binomial model to analyze proportion > data. > I have been following Crawley's book closely and am wondering if there is > an accepted standard for how much is too much overdispersion? (e.g. change > in AIC has an

Re: [R] creating a map

2009-02-17 Thread Greg Snow
You need to give the symbols function the locations where you want the centers of the circles to be. Some datesets with map information also have centers of the states that you can use, for the USA, there is the state.center dataset that may work for you, or the maptools package function get.Pc

Re: [R] Percentiles/Quantiles with Weighting

2009-02-17 Thread David Winsemius
I do know that Harrell's Quantile function in the Hmisc package will allow quantile estimates from models. Whether it is general enough to extend to time series, I have no experience and cannot say. -- David Winsemius On Feb 17, 2009, at 11:57 AM, Brigid Mooney wrote: Hi All, I am lookin

Re: [R] merging files with different structures

2009-02-17 Thread Grant Gillis
> Hello list, > > I am sorry for the previous half post. I accidentily hit send. Thanks > again in advance for any help. > > I have many (approx 20) files that I have merged. Each data set contains > rows for individuals and data in 2 - 5 columns (depending upon which data > set). The individua

Re: [R] spss-file problem with foreign 0.8-32

2009-02-17 Thread Prof Brian Ripley
It is a issue specific to 0.8-32 and some files (most likely those with some (not all) Windows codepages declared). We are trying to collect together some examples, and will update foreign accordingly later in the week. On Tue, 17 Feb 2009, Harry Haupt wrote: Hi, after updating to foreign

[R] merging files with different structures

2009-02-17 Thread Grant Gillis
Hello list, Thanks in advance for any help. I have many (approx 20) files that I have merged. For example d1<-read.csv("AlleleReport.csv") d2<-read.csv("AlleleReport.csv") m1 <- merge(d1, d2, by = c("IND", intersect(colnames(d1), colnames(d2))), all = TRUE) m2 <- merge(m1, d3, by = c("IND",

Re: [R] creating a map

2009-02-17 Thread David Winsemius
Two places that have worked examples leap to mind: --- Sarkar's online accompaniment to his book: http://lmdvr.r-forge.r-project.org/figures/figures.html Thumbing through the hard copy I see Figure 6.5 might of interest. --- Addicted to R's graphics gallery: http://addictedtor.free.fr/graphiques

[R] Percentiles/Quantiles with Weighting

2009-02-17 Thread Brigid Mooney
Hi All, I am looking at applications of percentiles to time sequenced data. I had just been using the quantile function to get percentiles over various periods, but am more interested in if there is an accepted (and/or R-implemented) method to apply weighting to the data so as to weigh recent dat

Re: [R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009

2009-02-17 Thread Uwe Ligges
Paul Heinrich Dietrich wrote: Hi all, I've managed to get JAGS working on my Ubuntu Hardy Linux with a 32-bit computer and AMD processors using R 2.8.1. JAGS is great. I've read that JAGS is the fastest, but that hasn't been my experience. At any rate, I have more experience with WinBUGS und

Re: [R] ARIMA models

2009-02-17 Thread Gabor Grothendieck
see auto.arima in the forecast package. On Tue, Feb 17, 2009 at 10:20 AM, emj83 wrote: > > is there some sort of R function which can advise me of the best ARIMA(p,q,r) > model to use based on the Schwarz criterion e.g for e.g p=0-5, q =0, r=0-5 > or for example p+r< 5??? > > or is this something

[R] creating a map

2009-02-17 Thread Alina Sheyman
I'm trying to create a fairly basic map using R. What i want to get is the map of the country with circles representing a count of students in each state. What I've done so far is as following - map("state") symbols(data1$count,circles=log(data1$count)*3,fg=col,bg=col,add=T,inches=F) this gives

Re: [R] Chromatogram deconvolution and peak matching

2009-02-17 Thread Katharine Mullen
Hoi Bart, I think you're right that ALS should be applicable to this problem. Unfortunately in writing I see that there is a bug when the spectra are NOT constrained to nonnegative values (the package has been used to my knowledge only in fitting multiway mass spectra thus far, where this constrai

Re: [R] Comparison of age categories using contrasts

2009-02-17 Thread Mark Difford
Hi Dylan, Chuck, Mark Difford wrote: >> Coming to your question [?] about how to generate the kind of contrasts >> that Patrick wanted >> using contrast.Design. Well, it is not that straightforward, though I may >> have missed >> something in the documentation to the function. In the past I hav

Re: [R] Survival-Analysis: How to get numerical values from survfit (and not just a plot)?

2009-02-17 Thread Eik Vettorazzi
Hi Bernhard, I'm wondering what you will expect to get in "dividing" two proportional survival curves from a fitted cox model. Anyway, you can provide a newdata object to the survfit function containing any combination of cofactors you are interested in and then use summary, eg: fit <- coxph(

[R] How to connect R and WinBUGS/OpenBUGS/LinBUGS in Linux in Feb. 2009

2009-02-17 Thread Paul Heinrich Dietrich
Hi all, I've managed to get JAGS working on my Ubuntu Hardy Linux with a 32-bit computer and AMD processors using R 2.8.1. JAGS is great. I've read that JAGS is the fastest, but that hasn't been my experience. At any rate, I have more experience with WinBUGS under Windows and would like a versi

[R] ARIMA models

2009-02-17 Thread emj83
is there some sort of R function which can advise me of the best ARIMA(p,q,r) model to use based on the Schwarz criterion e.g for e.g p=0-5, q =0, r=0-5 or for example p+r< 5??? or is this something I will have to write my own code for? Thanks Emma -- View this message in context: http://www.n

Re: [R] R scripts and parameters

2009-02-17 Thread Duncan Murdoch
On 2/17/2009 10:55 AM, mau...@alice.it wrote: A couple of weeks ago I asked how it is possible to run an R script (not a function) passing some parameters. Someone suggested the function "commandArgs()". I read the on-line help and found no clarifying example. Therefore I do not know how to use

Re: [R] spss-file problem with foreign 0.8-32

2009-02-17 Thread Harry Haupt
Peter Dalgaard wrote: > > Yes, something in the logic appears to have gotten garbled. > > It's in this part of read,spss: > > if (is.character(reencode)) { > cp <- reencode > reencode <- TRUE > } > else if (codepage <= 500 || codepage >= 2000) { > attr(rval,

Re: [R] R scripts and parameters

2009-02-17 Thread Gabor Grothendieck
Try this: A <- 1 B <- 2 C <- 3 source("myfile.R") Now the code in myfile can access A, B and C. On Tue, Feb 17, 2009 at 10:55 AM, wrote: > A couple of weeks ago I asked how it is possible to run an R script (not a > function) passing some parameters. > Someone suggested the function "commandA

Re: [R] Survival-Analysis: How to get numerical values from survfit (and not just a plot)?

2009-02-17 Thread David Winsemius
I seriously doubt that a survfit object could only contain that information. I suspect that you are erroneously thinking that what print.survfit offers is the entire story. What does str(survfit(, data=) ) show you? > data(aml) > aml.mdl <- survfit(Surv(time, status) ~ x, data=aml) # this is

[R] word wrap using Hershey fonts

2009-02-17 Thread SLCMSR
Hi, is it possible to wrap a text using Hershey fonts? "\n" does not work! Thanks in advance, Martina __ 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-g

Re: [R] R crash after fGarch update

2009-02-17 Thread John Kerpel
Prof Ripley: Many thanks - it did indeed say it cannot find fGarch after I tried your advice - but a completely clean re-install did the trick. John On Tue, Feb 17, 2009 at 1:09 AM, Prof Brian Ripley wrote: > Start R with --vanilla, or rename youe saved workspace (.RData). > Then > > library(fG

Re: [R] frequency table for multiple variables

2009-02-17 Thread Marc Schwartz
on 02/17/2009 09:06 AM Hans Ekbrand wrote: > Hi r-help! > > Consider the following data-frame: > >var1 var2 var3 > 1 314 > 2 223 > 3 223 > 4 44 NA > 5 435 > 6 223 > 7 343 > > How can I get R to convert

[R] R scripts and parameters

2009-02-17 Thread mauede
A couple of weeks ago I asked how it is possible to run an R script (not a function) passing some parameters. Someone suggested the function "commandArgs()". I read the on-line help and found no clarifying example. Therefore I do not know how to use it appropriately. I noticed this function retur

Re: [R] spss-file problem with foreign 0.8-32

2009-02-17 Thread Peter Dalgaard
Harry Haupt wrote: > Hi, > after updating to foreign version 0.8-32, I experienced the following error > when I tried to load a SPSS file: > > Fehler in inherits(x, "factor") : objekt "cp" nicht gefunden > Zusätzlich: Warning message: > In read.spss("***l.sav", use.value.labels = TRUE, to.data.fra

Re: [R] Survival-Analysis: How to get numerical values from survfit (and not just a plot)?

2009-02-17 Thread Arthur Allignol
Hi, See ?survfit.object if fit is the object you get using survfit, fit$surv will give you the survival probability. Best, arthur Bernhard Reinhardt wrote: Hi! I came across R just a few days ago since I was looking for a toolbox for cox-regression. I´ve read "Cox Proportional-Hazards Reg

[R] Survival-Analysis: How to get numerical values from survfit (and not just a plot)?

2009-02-17 Thread Bernhard Reinhardt
Hi! I came across R just a few days ago since I was looking for a toolbox for cox-regression. I´ve read "Cox Proportional-Hazards Regression for Survival Data Appendix to An R and S-PLUS Companion to Applied Regression" from John Fox. As described therein plotting survival-functions works wel

Re: [R] joining "one-to-many"

2009-02-17 Thread Monica Pisica
Ok, I feel properly ashamed. I suppose my "real" data is a little bit different than my toy data (although i don't know how) because i did try the merge function as simple as merge(t1, t2) and did not work. Maybe a reset of my session will solve my problems and more coffee my confusion. Ag

Re: [R] Uninstall question

2009-02-17 Thread Sundar Dorai-Raj
This is on the Mac FAQ: http://cran.cnr.berkeley.edu/bin/macosx/RMacOSX-FAQ.html#How-can-R-for-Mac-OS-X-be-uninstalled_003f HTH, --sundar On Tue, Feb 17, 2009 at 7:17 AM, ANJAN PURKAYASTHA wrote: > I need to uninstall R 2.7.1 from my Mac. What is the best way to uninstall > it? Simply delete t

Re: [R] joining "one-to-many"

2009-02-17 Thread ONKELINX, Thierry
Hi Monica, merge(t1, t2) works on your example. So why don't you use merge? HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodolo

[R] Uninstall question

2009-02-17 Thread ANJAN PURKAYASTHA
I need to uninstall R 2.7.1 from my Mac. What is the best way to uninstall it? Simply delete the R icon in the Applications folder? Or is it more involved? TIA, Anjan -- = anjan purkayastha, phd bioinformatics analyst whitehead institute for biomedical research nine ca

[R] spss-file problem with foreign 0.8-32

2009-02-17 Thread Harry Haupt
Hi, after updating to foreign version 0.8-32, I experienced the following error when I tried to load a SPSS file: Fehler in inherits(x, "factor") : objekt "cp" nicht gefunden Zusätzlich: Warning message: In read.spss("***l.sav", use.value.labels = TRUE, to.data.frame = TRUE) : ***.sav: File-ind

Re: [R] joining "one-to-many"

2009-02-17 Thread Gabor Grothendieck
Try merge(t1, t2) On Tue, Feb 17, 2009 at 9:33 AM, Monica Pisica wrote: > > Hello list, > > I am wondering if a joining "one-to-many" can be done a little bit easier. I > tried merge function but I was not able to do it, so I end up using for and > if. > > Suppose you have a table with locatio

  1   2   >