Re: [R] R-help Digest, Vol 154, Issue 1

2015-12-01 Thread 13351275265
I have the same question about the following strings: sub("^([0-9]*).*$", "\\1", fields) could you explain them in detail . I would lookforward to yourwonderful reply. 2015-12-01 13351275265 发件人:r-help-requ...@r-project.org 发送时间:2015-12-01 19:00 主题:R-help Digest, Vol

Re: [R] Function calling a function, column name not passed properly

2015-12-01 Thread David Winsemius
> On Dec 1, 2015, at 2:57 PM, John Sorkin wrote: > > I am trying to write a function that calls a function. The first call to > SmallFn works without any problem, printing both the passed data and the > column Wstscr. The second call does not work (error, Error in

Re: [R] Function calling a function, column name not passed properly

2015-12-01 Thread David Winsemius
> On Dec 1, 2015, at 4:32 PM, David Winsemius wrote: > > >> On Dec 1, 2015, at 2:57 PM, John Sorkin wrote: >> >> I am trying to write a function that calls a function. The first call to >> SmallFn works without any problem, printing both

[R] Function calling a function, column name not passed properly

2015-12-01 Thread John Sorkin
I am trying to write a function that calls a function. The first call to SmallFn works without any problem, printing both the passed data and the column Wstscr. The second call does not work (error, Error in d[, column] : subscript out of bounds). The first call shows what I am trying to do

Re: [R] What URL do I go to manage my subscription to the list? Please respond directly to me, not to this list!!!!

2015-12-01 Thread Sarah Goslee
On Tue, Dec 1, 2015 at 9:17 PM, John Sorkin wrote: > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide

[R] Function calling a function, column name not passed properly

2015-12-01 Thread John Sorkin
David has told me that my problem is because there is not column varscr in my dataframe. I know this. My question is how can I modify my code so that the second call to SmallFn will in fact access the column Wstscr which does, in fact exist in the dataframe. John Messages sorted by: [ date ] [

Re: [R] Function calling a function, column name not passed properly

2015-12-01 Thread William Dunlap
The short answer is to provide an argument that your function does not pass through substitute(), so standard evaluation takes place. E.g., change SmallFn <- function(v,d) { column <- deparse(substitute(v)) d[,column] } to SmallFn <- function(v, d,

[R] What URL do I go to manage my subscription to the list? Please respond directly to me, not to this list!!!!

2015-12-01 Thread John Sorkin
John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119

[R] What URL do I go to manage my subscription to the r-help? Please respond directly to me, not to this list!!!!

2015-12-01 Thread John Sorkin
Please respond directly to me jsor...@grecc.umaryland.edu. If you respond to the list I will not get your response. There is a problem with my subscription. It has been changed to digest. I need to set it back to no digest (i.e. get messages as soon as they are posted) John John David Sorkin

[R] Coding your Secret Santa in R!

2015-12-01 Thread Bastien.Ferland-Raymond
Hello Everyone! Christmas is coming and with it, gift exchange! Every year, with my family, we draw names from a hat to decide who gives a gift to who. Very basic and annoying method, as it doesn't prevent somebody to draw himself, to draw his/her partner, to draw years after years the same

Re: [R] grep/regexp

2015-12-01 Thread David Winsemius
> On Dec 1, 2015, at 2:47 PM, Ravi Varadhan wrote: > > Hi, > I would appreciate some help with using grep(). I have a bunch of variables > in a data frame and I would like to select some of them using grep. Here is > an example of what I am trying to do: > > vars <-

Re: [R] Fwd: Converting a matrix to an mcmc object

2015-12-01 Thread Uwe Ligges
If you have a matrix X and you want an mcmc.list object for 3 chains: as.mcmc.list(lapply(as.data.frame(X), mcmc)) is one way. Best, Uwe Ligges On 02.12.2015 03:47, Margaret Donald wrote: -- Forwarded message -- From: Margaret Donald Date: 1

Re: [R] problem with creating a file path using paste0

2015-12-01 Thread Uwe Ligges
On 02.12.2015 05:01, Carl Sutton via R-help wrote: I am relatively new to programming in R. I have attempted to create a function to replace brute force code, and in doing so need to create a data path and file name via paste0 (The years and quarter subfolders are different for different

Re: [R] What URL do I go to manage my subscription to the r-help? Please respond directly to me, not to this list!!!!

2015-12-01 Thread David Winsemius
> On Dec 1, 2015, at 6:24 PM, John Sorkin wrote: > > Please respond directly to me jsor...@grecc.umaryland.edu. I generally respond to both the poster and the list. > If you respond to the list I will not get your response. There is a problem > with my

Re: [R] problem with creating a file path using paste0

2015-12-01 Thread David Winsemius
> On Dec 1, 2015, at 8:01 PM, Carl Sutton via R-help > wrote: > > I am relatively new to programming in R. > I have attempted to create a function to replace brute force code, and in > doing so need to create a data path and file name via paste0 (The years and >

Re: [R] Passing variable names in quotes to a function

2015-12-01 Thread Uwe Ligges
On 02.12.2015 06:11, Brant Inman wrote: I am trying to build a function that can accept variables for a regression. It would work something like this: --- # Y = my response variable (e.g. income) # X = my key predictor variable (e.g. education) # subY = a subsetting variable for Y (e.g.

[R-es] R Versión 1.8.1

2015-12-01 Thread Fernanda Arce
Estimados!!! Necesito R- 1.8.1! Descargue el instalador pero me arroja un error! El cual dice que el archivo fue corrompido! ¿Saben como puedo solucionarlos? O ¿Dónde puedo descargar el instalador de esa versión? Muchas gracias! Saludos ¡ Enviado desde Correo para Windows 10

[R] problem with creating a file path using paste0

2015-12-01 Thread Carl Sutton via R-help
I am relatively new to programming in R.   I have attempted to create a function to replace brute force code, and in doing so need to create a data path and file name via paste0 (The years and quarter subfolders are different for different years and quarters).   It file path  created from

[R] grep/regexp

2015-12-01 Thread Ravi Varadhan
Hi, I would appreciate some help with using grep(). I have a bunch of variables in a data frame and I would like to select some of them using grep. Here is an example of what I am trying to do: vars <- c("Fr_I_total", "Fr_I_percent_of_CD4", "Ki.67_in_Fr_I_percent_of_Fr_I",

[R] Fwd: Converting a matrix to an mcmc object

2015-12-01 Thread Margaret Donald
-- Forwarded message -- From: Margaret Donald Date: 1 December 2015 at 23:09 Subject: Re: [R] Converting a matrix to an mcmc object To: Jim Lemon Thanks, Jim. It may well do, but I am struggling to see how to coerce a matrix

[R] Passing variable names in quotes to a function

2015-12-01 Thread Brant Inman
I am trying to build a function that can accept variables for a regression. It would work something like this: --- # Y = my response variable (e.g. income) # X = my key predictor variable (e.g. education) # subY = a subsetting variable for Y (e.g. race) # subY.val = the value of the subsetting

[R] cummeRbund MDSplot errors

2015-12-01 Thread Bei Jun Chen
Dear R mailing list members, I was trying to make MDS plots using cummeRbund package on cuffdiff output files, but got some error messages instead. I would really appreciate it if you could advise me on how to solve the problem. I am running Ubuntu 15.10, R version 3.2.2, cummeRbund

[R] disparate data collections and resolutions in a GAM

2015-12-01 Thread Ateljevich, Eli@DWR
Hi, I have point values of elevations on land (high resolution lidar) and in the water (some are lower resolution single beam soundings or even just prior elevation maps, others are high res multibeam). Let's say high resolution is 1m and low is 10m, although the coarse case can be worse.

Re: [R] cummeRbund MDSplot errors

2015-12-01 Thread Bert Gunter
This is a Bioconductor package. So I think you would do better to post on the Bioconductor list, not here. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Tue, Dec 1, 2015 at 6:27 AM, Bei Jun Chen

Re: [R] disparate data collections and resolutions in a GAM

2015-12-01 Thread Bert Gunter
This is a general purpose R programming help list. Your post appears to be a very specific, subject matter question that should go to the R-Sig-geo list, where you are likely to get better and prompter responses. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge.

Re: [R] filled circle with a black line on the rim in pch function

2015-12-01 Thread Jim Lemon
Hi Christine, When I try to run your script, the plot fails: Error in eval(expr, envir, enclos) : object 'culr' not found > names(Raw) [1] "Date""Year""Station" "Abun""Date1" so I changed the second line to: groups=Year, and it did work. The default (pink, gray) background colors

[R] 回覆︰ filled circle with a black line on the rim in pch function

2015-12-01 Thread Christine Lee via R-help
Sorry all, My mistake!  The missing parts are as follows:  Raw$Date1<-as.Date(Raw$Date,"%d/%m") culr<-ifelse(Raw$Year=="Y2002","Year 2002","Year 2014") library(lattice) Many thanks.   With best regards,Christine Jim Lemon 於 2015年12月1日 (週二) 4:01 PM 寫道﹕ Hi

Re: [R] Graphing a subset of data

2015-12-01 Thread Jim Lemon
Hi Alexandra, I think you are going about this in an excessively difficult way. Here is a rough example: graphit<-function(x,var,type,subset=NA,...){ if(!is.na(subset[1])) x<-subset(x,subset) do.call(type,list(x=x[[var]],...)) } # assume that the data are measurements of penetration by crossbow

[R] Metanalysis in R using MAVIS

2015-12-01 Thread Ernesto Villarino
I am Ernesto, a Phd student from Bilbao working with climate related plankton dynamics. I am trying to perform a MAVIS metanalysis (any other meta techcnique to be applied in R) to see if there is a significant difference between the moderators in my dataset. Is there any option to do an ANOVA

Re: [R] Graphing the Area of Definite Integral

2015-12-01 Thread Steven Stoline
Dear Bill: It looks great. many thanks *one more quick help:* how to graph only the x and y axis crossing through the origin, with xlim=c(-1,1,0.2) and ylim=c(0,1,0.2)? with many thanks steve On Sat, Nov 28, 2015 at 1:11 PM, William Dunlap wrote: > Your right <-

Re: [R] Metanalysis in R using MAVIS

2015-12-01 Thread Michael Dewey
Dear Ernesto As far as I understand it MAVIS is an application which uses metafor to perform the actual meta-analysis. I do not use MAVIS but if it gives you access to the full range of metafor facilities then you have a range of options with moderators. If MAVIS does not expose all of

Re: [R] convert.snp.ped in GenAbel

2015-12-01 Thread Michael Dewey
Dear Aoife I do not know the insides of GenABEL but it may be looking for the map file first so in fact may not be able to find the ped file either. 1 - Are you sure the files are named as you state? 2 - Are you sure they are placed in ~ which seems an unlikely place to put them. On

[R] convert.snp.ped in GenAbel

2015-12-01 Thread aoife doherty
Having a problem with convert.snp.ped in GenABEL (on linux). My map file looks like this (tab-separated) (called Genotype.map) chrom name position 13 SNP1 39703523 My ped file looks like this (Called Genotype.ped) PF1 PF1 0 0 2 -9 C C PF2 PF2 0 0 2 -9 C A PF3 PF3 0 0 1 -9 C C PF4 PF4

Re: [R] Graphing a subset of data

2015-12-01 Thread S Ellison
> graphit<-function(x,var,type,subset=NA,...){ > if(!is.na(subset[1])) x<-subset(x,subset) > do.call(type,list(x=x[[var]],...)) > } A further slight simplification is possible using the fact that subset(x, TRUE) returns x unchanged: graphit<-function(x,var,type,subset=TRUE,...){

Re: [R] filled circle with a black line on the rim in pch function

2015-12-01 Thread Duncan Mackay
This seems to get the colours for the legend correctly xyplot(Abun~Date1|Station, data=Raw, groups = Year, par.settings = list(strip.background = list(col = "transparent"), superpose.symbol = list(pch = rep(21,2),