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

2009-04-16 Thread Petr PIKAL
utkarshsinghal napsal dne 16.04.2009 17:20:10: > Hi Pikal, > > Thanks for your comments and apologies for not providing a clear example. But > you have completely ignored the small example I mentioned: Well, this is not exactly an example. So let us clarify things a bit. You do not explain

[R] [R-pkgs] Major bigmemory revision released.

2009-04-16 Thread Jay Emerson
The re-engineered bigmemory package is now available (Version 3.5 and above) on CRAN. We strongly recommend you cease using the older versions at this point. bigmemory now offers completely platform-independent support for the big.matrix class in shared memory and, optionally, as filebacked matri

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

2009-04-16 Thread cameron.bracken
markheckmann wrote: > > The pdf() settings do not affect Sweave settings when producing a .pdf > graphic. How can I change the Sweave default settings to e.g. 3 inch? > Also, even if you set the width of your plot to 3 inches, the plot will be expanded to 80% of the textwidth by default. To

[R] vertex ordering by date on a network diagram

2009-04-16 Thread fr510
Dear R helpers I am working with a csv file containing data about a citation graph. This csv file contains a column with an id of the paper containing the citation the next with the id of the paper being cited and the third the date of publication (dd/mm/). I can create a directed network w

[R] question about the Text Mining package tm

2009-04-16 Thread onyourmark
Hello. I am trying to work with the text mining package tm. I have a directory called textsTweet1 which contains three files short.txt myTextFile.txt myTextFile.csv short.txt contains one line: THE CAT IN THE HAT\n myTextFile contains some tweets from Twitter. The first few lines of myTextFile.

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

2009-04-16 Thread cls59
markheckmann wrote: > > > The pdf() settings do not affect Sweave settings when producing a .pdf > graphic. How can I change the Sweave default settings to e.g. 3 inch? > > Try setting the width and height options in the figure chunk: <> plot(1:10 @ To make a certain set of dimensions

[R] R2HTML and summary of dynlm model

2009-04-16 Thread Stephen J. Barr
Hello, I am having a bit of trouble with using R2HTML to produce the summary of a dynlm model. I do an HTMLStart(), then have a for loop creating different models, and I am trying to print out each model. I can use HTML() on the model object itself, but I cannot get it to print to summary object.

[R] SAS-like cluster statistics for ward's minimum variance method

2009-04-16 Thread Katell . Hamon
Hi all, I am looking for an easy way to compute statistics out of my cluster analysis using ward's method. Ideally it would be a table like that one http://www.tau.ac.il/cc/pages/docs/sas8/stat/chap23/sect2.htm#clug2 with various validation statistics for the last few number of clusters. The d

[R] How to control distance between rows of figures in multiple plots

2009-04-16 Thread Gundala Viswanath
Dear all, I have a plot with 2 x 2 figures matrix in it. pdf("~/Desktop/myplot.pdf",width=13,height=7) par(mfrow=c(2,2)) # follow by some code Now the distance between figures of row 1 and row 2 is too wide. How can I modify? - Gundala Viswanath Jakarta - Indonesia

[R] multiplot plot spacing and text strip

2009-04-16 Thread rajesh j
Hi everyone, I have a certain requirement and I'm not sure what to do.I need to reduce the spacing between plots in a multiplot. Make them really close together such that they almost touch. Also, I need to add a rectangular strip under my plot(very close to it) such that the strip contains some te

Re: [R] Kruskal's MDS results

2009-04-16 Thread Michael Denslow
Hi Dieter, > I understand that the stress is a measure of how good the > algorithm managed to represent the ordinal distances between > items. And I also see why it's dependent on the number of > dimensions. > I was hoping someone could tell me exactly what the formula > for the percentual stres

Re: [R] Equivalent to Stata egen

2009-04-16 Thread ronggui
It is sure thing that different person has different expectation of the help system. Personally, I think Stata's on-line help system is too brief, though the manual may be a different story. Perhaps, it is all about the habit and the extent to which you are used to (and how much you know about it).

Re: [R] Using trace

2009-04-16 Thread ronggui
Can you just print what you need to know? For example: > fact <- function(x) { + if(x<1) ans <- 1 else ans <- x*fact(x-1) + print(sys.call()) + cat(sprintf("X is %i\n",x)) + print(ans) + } > fact(4) fact(x - 1) X is 0 [1] 1 fact(x - 1) X is 1 [1] 1 fact(x - 1) X is 2 [1] 2 fact(x - 1) X is 3 [1] 6

Re: [R] string to integer

2009-04-16 Thread Coen van Hasselt
?as.integer xChar<-as.character(c(1,2,3)) xInt<-as.integer(xChar) On Fri, Apr 17, 2009 at 09:38, Romildo Martins wrote: > Hi, > > exists a function to converts string to integer? > > Thanks > > Romildo Martins > > __ > R-help@r-project.org mailing list

[R] string to integer

2009-04-16 Thread Romildo Martins
Hi, exists a function to converts string to integer? Thanks Romildo Martins __ 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 comm

Re: [R] Lattice xyplot with text under x-axis

2009-04-16 Thread Deepayan Sarkar
On Wed, Apr 15, 2009 at 8:59 AM, kate.m wrote: > > Hi All, > > I have a data set which I need to plot and show the values of one of the > variables as a second x-axis. > > library(lattice) > year<-c(2001,2002,2003,2004,2005,2006) > fac<-c("arts","arts","arts","sci","sci","sci") > staff<-c(95,98,99

Re: [R] question on using lattice panel plots

2009-04-16 Thread Deepayan Sarkar
On Thu, Apr 16, 2009 at 1:45 PM, Sundar Dorai-Raj wrote: > Sorry, that should be: > > sigma <- as.numeric(levels(z$sigma)) > sigmaExprList <- lapply(sigma, function(s) bquote(sigma == .(s))) > sigmaExpr <- as.expression(sigmaExprList) > bwplot(Error~Method | sigma, data = z, >       horiz = F, xla

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

2009-04-16 Thread Duncan Mackay
Steve If the .dbf extension files are dBase type. generalizing: there are 2 series of dbase .dbf files for non SQL type dbf files: 1 dBase III when Borland had dBase and 2 dBase 2000 produced by dBase inc If they are dbase III (ie can be imported into Excel) you can use the foreign package

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

2009-04-16 Thread Benjamin Tyner
Many thanks Duncan. Perhaps this merits a more explicit note in the documentation? Duncan Murdoch wrote: 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

Re: [R] Survreg/psm output

2009-04-16 Thread Frank E Harrell Jr
Laura Bonnett wrote: 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 t

Re: [R] "reverse truncate" to extract only decimal values

2009-04-16 Thread T.D.Rudolph
This one really sheds light on that old adage "...When you can't see the forest for the trees"! Sarah Goslee wrote: > > You could do something like this: > >> revtrunc <- function(x) { x - floor(x) } > >> revtrunc(39.5) > [1] 0.5 > > But note: >> revtrunc(-39.5) > [1] 0.5 > > I'm not s

Re: [R] "reverse truncate" to extract only decimal values

2009-04-16 Thread Barry Rowlingson
On Thu, Apr 16, 2009 at 10:30 PM, T.D.Rudolph wrote: > > hello there, > > Is there a way of truncating in the opposite direction so as to retain only > the values to the right of the decimal?? > > i.e. rather than: >> trunc(39.5) > [1] 39 > > i would get something like: >> revtrunc(39.5) > [1] 0.5

Re: [R] "reverse truncate" to extract only decimal values

2009-04-16 Thread Paul Smith
On Thu, Apr 16, 2009 at 10:30 PM, T.D.Rudolph wrote: > Is there a way of truncating in the opposite direction so as to retain only > the values to the right of the decimal?? > > i.e. rather than: >> trunc(39.5) > [1] 39 > > i would get something like: >> revtrunc(39.5) > [1] 0.5 > > I've been sear

Re: [R] "reverse truncate" to extract only decimal values

2009-04-16 Thread Sarah Goslee
You could do something like this: > revtrunc <- function(x) { x - floor(x) } > revtrunc(39.5) [1] 0.5 But note: > revtrunc(-39.5) [1] 0.5 I'm not sure what you'd want for negative numbers. One possibility: revtrunc <- function(x) { sign(x) * (x - floor(x)) } > revtrunc(39.5) [1] 0.5 > revtrunc

[R] "reverse truncate" to extract only decimal values

2009-04-16 Thread T.D.Rudolph
hello there, Is there a way of truncating in the opposite direction so as to retain only the values to the right of the decimal?? i.e. rather than: > trunc(39.5) [1] 39 i would get something like: > revtrunc(39.5) [1] 0.5 I've been searching to no avail but I imagine there is a very simple sol

Re: [R] Translate the elements of a dataframe

2009-04-16 Thread Gabor Grothendieck
Try this: 2 * (DF == "+") - (DF != "-") On Thu, Apr 16, 2009 at 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:

Re: [R] F test

2009-04-16 Thread Emmanuel Charpentier
Le jeudi 16 avril 2009 à 13:00 -0500, Jun Shen a écrit : > 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)? With lme, you have to specify a *list* of random effec

Re: [R] question on using lattice panel plots

2009-04-16 Thread Sundar Dorai-Raj
Sorry, that should be: sigma <- as.numeric(levels(z$sigma)) sigmaExprList <- lapply(sigma, function(s) bquote(sigma == .(s))) sigmaExpr <- as.expression(sigmaExprList) bwplot(Error~Method | sigma, data = z, horiz = F, xlab = "Method", strip = function(which.given, which.panel, var.na

Re: [R] there are fontencoding problem in Sweave

2009-04-16 Thread Peter Dalgaard
Duncan Murdoch wrote: 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

Re: [R] map of china without regions

2009-04-16 Thread Ray Brownrigg
Sorry, can't be done at the moment with the maps package. The "china" map database is based on data which was provided in latitude/longitude rectangles, and has not been properly processed to generate the line segments and polygons that the maps package uses to choose individual provinces or t

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

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 <-

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 functi

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] 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 th

[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", "sig

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

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] 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 wrote: > Le jeudi 16 avril 2009 à 14:08 -0300, Mike La

[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, s

[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- '+ ' -

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 s

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 are

[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", "si

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 obj

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 PA

[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 ens

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 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 effect > and a random

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] 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" "

Re: [R] Split string

2009-04-16 Thread Gabor Grothendieck
On Thu, Apr 16, 2009 at 2:01 PM, Peter Dalgaard 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 of digits.

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 wrote: > su

[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...

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 wrote: > The following approach works for both of your examples: > > xx <- rep(x, length.out=n) > xx[m:n] <- N

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] 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 it

[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:

[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,

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 g

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] "

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] a Levels: a > R. Raub

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] 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 0

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 avail

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] 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] 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 fram

[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 lo

[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 th

[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 in

[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",

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. -ro

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 inp

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 estimation

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.

[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] 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 (

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 wan

[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

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 file

[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 speci

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

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 dif

[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)? _

[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: i

[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] 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 sever

[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} \us

[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 q

[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

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

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,

[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 continu

[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: > contourplot(z~x*y,data=df,

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 ca

[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 examp

[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 to

[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] 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") p

[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 o

  1   2   >