[R] Count data with several numbers separated by commas

2009-04-16 Thread Xiyan Lon
Dear all, I have a data file with 3 variables (x1, x2, x3) where variable x1 have data that consists of several numbers separated by commas. id name x1 x2x3 aa1011,4,52 1 aa1021,2,51 2 aa1031,2,51 1 aa1041,2,31 2 aa1051,5 2 2

Re: [R] Sweave and executive summaries

2009-04-16 Thread Dieter Menne
Karen_Byron at bd.com writes: I'm learning to use R/Sweave/LaTeK to write my stat reports. Is there a way to have an executive summary in the beginning while still having the analysis code embedded? Thanks to Ulrich Dietz from the German latex forum, I have an excellent

Re: [R] Genstat into R - Randomisation test

2009-04-16 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
Robert, Tom, Peter and all, If I remember correctly (don't have my copy at hand right now), Edgington and Onghena differentiate between randomization tests and permutation tests along the following lines: Randomization test: Apply only to randomized experiments, for which we consider the

Re: [R] Count data with several numbers separated by commas

2009-04-16 Thread Simon Blomberg
Here's a solution, though it may be overcomplicated. I assume the data frame is called dat: vec - unlist(lapply(strsplit(dat$x1, ,), function (x) summary(as.factor(x table(names(vec)) 1 2 3 4 5 9 6 2 2 8 Cheers, Simon. On Thu, 2009-04-16 at 13:03 +0700, Xiyan Lon wrote: Dear all, I

[R] Problem with a defined function which cannot access a function defined outside of the function

2009-04-16 Thread unbekannt
hi everyone, i have a problem with a function that i defined: the function needs to use a function which is defined outside the function but i realised that this is not working. a friend told me that this must be a problem with hidden parameters. a workaround works when i just define

Re: [R] Count data with several numbers separated by commas

2009-04-16 Thread Bill.Venables
It rather depends on how you have your data stored. Here is one possibility you might want to look at: con - textConnection( + id_name x1 x2 x3 + aa101 1,4,5 2 1 + aa102 1,2,5 1 2 + aa103 1,2,5 1 1 + aa104 1,2,3 1 2 + aa105 1,5 2 2 + aa106 1,2,5 2 2 + aa107 1,2,5 2 1 +

Re: [R] How to Reshuffle a distance object

2009-04-16 Thread Gavin Simpson
Dale Steele wrote: I would like to randomly shuffle a distance object, such as the one created by ade4{dist.binary} below. My first attempt, using sample(jc.dist) creates a shuffled vector, losing the lower triangular structure of the distance object. How can I Ishuffle the lower triangular

[R] Igraph: family 'serif' not included in PostScript device

2009-04-16 Thread Knut Krueger
Does anybody know how to solve this error? postscript(file= file.ps, family = Helvetica, font = Helvetica) plot.igraph(g, layout=layout.circle, vertex.label.font=2) dev.off() error in text.default(x, y, labels = labels, col = label.color, family = label.family, : family 'serif' not included

Re: [R] Problem with a defined function which cannot access a function defined outside of the function

2009-04-16 Thread Richard . Cotton
i have a problem with a function that i defined: the function needs to use a function which is defined outside the function but i realised that this is not working. a friend told me that this must be a problem with hidden parameters. a workaround works when i just define all

[R] Problems with adabag

2009-04-16 Thread Antonio J. Saez-Castillo
Hello, I'm trying to use adabag to make bagging and boosting with bagging() and adabost.M1(), respectively, but in both cases it produces an abnormal termination of R. My code is: bagging(I.NOSOCO~EDAD+SEXO+ESTANCIA+ADMISIÓN+T.CIRUGÍ+DURACIÓN+CONTAMIN

Re: [R] Igraph: family 'serif' not included in PostScript device

2009-04-16 Thread Gábor Csárdi
Knut, see this thread here: http://lists.gnu.org/archive/html/igraph-help/2007-07/msg00010.html Best, Gabor On Thu, Apr 16, 2009 at 10:03 AM, Knut Krueger r...@krueger-family.de wrote: Does anybody know how to solve this error? postscript(file= file.ps, family = Helvetica, font = Helvetica)

[R] (senza oggetto)

2009-04-16 Thread giuseppef...@libero.it
Dear all, I have a database x,y,value imported in R with read.table: dati- read.table(dati.dat) value is a categorical data (land use) and i want to plot in the same colour the same land use. It is possible with R. Thanks a lot __

Re: [R] (senza oggetto)

2009-04-16 Thread Heinz Tuechler
At 11:10 16.04.2009, giuseppef...@libero.it wrote: Dear all, I have a database x,y,value imported in R with read.table: dati- read.table(dati.dat) value is a categorical data (land use) and i want to plot in the same colour the same land use. It is possible with R. Thanks a lot

[R] pooled mean

2009-04-16 Thread Eleni Rapsomaniki
Dear R users, Is there an R function to compute the pooled mean? Many Thanks Eleni Rapsomaniki  __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] performing function on data frame

2009-04-16 Thread ONKELINX, Thierry
Dear karin, Try rescaler from the reshape package: install.packages(reshape) library(reshape) newDF - apply(oldDF, 2, rescaler, type = sd) HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek /

Re: [R] shift/lag when merge zoo

2009-04-16 Thread Achim Zeileis
On Wed, 15 Apr 2009, j.k wrote: Hello alltogheter, I have a little problem regarding merging to zoo series. I want to merge two zoo series to reduce the timegaps between the stamps. I use the following code: data.test -

Re: [R] performing function on data frame

2009-04-16 Thread Karin Lagesen
David Hajage dhajag...@gmail.com writes: Hi Karin, I'm not sure I understand... Is this what you want ? d$y - mean(d$y)/sd(d$y) Yes, and also a bit no. Each column in my data frame represents one data set. For every element in this data set I want to know the z value for that element.

[R] segment between points on different plots

2009-04-16 Thread rajesh j
Hi, I need to draw a line segment between two points on different plots in the same multigraph.I've tried looking at the zoominplot function in plotrix but havent understood much.any help is appreciated ~Aks [[alternative HTML version deleted]]

Re: [R] segment between points on different plots

2009-04-16 Thread baptiste auguie
Hi, You should give a minimal reproducible example so that we know more precisely what you want to do (what's a multigraph?). Perhaps you can get inspiration from Paul Murrell's R graphics book, in particular Figure 5.22,

Re: [R] performing function on data frame

2009-04-16 Thread Mike Lawrence
As Michael notes, scale is what you want. Also, your request has an incorrect definition of z scores: d$y - mean(d$y)/sd(d$y) #incorrect (d$y - mean(d$y) ) / sd(d$y) #correct On Thu, Apr 16, 2009 at 7:40 AM, Michael Conklin michael.conk...@markettools.com wrote:

Re: [R] performing function on data frame

2009-04-16 Thread Michael Conklin
newDF-as.data.frame(scale(oldDF)) see ?scale Hope that helps. Michael Conklin -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Karin Lagesen Sent: Thursday, April 16, 2009 5:29 AM To: r-help@r-project.org Subject: Re: [R]

Re: [R] segment between points on different plots

2009-04-16 Thread baptiste auguie
Here's an example adapted from ?grid.arrows pushViewport(viewport(layout=grid.layout(1, 2))) pushViewport(viewport(layout.pos.col=1, layout.pos.row=1)) grid.rect(gp=gpar(col=grey)) grid.points() grid.points(x=0.5, y=0.5, gp=gpar(col=red)) popViewport()

Re: [R] Kruskal's MDS results

2009-04-16 Thread Bob Green
Dieter, You could always try the Classification, clustering, and phylogeny estimation list which often includes posts regarding MDS: http://lists.sunysb.edu/index.cgi?A0=CLASS-L regards Bob __ R-help@r-project.org mailing list

Re: [R] clustering, don't understand this error

2009-04-16 Thread Christian Hennig
Hi there, I'm travelling right now so I can't really check this but it seems that the problem is that cluster.stats needs a partition as input. hclust doesn't give you a partition but you can generate one from it using cutree. BTW, rather use - than =. Best wishes, Christian On Wed, 15

Re: [R] Kruskal's MDS results

2009-04-16 Thread stephen sefick
You can look in MASS 4 for this formula on page 308 . Go to the source and ask the horse he'll give you an answer that you endorse. On Thu, Apr 16, 2009 at 8:13 AM, Bob Green bgr...@dyson.brisnet.org.au wrote: Dieter, You could always try the Classification, clustering, and phylogeny

[R] static variable?

2009-04-16 Thread ivo welch
dear R experts: does R have static variables that are local to functions? I know that they are usually better avoided (although they are better than globals). However, I would like to have a function print how often it was invoked when it is invoked, or at least print its name only once to

Re: [R] static variable?

2009-04-16 Thread Duncan Murdoch
On 4/16/2009 8:46 AM, ivo welch wrote: dear R experts: does R have static variables that are local to functions? I know that they are usually better avoided (although they are better than globals). You put such things in the environment of the function. If you don't want them to be

Re: [R] static variable?

2009-04-16 Thread jim holtman
You can use 'local' counter() # create a function with a 'local static' variable counter - local({ + i - 0 + function() { + i - i + 1 + i + } + }) counter() [1] 1 counter() [1] 2 i - 42 # change 'i' at this level counter() # has not effect on the 'counter' i

[R] Find common Markers for all animals in data frame

2009-04-16 Thread joe1985
Hello I have a data frame looking like this; head(SNP2) AnimalMarker All1 All2 x 3213 194073197 P1001222 1295 194073197 P1002121 0915 194073197 P1004222 2833 194073197 P1005110 1487 194073197 P1006222 1885

Re: [R] shift/lag when merge zoo

2009-04-16 Thread j.k
Worked perfect... Thanks a lot! Johannes j.k wrote: Hello alltogheter, I have a little problem regarding merging to zoo series. I want to merge two zoo series to reduce the timegaps between the stamps. I use the following code: data.test -

[R] Graphics help

2009-04-16 Thread Liz Webb
Hi, I would like to draw a graph as follows: A simplified example is that on the X axis are different countries, I have several temperature measurements taken from each country and would like to plot these linearly above each country. So one would imagine that cold countries would have lots

[R] changing Swaeve output settings for .pdf and .eps - is there a way?

2009-04-16 Thread Mark Heckmann
Is there a way to change the default settings for Sweave figure output? Sweave produces an .eps and a .pdf file as output (7x7 inch). Changing pdf defaults changes the pdf() function output size but does not affect the pdf size produced by Sweave. pdf.options(height=3) pdf(myfile.pdf)

[R] F test

2009-04-16 Thread kayj
Hi, How can I find the p-value for the F test for the interaction terms in a regression linear model lm ? I appreciate your help -- View this message in context: http://www.nabble.com/F-test-tp23078122p23078122.html Sent from the R help mailing list archive at Nabble.com.

[R] splitting vector into equal sets

2009-04-16 Thread utkarshsinghal
Hi R, I have explored R archives a lot but couldn't find an efficient way of doing the following: I want to split a vector into sets of equal sizes. Is there any inbuilt function of doing so with the option of specifying how to treat the remaining observations. For example: suppose I want

[R] get() versus getAnywhere()

2009-04-16 Thread Benjamin Tyner
Hi Using R 2.8.1. I have list object called AuxData. Inside a browser(), get(AuxData) succeeds, while getAnywhere(AuxData) fails with the error no object named âAuxDataâ was found. I'm curious to know if this could be a bug. If yes, I'll try to come up with a reproducible example.

Re: [R] From daily series to monthly and viceversa

2009-04-16 Thread manta
Ok, I'll try to explain my issue. I have a monthly series (CPI index) and I want to interpolate it using a specific lagged harmonized formula to get the corresponding daily series. The formula is the following CPI^=CPI(t-3)+(d-1)/D*(CPI(t-2)-CPI(t-3)) where CPI^ is the CPI for the day we are

[R] weird error with contourplot

2009-04-16 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
Sorry if I am cluttering up this list with too many rank beginner questions. But I *am* a rank beginner, and I am at my wit's end with this one: I have a data frame df, with components x,y,z. This command to make a contour plot with lattice graphics works just fine:

[R] Plotting C++ output in R

2009-04-16 Thread Andrew.Cox
Hi, Using R 2.8.0 on Windows, I have a mathematical model written in C++, the model writes to file (.txt) a set of numbers I want to plot in R. The model iterates over about 10,000 runs, each time overwriting the old with the new set of results to the output file. I want to be able to

Re: [R] get() versus getAnywhere()

2009-04-16 Thread Duncan Murdoch
On 4/16/2009 9:52 AM, Benjamin Tyner wrote: Hi Using R 2.8.1. I have list object called AuxData. Inside a browser(), get(AuxData) succeeds, while getAnywhere(AuxData) fails with the error no object named âAuxDataâ was found. I'm curious to know if this could be a bug. If yes, I'll

Re: [R] Graphics help

2009-04-16 Thread Johannes Hüsing
Liz Webb schrieb: Hi, I would like to draw a graph as follows: A simplified example is that on the X axis are different countries, I have several temperature measurements taken from each country and would like to plot these linearly above each country. So one would imagine that cold countries

[R] weird error with contourplot

2009-04-16 Thread Cable, Samuel B Civ USAF AFMC AFRL/RVBXI
Call off the dogs. The problem was that because of the scale of my data (1) contourplot somehow can't handle labeling the contours if it paints the plot region as well. I can easily get around this by re-scaling the data. But, if anyone can explain to me why throwing the region=T flag makes a

[R] Howto build combinations of colums of a data frame

2009-04-16 Thread Juergen Rose
Hi, as a R-newcomer I would like to create some new data frames from a given data frame. The first new data frame should content all pairs of the columns of the original data frame. The second new data frame should content all tripels of of the columns of the original data frame and the last the

[R] there are fontencoding problem in Sweave

2009-04-16 Thread Угодай n/a
I want write article by russian language using Sweave. For cyrillic text LaTeX use T2A encoding \usepackage[T2A]{fontenc} But in Sweave.sty we find: \RequirePackage[T1]{fontenc} It is source of critical problem. For example Rnw file $ cat estimation.Rnw \documentclass[A4paper]{article}

[R] Reading in a large number of dbf files

2009-04-16 Thread Steve_Friedman
good morning This question is not a stats question per say but a data management and lattice plotting problem. I apologize now if I'm asking an inappropriate question to this gracious group. I'm need to bring in approximately 100 *.dbf files into R but I'm having difficultly understanding

[R] Help- extracting values

2009-04-16 Thread Amit Patel
I have csv files imported in r each with 2 columns and many many rows. I have sorted the data in them but want to extract some values. The first column is an ID The second is a p-value ( now sorted in increasing order with NA's last) I want to extract the rows with a p-value of less than 0.05)

[R] Creating a list of database names for merge.rec

2009-04-16 Thread Andy Barenberg
hello, I am trying to merge a large number of datasets into one using merge.rec. merge.rec(db, by.x = X, by.y = Y) where db is my list of datasets. My problem is trying to create a code to create the list db for all the files without missing data: Currently my code looks like:

[R] points geodata {geoR}

2009-04-16 Thread giuseppef...@libero.it
I used points graphic (geoR) in this way: points(zn,pt.divide=c(quintiles), main=Location map of Zn,lambda=1,col=gray,yl=coord y,xl=coord x,x.leg=0. 3, y.leg=5.5,dig.leg=2,cex.min=0.5,cex.max=1,) Can I reduce legend characters (a sort of cex)? __

Re: [R] weird error with contourplot

2009-04-16 Thread Don MacQueen
Looking at ?contourplot, it would appear it should be ok to set region=TRUE. So this is a case of time to explore. Have you tried levelplot instead of contourplot? The default for levelplot is region=TRUE, vs region=FALSE for contourplot. If levelplot also fails, that tells you something

Re: [R] Howto build combinations of colums of a data frame

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 10:14 AM, Juergen Rose wrote: Hi, as a R-newcomer I would like to create some new data frames from a given data frame. The first new data frame should content all pairs of the columns of the original data frame. The second new data frame should content all tripels of of

[R] Odp: splitting vector into equal sets

2009-04-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.04.2009 15:23:15: Hi R, I have explored R archives a lot but couldn't find an efficient way of doing the following: I want to split a vector into sets of equal sizes. Is there any inbuilt function of doing so with the option of specifying

Re: [R] Creating a list of database names for merge.rec

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 10:41 AM, Andy Barenberg wrote: hello, I am trying to merge a large number of datasets into one using merge.rec. merge.rec(db, by.x = X, by.y = Y) where db is my list of datasets. My problem is trying to create a code to create the list db for all the files without

[R] Odp: Help- extracting values

2009-04-16 Thread Petr PIKAL
Petr Pikal petr.pi...@precheza.cz 724008364, 581252140, 581252257 r-help-boun...@r-project.org napsal dne 16.04.2009 16:45:15: I have csv files imported in r each with 2 columns and many many rows. I have sorted the data in them but want to extract some values. The first column is an

Re: [R] Help- extracting values

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 10:45 AM, Amit Patel wrote: I have csv files imported in r each with 2 columns and many many rows. I have sorted the data in them but want to extract some values. The first column is an ID The second is a p-value ( now sorted in increasing order with NA's last) I

Re: [R] Help- extracting values

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 11:10 AM, David Winsemius wrote: On Apr 16, 2009, at 10:45 AM, Amit Patel wrote: I have csv files imported in r each with 2 columns and many many rows. I have sorted the data in them but want to extract some values. The first column is an ID The second is a p-value

[R] error bars in matplot

2009-04-16 Thread Tim Smith
Hi, I was trying to get error bars in my matplot. I looked at an earlier thread, and the sample code that I made is: #-- library(plotrix) mat1 - matrix(sample(1:30,10),nrow=5,ncol=2) ses - matrix(sample(1:3,10,replace=T),nrow=5,ncol=2) vect - seq(20,100,20) rownames(mat1) -

Re: [R] Odp: splitting vector into equal sets

2009-04-16 Thread utkarshsinghal
__ 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] there are fontencoding problem in Sweave

2009-04-16 Thread Duncan Murdoch
On 4/16/2009 10:29 AM, Угодай n/a wrote: I want write article by russian language using Sweave. For cyrillic text LaTeX use T2A encoding \usepackage[T2A]{fontenc} But in Sweave.sty we find: \RequirePackage[T1]{fontenc} It is source of critical problem. For example Rnw file $ cat

Re: [R] Reading in a large number of dbf files

2009-04-16 Thread jim holtman
A process like the following is how I would do it: inputData - lapply(listOfFiles, function(.file){ input - read.table(.file, whatever other parameters...) # now do the modifications that you need input # return the updated dataframe }) # combine into one dataframe

Re: [R] Equivalent to Stata egen

2009-04-16 Thread Stas Kolenikov
http://www.stata.com/help.cgi?egen -- it creates new variables dealing with some special relatively non-standard tasks that don't boil down to a one-line arithmetic expressions. For that reason, there will be no equivalent to -egen- in general, as it has so many functions that are so different.

[R] manipulating data via the factors of a term in a lm()

2009-04-16 Thread Michael Friendly
[Env: R 2.8.1, Win XP] For a package I'm working on, I need two small helper functions to manipulate the data used in an lm or mlm object, given the *name* of a term, which will always be a character string representing a factor (A) or an interaction of two or more factors (A:B, A:B:C, ...).

[R] Digitizing the Plot

2009-04-16 Thread Shubha Vishwanath Karanth
Hi R, Wanted to check if there are any packages available for getting the (x,y) data points of a graph or a plot, which is in the image format. Say, the plot could be a published report, and I want to get the points of the curve plotted. (I am speaking something related the subject discussed

[R] Lin Model with interactions

2009-04-16 Thread Marian Thieme
Hi all, I have a question about linear model with interaction: I created a data frame df like this: df V1 V2 V3 V4 V5 1 6.414094 c t a g 2 6.117286 t a g t 3 5.756922 a g t g 4 6.090402 g t g t ... which holds the response in the first column and letters (a,c,g,t) in

[R] Survreg/psm output

2009-04-16 Thread Laura Bonnett
Dear R-listers, I know that there have been many, many posts on the output from Survreg. To summarise what I have read, Scale is 1/shape of the Weibull which is also the standard deviation of the normal distribution which is also the standard deviation of the log survival time and Intercept is

Re: [R] Howto build combinations of colums of a data frame

2009-04-16 Thread Juergen Rose
Am Donnerstag, den 16.04.2009, 10:59 -0400 schrieb David Winsemius: Thanks David, is there also a shorter way to get the columns names of the new data frames? Juergen On Apr 16, 2009, at 10:14 AM, Juergen Rose wrote: Hi, as a R-newcomer I would like to create some new data frames from

Re: [R] Howto build combinations of colums of a data frame

2009-04-16 Thread baptiste auguie
Perhaps, apply(combn(letters[1:4],2), 2, paste,collapse=) Hope this helps, baptiste On 16 Apr 2009, at 17:33, Juergen Rose wrote: Am Donnerstag, den 16.04.2009, 10:59 -0400 schrieb David Winsemius: Thanks David, is there also a shorter way to get the columns names of the new data frames?

Re: [R] Digitizing the Plot

2009-04-16 Thread Philipp Pagel
Hi! Wanted to check if there are any packages available for getting the (x,y) data points of a graph or a plot, which is in the image format. Say, the plot could be a published report, and I want to get the points of the curve plotted. (I am speaking something related the subject

Re: [R] Digitizing the Plot

2009-04-16 Thread baptiste auguie
The grImport package seems to provide such possibility for vector graphics, http://www.stat.auckland.ac.nz/~paul/Talks/gddg.pdf imageJ is another open-source option. baptiste On 16 Apr 2009, at 16:44, Shubha Vishwanath Karanth wrote: Hi R, Wanted to check if there are any packages

Re: [R] Howto build combinations of colums of a data frame

2009-04-16 Thread Juergen Rose
Am Donnerstag, den 16.04.2009, 17:41 +0100 schrieb baptiste auguie: Perhaps, apply(combn(letters[1:4],2), 2, paste,collapse=) Hope this helps, Thanks Babtiste, I use now: Lines - abcd 13 015 16 2324250 3334 0 36 044

Re: [R] F test

2009-04-16 Thread Mike Lawrence
summary(my_lm) will give you t-values, anova(my_lm) will give you (equivalent) F-values. summary() might be preferred because it also provides the estimates SE. a=data.frame(dv=rnorm(10),iv1=rnorm(10),iv2=rnorm(10)) my_lm=lm(dv~iv1*iv2,a) summary(my_lm) Call: lm(formula = dv ~ iv1 * iv2,

Re: [R] Extending a vector to length n

2009-04-16 Thread Raubertas, Richard
The following approach works for both of your examples: xx - rep(x, length.out=n) xx[m:n] - NA Thus: n - 2 aa - rep(a, length.out=n) aa[(length(a)+1):n] - NA aa [1] 2008-01-01 NA bb - rep(b, length.out=n) bb[(length(b)+1):n] - NA bb [1] aNA Levels: a R. Raubertas Merck

Re: [R] Howto build combinations of colums of a data frame

2009-04-16 Thread David Winsemius
Those are not actually dataframes. They are matrices. If you want to make them into dataframes, use a coercive function. The names can be generated from the original column names using the same construction as the column creation: apply(combn(colnames(DF),2), 2, paste, collapse=*) [1] a*b

Re: [R] segment between points on different plots

2009-04-16 Thread Greg Snow
The help page for the cnvrt.coords function in the TeachingDemos package shows some examples of drawing lines/rectangles between multiple graphs created using par(mfrow=c(... This function and the examples were written before the grconvertX and grconvertY functions, so use the example for the

[R] Presenting R Results in Webpages

2009-04-16 Thread Jason Rupert
I apologize in advance that this question is not specific to R, but I thought some R users may be using this in their work process flow. I would like to be able to have a tool (prefer scriptable) that will take two images and some pre-written text and put it on an simple webpage. That is,

[R] Asking help for finding the highest density region

2009-04-16 Thread CheXiaohong
I am using the package hdrcde to get the highest density region. I have the data from an unknown distribution. And I used the subroutine hdr from the package to get the highest density region. But I always got a error message. I do not know why. Who can help?Thanks! The codes look like this:

Re: [R] Equivalent to Stata egen

2009-04-16 Thread David Winsemius
Terse is OK by me as long as I get told what goes in (allowable data types, argument names and effects) and what comes out. What seemed to be lacking in that Stata doc for egen was a description of the purpose or behavior and then could find no description of the values produced. Perhaps

Re: [R] Presenting R Results in Webpages

2009-04-16 Thread Tobias Verbeke
Hi Jason, I apologize in advance that this question is not specific to R, but I thought some R users may be using this in their work process flow. I would like to be able to have a tool (prefer scriptable) that will take two images and some pre-written text and put it on an simple webpage.

Re: [R] Extending a vector to length n

2009-04-16 Thread hadley wickham
Great idea - that's a little faster than my previous approach of setting length() and then re-adding the attributes. Thanks! Hadley On Thu, Apr 16, 2009 at 12:16 PM, Raubertas, Richard richard_rauber...@merck.com wrote: The following approach works for both of your examples: xx - rep(x,

[R] map of china without regions

2009-04-16 Thread Cuvelier Etienne
Hello, I use the map package in conjunction with the mapdata package, and I want to draw the map of China without interior regions. After reading the doc and searched in this mailing list I've tried map(china,interior=FALSE) and map(china,fill=TRUE) but I allways see the interior regions... If

Re: [R] F test

2009-04-16 Thread Jun Shen
Mike, I kind of have the same question. What if for a mixed effect model, say using lme(), how to specify the interaction effect (between a fixed effect and a random effect)? and where to find the result of the interaction? Thanks. Jun On Thu, Apr 16, 2009 at 12:08 PM, Mike Lawrence

Re: [R] Split string

2009-04-16 Thread Gabor Grothendieck
On Thu, Apr 16, 2009 at 2:01 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Gabor Grothendieck wrote: Using string from another responder's post here are two solutions: Er, a rather more obvious solution could be to point to the definition of substr... Only if there are a fixed number

Re: [R] Split string

2009-04-16 Thread Peter Dalgaard
Gabor Grothendieck wrote: Using string from another responder's post here are two solutions: Er, a rather more obvious solution could be to point to the definition of substr... 1. The first converts to numeric and manipulates that: [snip] [37] 0.30 NA 0.30 0.30 0.30 0.30 NA NA

Re: [R] Asking help for finding the highest density region

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 1:39 PM, CheXiaohong wrote: I am using the package hdrcde to get the highest density region. I have the data from an unknown distribution. And I used the subroutine hdr from the package to get the highest density region. But I always got a error message. I do not know

Re: [R] F test

2009-04-16 Thread Mike Lawrence
I'm new to LME myself, so it would be best for others to advise on this. On Thu, Apr 16, 2009 at 3:00 PM, Jun Shen jun.shen...@gmail.com wrote: Mike, I kind of have the same question. What if for a mixed effect model, say using lme(), how to specify the interaction effect (between a fixed

[R] Printing data as a narrative or form letter rather than as a table

2009-04-16 Thread Farrel Buchinsky
How would one print the information in a table without having to view it as a table? I have a dataframe with about 30 columns and 50 rows. About 7 rows contain human subjects where something is just not right and I need to manually work out what is going on with them and maybe even call them to

Re: [R] Plotting C++ output in R

2009-04-16 Thread Warren Young
andrew@lshtm.ac.uk wrote: I want to be able to continuously plot the output from the model in R each time a new run generates data. From the C++ program, run the R script that plots the data. Something like this: system(Rscript myplotter.R); That assumes Rscript is in the

Re: [R] Extending a vector to length n

2009-04-16 Thread Bert Gunter
Folks: Not to be picky, but depending on exactly what's meant by attributes, I think it's impossible: x - 1:6 attr(x,length) - length(x) xx - rep(x,length=10) xx[7:10] - NA attr(xx,length) NULL attr(x,length) [1] 6 So attributes aren't preserved. The whole point of object orientation and

[R] question on using lattice panel plots

2009-04-16 Thread Ranjan Maitra
Hi, I think this question is best explained using the following self-contained toy example: ## cut code here and paste to R window z - cbind(rep(c(BIC, hist), each = 150), rep(rep(c(5, 10, 30), each = 50),2)) z - as.data.frame(z) z - cbind(z, runif(300)) names(z) - c(Method, sigma,

Re: [R] error bars in matplot

2009-04-16 Thread Matthieu Dubois
Hi Tim, there are a couple of problems in your example. (1) The most important is that your 'x' values for the matplot are 1:5 (that is row numbers of your mat1 matrix) and are seq(20,100,20) (that is, your vect vector) for your error bars. Error bars are thus plotted outside the plotting

Re: [R] F test

2009-04-16 Thread Emmanuel Charpentier
Le jeudi 16 avril 2009 à 14:08 -0300, Mike Lawrence a écrit : summary(my_lm) will give you t-values, anova(my_lm) will give you (equivalent) F-values. Ahem. Equivalent, my tired foot... In simple terms (the real real story may be more intricate) : The F values stated by anova are

[R] Translate the elements of a dataframe

2009-04-16 Thread Juergen Rose
The second beginner question. I want to create a new dataframe, where each element of the original dataframe is translated to 1 if it was +, to 0 if it was - to -1 otherwise. I could do with: Lines - abcd +-+ + +++ - +1- '+ ' -+

[R] Partial Derivatives in logit

2009-04-16 Thread Paul Heinrich Dietrich
Hi, I'm trying to figure out how to have R estimate partial derivatives for logit models. As an example, I'm providing a (fake) scored observation in a MNL with 3 categories of Y and 2 predictors (x01 and x02), and show the right way to calculate it, but am looking for how to use an R function,

Re: [R] F test

2009-04-16 Thread Mike Lawrence
Ahem. Equivalent, my tired foot... My bad, I wasn't paying attention. May I suggest consulting a textbook *before* flunking ANOVA 101 ? Harsh but warranted given my carelessness. On Thu, Apr 16, 2009 at 3:47 PM, Emmanuel Charpentier charp...@bacbuc.dyndns.org wrote: Le jeudi 16 avril 2009

Re: [R] Translate the elements of a dataframe

2009-04-16 Thread Chuck Cleland
On 4/16/2009 2:58 PM, Juergen Rose wrote: The second beginner question. I want to create a new dataframe, where each element of the original dataframe is translated to 1 if it was +, to 0 if it was - to -1 otherwise. I could do with: Lines - abcd +-+ + ++

Re: [R] Translate the elements of a dataframe

2009-04-16 Thread Juergen Rose
Am Donnerstag, den 16.04.2009, 15:14 -0400 schrieb Chuck Cleland: On 4/16/2009 2:58 PM, Juergen Rose wrote: The second beginner question. I want to create a new dataframe, where each element of the original dataframe is translated to 1 if it was +, to 0 if it was - to -1 otherwise. I could

[R] question on using lattice panel plots

2009-04-16 Thread Ranjan Maitra
Hi, I think this question is best explained using the following self-contained toy example: ## cut code here and paste to R window z - cbind(rep(c(BIC, hist), each = 150), rep(rep(c(5, 10, 30), each = 50),2)) z - as.data.frame(z) z - cbind(z, runif(300)) names(z) - c(Method, sigma, Error)

Re: [R] Digitizing the Plot

2009-04-16 Thread Greg Snow
I don't know of anything that does the automated process like the example software you link to, but here is one procedure that you can use to do it by hand. 1. Brind the graph into R and plot it (as an image) using rimage or EBImage (or other) packages. 2. use the locator function to find the

Re: [R] Equivalent to Stata egen

2009-04-16 Thread rmailbox
Now that we know what egen is, the answers are one-liners in R: # Make up some data vasdat - matrix ( sample ( 1:100, 3000, replace = TRUE ), ncol = 3 ) # Use apply for each ( MARGIN = 1 means rows, 2 means columns ) anycountresult - apply ( vasdat, MARGIN = 1, FUN = function ( x ) sum ( x %in%

Re: [R] Equivalent to Stata egen

2009-04-16 Thread Stas Kolenikov
See, we just jave different expectations of what is to be seen in the help system, and are used to different formats. Yes, Stata thinks of data as a rectangular array (although it stores it in memory, unlike SAS). The inputs to -egen-, as well as the values produced, depend on the particular

Re: [R] question on using lattice panel plots

2009-04-16 Thread Sundar Dorai-Raj
Try: z - cbind(rep(c(BIC, hist), each = 150), rep(rep(c(5, 10, 30), each = 50),2)) z - as.data.frame(z) z - cbind(z, runif(300)) names(z) - c(Method, sigma, Error) z$sigma - factor(z$sigma, c(5, 10, 30)) library(lattice) sigma - as.numeric(levels(z$sigma)) sigmaExprList - lapply(sigma,

Re: [R] Equivalent to Stata egen

2009-04-16 Thread David Winsemius
On Apr 16, 2009, at 3:58 PM, Stas Kolenikov wrote: See, we just jave different expectations of what is to be seen in the help system, and are used to different formats. Yes, Stata thinks of data as a rectangular array (although it stores it in memory, unlike SAS). The inputs to -egen-, as well

  1   2   >