Re: [R] Solving a multinomial gompertz partial differential equation in r

2012-12-03 Thread Suzen, Mehmet
Hi Brandon, You can try ReacTran package: cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf Best, -m On 3 December 2012 06:49, Brandon Breitling brandonjbreitl...@gmail.com wrote: I haven't used r in quite a while but would like to get back into it. I have a problem that I would

Re: [R] error of installing/building an R package (PortfolioAnalytics) on Win 7

2012-12-03 Thread R. Michael Weylandt
On Mon, Dec 3, 2012 at 12:42 AM, Jack Bryan dtustud...@hotmail.com wrote: Thanks for your reply. On http://cran.r-project.org/bin/windows/Rtools/ Frozen Rtools216.exe R 2.15.1 to R 2.16.x No Frozen means no available ? So, PortfolioAnalytics cannot be used on Linux or Win until Mar.

Re: [R] comparing two vectors

2012-12-03 Thread Berend Hasselman
On 03-12-2012, at 08:01, soham chakraborty wrote: Berend, I am working with a time series data.The log-likelihood is to be maximized for a set of parameters. Lets say that x1 and x2 are the output from two successive iterations.I am trying to find out, *if(all(abs(x1-x2).0001,say))*

[R] [R-pkgs] Package SixSigma updated to version 0.7-0

2012-12-03 Thread Emilio López
Dear list, A new version of the SixSigma package has been updated at CRAN. See details below, or visit http//www.sixsigmawithr.com http://cran.r-project.org/web/packages/SixSigma/index.html NEWS SixSigma 0.7-0 -- * New function ss.cc for control charts (currently supporting

[R] Spammer? [wa Re: Fitting binomial lmer-model, high deviance and low logLik]

2012-12-03 Thread Martin Maechler
Ben Bolker bbol...@gmail.com on Mon, 3 Dec 2012 01:18:13 + writes: rahul143 rk204885 at gmail.com writes: I have a strong suspicion that this person is a spammer. Evidence: 1. 24 e-mails to the r-help list in a little over an hour, which is

Re: [R] error of installing/building an R package (PortfolioAnalytics) on Win 7

2012-12-03 Thread Uwe Ligges
On 03.12.2012 01:42, Jack Bryan wrote: Thanks for your reply. On http://cran.r-project.org/bin/windows/Rtools/ Frozen Rtools216.exe R 2.15.1 to R 2.16.x No Frozen means no available ? Frozen = Yes means, that the toolchain does not change any more and is fixed to be used for the

[R] How to rename the columns of as.table

2012-12-03 Thread Hard Core
Hello guys .. I would like to have some help about as.table . I made a table with the autocorrelations of the returns whit 10 lags and i get this : autocorrelazione2 - as.table(c((cor(r2[-1151,],lag(r2))),(cor(r2[- c(1151,1150),],lag(r2, k=2))),(cor(r2[- c(1151,1150,1149),],lag(r2,

Re: [R] Fwd: How to calculate different groups of varialbes importance level?

2012-12-03 Thread Solmaz Filiz KARABAĞ
Dear Bart! Thanks for the question! It might be irrelevant for you!.However I am sure it is relevant for some other people! First there might be a some R package which could be solve this statistical problem, so the people who knows the commend of the package could help me- Second somebody who

[R] Using multicores in R

2012-12-03 Thread moriah
Hi, I have an R script which is time consuming because it has two nested loops in it of at least 5000 iterations each, I have tried to use the multicore package but id doesn't seem to improve the elapsed time of the script(a shorter script for example) and I can't use the mcapply because of

Re: [R] Warning message: In scan(file, what, nmax...)

2012-12-03 Thread F86
Dear David, Than you for helping me. I tried with , Data1-read.table(/Users/kama/Analysis/GDP10.csv,header=TRUE,sep=,) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 116 did not have 2 elements i also tried:

Re: [R] How to make the cell background of a table informative?

2012-12-03 Thread Jim Lemon
On 12/03/2012 02:41 PM, dweeb wrote: I wish to create a table in which the foreground is a number (abundance) but the background is a visual representation of a ratio (shallow:deep). In other words, the background of each cell of the table would be two colours or patterns set in a similar

Re: [R] How to mix three different classification techniques

2012-12-03 Thread Uwe Ligges
On 03.12.2012 03:43, Tania wrote: Hello all, do you know how to mix three different classification techniques using R. For example if I have lm regression, svm and neural nets how can I mix them to have something like ensemble learning? No, since I wouldn't call lm() a classification

Re: [R] How to rename the columns of as.table

2012-12-03 Thread Uwe Ligges
On 03.12.2012 11:00, Hard Core wrote: Hello guys .. I would like to have some help about as.table . I made a table with the autocorrelations of the returns whit 10 lags and i get this : autocorrelazione2 - as.table(c((cor(r2[-1151,],lag(r2))),(cor(r2[- c(1151,1150),],lag(r2, k=2))),(cor(r2[-

Re: [R] How to make the cell background of a table informative?

2012-12-03 Thread Uwe Ligges
On 03.12.2012 04:41, dweeb wrote: I wish to create a table in which the foreground is a number (abundance) but the background is a visual representation of a ratio (shallow:deep). In other words, the background of each cell of the table would be two colours or patterns set in a similar

Re: [R] How to find the lenth of more than ten variables?

2012-12-03 Thread Uwe Ligges
On 03.12.2012 05:27, killerkarthick wrote: Hi I have one data set with 20 variables. I want to find the length of each variables at a time. Please help me .. Thanks in advance Within a data.frame, all columns have the same length that is given by nrow(). Looks like you have

Re: [R] R beginner

2012-12-03 Thread avadhoot velankar
Hi andrew Stick to one tutorial before you get confident enough. I found this one very good. informative, easy to understand and best thing you basically try everything out on sample files provided. word of caution though instead of using ctrl+R command in script file, manually type it in consol

Re: [R] How to find the lenth of more than ten variables?

2012-12-03 Thread Jim Lemon
On 12/03/2012 03:27 PM, killerkarthick wrote: Hi I have one data set with 20 variables. I want to find the length of each variables at a time. Please help me .. Thanks in advance Hi killerkarthick, This may do what you want: unlist(lapply(my_data_set,length)) if the data set

[R] Species scores on PCoA

2012-12-03 Thread avadhoot velankar
Dear members, I am conducting principal coordinates anaysis on a set of morphometry data. I have 6 variables and 27 samples. I used almost all the packages for PCoA, and plotted ordination using orditkplot. I want to know is there any way i can add variables scores in the same plot. I want to

Re: [R] [mgcv][gam] Manually defining my own knots?

2012-12-03 Thread Simon Wood
Andrew, I think you mean dumb.example2$coefficients = averaged.models ~~~ currently your code adds a new vector 'coeff' to the gam object, rather than modifying 'coefficients'. (A good example of why forgiving languages like R are dangerous, and you should really

[R] Réponse automatique

2012-12-03 Thread j . boutet
Bonjour, Je serais en congés jusqu'au Jeudi 6 Décembre. Pour des raisons d'urgence, vous pourrez me contacter par téléphone au 06 46 34 81 03. Cordialement, -- Jérôme Boutet Conservatoire d'espaces naturels de Picardie 1, place Ginkgo - village Oasis 80 044

Re: [R] Problem with figures

2012-12-03 Thread Shige Song
Thanks, Yihui. It turns out that getting rid of the preview option is not enough and one must include tikz and print to make it work. Shige On Sun, Dec 2, 2012 at 11:10 PM, Yihui Xie x...@yihui.name wrote: fig=TRUE is irrelevant here, and knitr does not need fig=TRUE at all (plots are

Re: [R] error of installing/building an R package (PortfolioAnalytics) on Win 7

2012-12-03 Thread Joshua Ulrich
On Mon, Dec 3, 2012 at 2:13 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: On Mon, Dec 3, 2012 at 12:42 AM, Jack Bryan dtustud...@hotmail.com wrote: Thanks for your reply. On http://cran.r-project.org/bin/windows/Rtools/ Frozen Rtools216.exe R 2.15.1 to R 2.16.x No Frozen

[R] xlsx file read in R

2012-12-03 Thread Nico Met
Dear all, How can I read .xlsx files in R Regards Nico [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Warning message: In scan(file, what, nmax...)

2012-12-03 Thread Uwe Ligges
On 03.12.2012 11:30, F86 wrote: Dear David, Than you for helping me. I tried with , Data1-read.table(/Users/kama/Analysis/GDP10.csv,header=TRUE,sep=,) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 116 did not have 2 elements So please how us lines

Re: [R] xlsx file read in R

2012-12-03 Thread Gabor Grothendieck
On Mon, Dec 3, 2012 at 7:59 AM, Nico Met nicome...@gmail.com wrote: Dear all, How can I read .xlsx files in R See: http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows -- Statistics Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at

Re: [R] xlsx file read in R

2012-12-03 Thread Uwe Ligges
On 03.12.2012 13:59, Nico Met wrote: Dear all, How can I read .xlsx files in R See the Data Import/Export manual? Uwe Ligges Regards Nico [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] xlsx file read in R

2012-12-03 Thread John Kane
http://cran.r-project.org/doc/manuals/R-data.html John Kane Kingston ON Canada -Original Message- From: nicome...@gmail.com Sent: Mon, 3 Dec 2012 13:59:18 +0100 To: r-help@r-project.org Subject: [R] xlsx file read in R Dear all, How can I read .xlsx files in R Regards Nico

Re: [R] Using multicores in R

2012-12-03 Thread Uwe Ligges
On 03.12.2012 11:14, moriah wrote: Hi, I have an R script which is time consuming because it has two nested loops in it of at least 5000 iterations each, I have tried to use the multicore package but id doesn't seem to improve the elapsed time of the script(a shorter script for example) and I

Re: [R] xlsx file read in R

2012-12-03 Thread R. Michael Weylandt
There are a couple of CRAN packages available -- my personal recommendation is XLConnect. MW On Mon, Dec 3, 2012 at 12:59 PM, Nico Met nicome...@gmail.com wrote: Dear all, How can I read .xlsx files in R Regards Nico [[alternative HTML version deleted]]

Re: [R] xlsx file read in R

2012-12-03 Thread jim holtman
use the XLConnect package. On Mon, Dec 3, 2012 at 7:59 AM, Nico Met nicome...@gmail.com wrote: Dear all, How can I read .xlsx files in R Regards Nico [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] xlsx file read in R

2012-12-03 Thread Nico Met
Dear all, this is the code I used to read the .xlsx file but get an error message library(rJava) library(XLConnectJars) library(XLConnect) file-readWorksheetFromFile(all_in.xlsx, sheet = 1) *Error: NoClassDefFoundError (Java): Could not initialize class org.apache.poi.POIXMLDocument* No

[R] fitting a gamma frailty model (coxph)

2012-12-03 Thread Marco Munda
Dear all, I have a data sethttp://yaap.it/paste/c11b9fdcfd68d02b#gIVtLrrme3MaiQd9hHy1zcTjRq7VsVQ8eAZ2fol1lUc=with 6 clusters, each containing 48 (possibly censored, in which case event = 0) survival times. The x column contains a binary explanatory variable. I try to describe that data with a

[R] internal validation_logistic regression results

2012-12-03 Thread martina CHITTANI
Hi,I'm developing a case-control study on genotyping data.I have fitted a logistic regression with covariates on this dataset, to pinpoint association between some SNPs and response to a drug treatment. I do not have a sample for confirmation of results, so I would perform a internal

[R] Calculation of extremely low p-values (in lm)

2012-12-03 Thread Sindri
Dear R-users Please excuse me if this topic has been covered before, but I was unable to find anything relevant by searching I am currently doing a comparison of two biological variables that have a highly significant linear relationship. I know that the p-value of linear regression is not so

Re: [R] Daily Time Series, patterns.

2012-12-03 Thread mekbatub
Hi Arun, thanks again, I think we are close. The way You gave me looks good, but I sill have one problem, look at this: Lets say, we have data like this: head(dat3) Date quantity 2012-03-05 65.16 2012-03-06 70.67 2012-03-08 63.66 2012-03-09 70.05 2012-03-12 61.59 2012-03-13 58.98

[R] Help R CMD check

2012-12-03 Thread Monica Rinaldi
Hello, I'm trying to make one new package and when I'm run the following statement R CMD check new R return the next error: * checking whether package 'new' can be installed ... ERROR * install options are ' --no-html' Errore: 1:8: unexpected symbol 1: export R ^ Esecuzione

Re: [R] Using multicores in R

2012-12-03 Thread Steve Lianoglou
And also: On Monday, December 3, 2012, Uwe Ligges wrote: On 03.12.2012 11:14, moriah wrote: Hi, I have an R script which is time consuming because it has two nested loops in it of at least 5000 iterations each, I have tried to use the multicore package but id doesn't seem to improve the

Re: [R] Calculation of extremely low p-values (in lm)

2012-12-03 Thread Robert Baer
On 12/3/2012 6:20 AM, Sindri wrote: Dear R-users Please excuse me if this topic has been covered before, but I was unable to find anything relevant by searching I am currently doing a comparison of two biological variables that have a highly significant linear relationship. I know that the

Re: [R] Help R CMD check

2012-12-03 Thread Duncan Murdoch
On 03/12/2012 8:46 AM, Monica Rinaldi wrote: Hello, I'm trying to make one new package and when I'm run the following statement R CMD check new R return the next error: * checking whether package 'new' can be installed ... ERROR * install options are ' --no-html' Errore: 1:8: unexpected

Re: [R] xlsx file read in R

2012-12-03 Thread R. Michael Weylandt
On Mon, Dec 3, 2012 at 1:27 PM, Nico Met nicome...@gmail.com wrote: Dear all, this is the code I used to read the .xlsx file but get an error message library(rJava) library(XLConnectJars) library(XLConnect) file-readWorksheetFromFile(all_in.xlsx, sheet = 1) Error:

[R] help on interpreting nonlinear regresson modelling results

2012-12-03 Thread Andras Farkas
Dear All,   wondering if you know of a good resource on-line to read on interpreting the parameter estimate result statistics' for the output of a nonlinear regression model. I am specifically having a hard time finding information on the interpretation  of t value and Pr /t/ in layman terms.

Re: [R] Calculation of extremely low p-values (in lm)

2012-12-03 Thread Rui Barradas
Hello, It's easy to see what's going on by reading the sources, to be open source is one of the strong points of R, we know exactly how the values are computed. A reviewer might like to have an explanation of what R does. The op could check with Friedrich Leisch's Creating R Packages: A

[R] Excluding all missing values with dcast (reshape2 package)

2012-12-03 Thread Michael . Laviolette
Hello--I'm doing a simple crosstab using dcast: rawfreq - dcast(nh11brfs, race3~CHCCOPD, length) with the results race3 Yes No NA 1 White non-Hispanic 446 5473 21 2 Other non-Hispanic 29 211 0 3 Hispanic 6 81 1 4 NA 10 83 1 How would I

Re: [R] multiline text() with different cex sizes

2012-12-03 Thread Michael Friendly
Well, no one answered this back in August, and now I have the same problem with another figure. Again, is there some way to position several lines of text within a plot written at different cex sizes so that the relative spacing of the lines remains fixed when the plot is resized or written to

[R] How to calculate the spatial correlation of several files?

2012-12-03 Thread Jonsson
dir1 - list.files(C:\\Users\\aalyaari\\Desktop\\cor, *.bin, full.names = TRUE) dir2 - list.files(C:\\Users\\aalyaari\\Desktop\\cor2, *.bin, full.names = TRUE) results - list() for (.files in dir1){ # read in the 365 files as a vector of numbers for dir1 file1 -

Re: [R] cubic spline

2012-12-03 Thread Martin Maechler
Ben Bolker bbol...@gmail.com on Sat, 1 Dec 2012 21:49:47 + writes: Martin Maechler maechler at stat.math.ethz.ch writes: [snip] but definitely *no* need to use a function from an extra CRAN package .. as someone else ``erronously'' suggested. Note that

Re: [R] Problem with figures

2012-12-03 Thread Shige Song
All right. I did some more digging. It turns out that the real problem is that the version of the standalone LaTeX package installed on my Debian system is 1.1a. The easiest fix is to replace the three files standalone.cfg, standalone.cls, and standalone.sty with the most recent version from CTAN,

Re: [R] multiline text() with different cex sizes

2012-12-03 Thread Uwe Ligges
On 03.12.2012 16:13, Michael Friendly wrote: Well, no one answered this back in August, and now I have the same problem with another figure. Again, is there some way to position several lines of text within a plot written at different cex sizes so that the relative spacing of the lines

[R] match and substitute two variables

2012-12-03 Thread irene
Hello, I have two variables (of different length and from two different data frames): code- c(101001, 1032, 102, 101001, 102, 1032); name- c(101001 Alta, 102 Bassa, 1032 Media); and I would like to substitute the first variable with the second variable according to their shared numerical

Re: [R] match and substitute two variables

2012-12-03 Thread Rui Barradas
Hello, Try the following. for(nm in name){ code[grep(gsub([ [:alpha:]]+, , nm), code)] - nm } code Hope this helps, Rui Barradas Em 03-12-2012 15:32, irene escreveu: Hello, I have two variables (of different length and from two different data frames): code- c(101001, 1032, 102,

Re: [R] How to calculate the spatial correlation of several files?

2012-12-03 Thread Rui Barradas
Hello, Inline. Em 03-12-2012 15:15, Jonsson escreveu: dir1 - list.files(C:\\Users\\aalyaari\\Desktop\\cor, *.bin, full.names = TRUE) dir2 - list.files(C:\\Users\\aalyaari\\Desktop\\cor2, *.bin, full.names = TRUE) results - list() for (.files in dir1){ # read in the 365

Re: [R] How to calculate the spatial correlation of several files?

2012-12-03 Thread Rui Barradas
Hello, Sorry, made a mistake. Em 03-12-2012 16:12, Rui Barradas escreveu: Hello, Inline. Em 03-12-2012 15:15, Jonsson escreveu: dir1 - list.files(C:\\Users\\aalyaari\\Desktop\\cor, *.bin, full.names = TRUE) dir2 - list.files(C:\\Users\\aalyaari\\Desktop\\cor2, *.bin, full.names =

Re: [R] How to calculate the spatial correlation of several files?

2012-12-03 Thread Jonsson
Thanks you meant it shoud be: file1=do.call(rbind, lapply(dir1, readBin, integer(), size = 2, n = 360 * 720, signed = T)) file2=do.call(rbind, lapply(dir2, readBin, integer(), size = 2, n = 360 * 720, signed = T)) Please see the error for (.f in

Re: [R] Reading PDF files

2012-12-03 Thread jose romero
Hello: Apart from readPDF in the tm package, you can use the pdf to text converter command in linux, which is pdftotext.  Say file.pdf is your file, from R you'd use: system(pdftotext file.pdf -layout) This invokes the pdftotext command from within R and creates a file called file.txt with

Re: [R] How to calculate the spatial correlation of several files?

2012-12-03 Thread Rui Barradas
Ok, so I was mistaken when I thought I had made a mistake. Change to rows again: for (.f in seq_along(dir1)){ results[[.f]]- cor(file1[.f, ] ,file2[.f, ]) } Rui Barradas Em 03-12-2012 16:26, Jonsson escreveu: Thanks you meant it shoud be: file1=do.call(rbind, lapply(dir1, readBin,

Re: [R] Excluding all missing values with dcast (reshape2 package)

2012-12-03 Thread Jessica Streicher
This is not a reproducible example ;) anyways, dcast has an attribute: drop should missing combinations dropped or kept? does that not do what you want? On 03.12.2012, at 16:07, michael.laviole...@dhhs.state.nh.us wrote: Hello--I'm doing a simple crosstab using dcast: rawfreq -

[R] Non-quadratic plots

2012-12-03 Thread Jessica Streicher
I'd like to make plots that do not have the quadratic layout, like having a plot that is twice as wide as it is high (without distorting everything). Sadly i wasn't able to find anything in par that does that. Best would be with plot(), but i'd use the ggplot package as well if necessary.

Re: [R] Problem with figures

2012-12-03 Thread Yihui Xie
I'm using the latest version of TeXLive under Ubuntu (http://packages.ubuntu.com/quantal/tex/texlive) so I did not realize the version of standalone can be a problem. My version is also 1.1a, but I do not have any problems if I remove the preview option from your example. Sounds like there is a

Re: [R] Non-quadratic plots

2012-12-03 Thread Jessica Streicher
Nevermind, found i can at least do it with pdf() and consorts, so i'll get it right in my images, and thats the main point. On 03.12.2012, at 18:06, Jessica Streicher wrote: I'd like to make plots that do not have the quadratic layout, like having a plot that is twice as wide as it is high

[R] R-Forge not building packages?

2012-12-03 Thread Ulrich Staudinger
Hi there, I am waiting since days for my package to be built on R-Forge. https://r-forge.r-project.org/R/?group_id=1518 R-Forge says: Version: 0.2 | Last change: 2012-11-27 21:37:05+01 | Rev.: 32 Build status: Building But I am already at revision 37 and R-Forge doesn't move since 6 days

Re: [R] R-Forge not building packages?

2012-12-03 Thread Uwe Ligges
On 03.12.2012 19:05, Ulrich Staudinger wrote: Hi there, I am waiting since days for my package to be built on R-Forge. https://r-forge.r-project.org/R/?group_id=1518 R-Forge says: Version: 0.2 | Last change: 2012-11-27 21:37:05+01 | Rev.: 32 Build status: Building But I am already at

Re: [R] R-Forge not building packages?

2012-12-03 Thread Yihui Xie
I will not be surprised if it takes longer than a week to build a package on R-Forge, although I have no idea why it has to be incredibly slow (do they have Sys.sleep(7*24*60*60) somewhere in the code?). I do have found an alternative solution, though, which is to spend these days on teaching more

Re: [R] Non-quadratic plots

2012-12-03 Thread David Winsemius
On Dec 3, 2012, at 9:29 AM, Jessica Streicher wrote: Nevermind, found i can at least do it with pdf() and consorts, so i'll get it right in my images, and thats the main point. On 03.12.2012, at 18:06, Jessica Streicher wrote: I'd like to make plots that do not have the quadratic layout,

Re: [R] R-Forge not building packages?

2012-12-03 Thread Ulrich Staudinger
Thanks for all the feedback, I have written a message to R-Forge help ... On Mon, Dec 3, 2012 at 7:21 PM, Yihui Xie x...@yihui.name wrote: I will not be surprised if it takes longer than a week to build a package on R-Forge, although I have no idea why it has to be incredibly slow (do they

[R] How to read SPSS file in R

2012-12-03 Thread F86
Dear R-users, I have som troubles with .sav file. How is it possible for us R-users to read SPSS files. I know that is possible, I tried the following: library(foreign) Corp-read.spss(/Users/kama/Analysis/Corporation.sav, header=TRUE, sep=,) Error in

[R] How to pass a vector of characters with Rscript through commandline

2012-12-03 Thread narges_s
Hi, I have an R script and I want to it to accept a vector of characters as the input parameters in command line with the command Rscript. So for example I have this vector : each - c(04,08,12,14) and I want to do this: Rscript script.R each  How can I pass it? Thanks  [[alternative

Re: [R] Excluding all missing values with dcast (reshape2 package)

2012-12-03 Thread arun
Hi, ?na.omit() dat1-read.table(text= Tool Step_Number A 1 A 2 A 3 A 3 B 1 B 2 B 2 B 3 B NA NA 3 ,sep=,header=TRUE,stringsAsFactors=FALSE)    dcast(na.omit(dat1),Tool~Step_Number,length) #Using Step_Number as value column: use value.var to override.  # Tool 1 2 3 #1    A 1 1 2 #2    B 1 2 1

Re: [R] match and substitute two variables

2012-12-03 Thread irene
It works perfectly, thank you! -- View this message in context: http://r.789695.n4.nabble.com/match-and-substitute-two-variables-tp4651893p4651906.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] match and substitute two variables

2012-12-03 Thread arun
Hi, try this:  paste(code,gsub(\\d+,,name)[match(code,gsub(\\D+,,name))],sep= ) #[1] 101001  Alta 1032  Media  102  Bassa   101001  Alta 102  Bassa  #[6] 1032  Media A.K. - Original Message - From: irene irenerube...@yahoo.it To: r-help@r-project.org Cc: Sent: Monday, December 3,

Re: [R] Change case of factor in data frame

2012-12-03 Thread Audrey
Ok, it seems that the function to get generic field names is get() res=names(dat); get(res[ind],pos=dat) will retrieve dat$name -- View this message in context: http://r.789695.n4.nabble.com/Change-case-of-factor-in-data-frame-tp4651696p4651919.html Sent from the R help mailing list archive

[R] switch() vs eval() for choosing pre-existing alternatives?

2012-12-03 Thread Mauricio Cornejo
Can anyone explain (perhaps with an example) why the R Language Definitions (Version 2.15.2, 2012-10-26, DRAFT) says the following in section 3.2.6? To choose from a list of alternatives that already exists switch() may not be the best way to select one for evaluation. It is often better to

Re: [R] Daily Time Series, patterns.

2012-12-03 Thread arun
Hi, In addition, you can use ?dayOfWeek() from library(timeDate) set.seed(5) quantity-sample(c(120:220,NA),699,replace=TRUE) Date=seq(as.Date(2011-01-01),len=699,by=1 day) dat3-data.frame(Date=Date,quantity=quantity)  nrow(dat3) #[1] 699 library(timeDate)

Re: [R] Using multicores in R

2012-12-03 Thread Spencer Graves
1. Have you looked at CRAN Task View: High-Performance and Parallel Computing with R (http://cran.r-project.org/web/views/HighPerformanceComputing.html)? 2. Have you tried the compiler package? If I understand correctly, R is a two-stage interpreter, first translating what we

Re: [R] How to read SPSS file in R

2012-12-03 Thread S Ellison
I tried the following: library(foreign) Corp-read.spss(/Users/kama/Analysis/Corporation.sav, header=TRUE, sep=,) Error in read.spss(/Users/kama/Analysis/Corporation.sav, header = TRUE, : unused argument(s) (header = TRUE, sep = ,)

Re: [R] R-Forge not building packages?

2012-12-03 Thread Spencer Graves
If I'm not mistaken, R-forge is run by volunteers who have real jobs otherwise. The system occasionally grinds to a halt without them noticing. So far, each time that happens, they restart something, but they have yet to identify and fix the root cause of why it stops. Spencer

Re: [R] How to pass a vector of characters with Rscript through commandline

2012-12-03 Thread MacQueen, Don
Use the commandArgs() function to get the parameters into R, then parse them. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 12/3/12 8:44 AM, narge...@yahoo.com narge...@yahoo.com wrote: Hi, I have an R script and I

[R] How do I make R randomForest model size smaller?

2012-12-03 Thread John Foreman
I've been training randomForest models on 7 million rows of data (41 features). Here's an example call: myModel - randomForest(RESPONSE~., data=mydata, ntree=50, maxnodes=30) I thought surely with only 50 trees and 30 terminal nodes that the memory footprint of myModel would be small. But it's

Re: [R] Change case of factor in data frame

2012-12-03 Thread David Winsemius
On Dec 3, 2012, at 9:47 AM, Audrey wrote: Ok, it seems that the function to get generic field names is get() Er, not really. res=names(dat); get(res[ind],pos=dat) will retrieve dat$name There are far less baroque was of doing that (including dat$name and dat[[name]]. Read: ?[ If

Re: [R] Change case of factor in data frame

2012-12-03 Thread David Winsemius
On Dec 2, 2012, at 12:46 PM, Audrey wrote: I am trying to write a function to change the case of all of the text in a data frame to lower case. Define what you mean by text. I do not have foreknowledge of the data frame names or the data types of each column. It seems that if one

Re: [R] Solving a multinomial gompertz partial differential equation in r

2012-12-03 Thread Thomas Petzoldt
On 12/3/2012 9:12 AM, Suzen, Mehmet wrote: Hi Brandon, You can try ReacTran package: cran.r-project.org/web/packages/ReacTran/vignettes/PDE.pdf Best, -m ReacTran is for managing the tr5ansport in reactive transport models, is relies on package deSolve that contains the ODE/PDE solvers, so

Re: [R] Using multicores in R

2012-12-03 Thread Jim Porzak
Moriah, Since you are doing nested loops, Rcpp may be an easy speed-up. Follow all the links here http://blog.revolutionanalytics.com/2012/11/hadleys-guide-to-high-performance-r-with-rcpp.html for details. HTH, Jim Porzak Minted.com San Francisco, CA www.linkedin.com/in/jimporzak use R! Group

[R] CTM and survival analysis with heterogeneity

2012-12-03 Thread Sebastián Daza
Hello R experts, I wonder if there is any package to estimate this kind of models in R: Multi-state Multi-spell Survival Models with Heterogeneity One of the most powerful programs for survival models is CTM, the Continuous Time Model, developed for NIH at NORC under the direction of James J.

[R] .Rd vs. .R, matrix multiplication

2012-12-03 Thread Christian Hoffmann
Hi, I find it cumbersomesome the I have to use \%*\% in .Rd files vs. %*% in .R files. R CMD check will refuse %*% in .Rd files. I would like to have %*% in .Rd files to be able to execute expressions with matrix multiplication from .Rd files directly, but ESS (version 5.13) would refuse to

[R] r function definition

2012-12-03 Thread qq
I am a very new R user. I am trying to write functons and debug functions. One problem for me is that I need to alwasy copy the whole function body and resubmit to R console every time I changed even one line of the function. Because I have long algorithm function, copying and pasting is very

[R] Confidence bands with function survplot

2012-12-03 Thread Tian3507
Dear all, I am trying to plot KM curves with confidence bands with function survplot under package rms. However, the following codes do not seem to work. The KM curves are produced, but the confidence bands are not there. Any insights? Thanks in advance. library(rms) data

[R] discrepancy in fisher exact test between R and wiki formula

2012-12-03 Thread JiangMei
Hi All. Sorry to bother you. I have a question about fisher exact test. I counted the presence of gene mutation in two groups of samples. My data is as follows Presence Absence GroupA 46 GroupB 511 When using the formula of fisher exact

[R] Forest plot

2012-12-03 Thread Min Dong
Hi, I am a novice in R. It will be greatly appreciated if someone can advise me with the following questions. 1) How to highlight reference range in forest plot? For example, if 1.5-2 is the reference range, I would like to have all the area between 1.5-2 to be highlighted (such as in grey

[R] Chi-squared test when observed near expected

2012-12-03 Thread Troy S
Dear UseRs, I'm running a chi-squared test where the expected matrix is the same as the observed, after rounding. R reports a X-squared of zero with a p value of one. I can justify this because any other result will deviate at least as much from the expected because what we observe is the

[R] Nested ANCOVA question

2012-12-03 Thread Sean Bignami
Hello R experts, I have having a difficult time figuring out how to perform and interpret an ANCOVA of my nested experimental data and would love any suggestions that you might have. Here is the deal: 1) I have twelve tanks of fish (1-12), each with a bunch of fish in them 2) I have three

Re: [R] discrepancy in fisher exact test between R and wiki formula

2012-12-03 Thread Ted Harding
On 03-Dec-2012 21:22:28 JiangMei wrote: Hi All. Sorry to bother you. I have a question about fisher exact test. I counted the presence of gene mutation in two groups of samples. My data is as follows Presence Absence GroupA 46 GroupB 5

Re: [R] r function definition

2012-12-03 Thread Jeff Newmiller
?source --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

Re: [R] Chi-squared test when observed near expected

2012-12-03 Thread William Dunlap
sum((x$observed-x$expected)^2/x$expected) [1] 0.05562457 Read about Yate's continuity correction - your formula does not use it and chisq.test does unless you suppress it: chisq.test(trial) Pearson's Chi-squared test with Yates' continuity correction data: trial

Re: [R] Chi-squared test when observed near expected

2012-12-03 Thread Ted Harding
On 03-Dec-2012 21:40:35 Troy S wrote: Dear UseRs, I'm running a chi-squared test where the expected matrix is the same as the observed, after rounding. R reports a X-squared of zero with a p value of one. I can justify this because any other result will deviate at least as much from the

Re: [R] Confidence bands with function survplot

2012-12-03 Thread David Winsemius
On Dec 3, 2012, at 1:19 PM, Tian3507 wrote: Dear all, I am trying to plot KM curves with confidence bands with function survplot under package rms. However, the following codes do not seem to work. The KM curves are produced, but the confidence bands are not there. Any insights?

[R] Speeding reading of a large file

2012-12-03 Thread Fisher Dennis
Colleagues, This past week, I asked the following question: I have a file that looks that this: TABLE NO. 1 PTIDTIMEAMT FORMPERIOD IPRED CWRES EVIDCP PREDRES WRES 2.0010E+03

Re: [R] Chi-squared test when observed near expected

2012-12-03 Thread David Winsemius
On Dec 3, 2012, at 1:40 PM, Troy S wrote: Dear UseRs, I'm running a chi-squared test where the expected matrix is the same as the observed, after rounding. ... after rounding you say? R reports a X-squared of zero with a p value of one. I can justify this because any other result

Re: [R] How to rename the columns of as.table

2012-12-03 Thread Hard Core
Thanks man ... perfect ... thank you very much ;) you are the best -- View this message in context: http://r.789695.n4.nabble.com/How-to-rename-the-columns-of-as-table-tp4651806p4651966.html Sent from the R help mailing list archive at Nabble.com.

[R] Histogram plot help

2012-12-03 Thread YAddo
Dear All: I plotted a histogram with Abline, clipping with color codes but i run into some problems. The abline' does not show up at all, and when i request the 'prob=True' (to obtain the freqs), my clipped region colors the section of the graph instead of the plot only. Is there any way i

Re: [R] How to read SPSS file in R

2012-12-03 Thread Mark Lamias
The following works just fine for me, using the built-in SPSS dataset nhis2000_subset.sav.  library(foreign) a=read.spss(C:\\Program Files\\IBM\\SPSS\\Statistics\\21\\Samples\\English\\nhis2000_subset.sav, to.data.frame=T)  names(a)  [1] STRATUM  PSU  WTFA_SA  SEX  AGE_P    REGION  

Re: [R] .Rd vs. .R, matrix multiplication

2012-12-03 Thread Duncan Murdoch
On 12-12-03 5:00 PM, Christian Hoffmann wrote: Hi, I find it cumbersomesome the I have to use \%*\% in .Rd files vs. %*% in .R files. R CMD check will refuse %*% in .Rd files. I would like to have %*% in .Rd files to be able to execute expressions with matrix multiplication from .Rd files

  1   2   >