Re: [R] How to adjust the stack size of R

2012-04-01 Thread Prof Brian Ripley
On Mon, 2 Apr 2012, Xiaobo Gu wrote: You would need do compile your own copy of R and increase the stack size, Can we do this at runtime? That depends on your unstated OS. Uwe gave you an answer for Windows. On many other OSes, the stack size is set up by the OS when the process is star

Re: [R] simulate correlated binary, categorical and continuous variable

2012-04-01 Thread Burak Aydin
Hello Greg, Sorry for the confusion. Lets say, I have a population. I have 6 variables. They are correlated to each other. I can get you pearson correlation, tetrachoric or polychoric correlation coefficients. 2 of them continuous, 2 binary, 2 categorical. Lets assume following conditions; Co1 and

[R] Non-linear least squares

2012-04-01 Thread n.surawski
Greetings, I am having some troubles with the nls() function in R V 2.14.2. I am doing some modelling where I want to predict the mass of leaf litter on the forest floor (X) as a function of time since fire (t). Fortunately, I have a differential equation that I can fit to the data which is acce

[R] NaN - trouble fixing NaN

2012-04-01 Thread Jhope
Hi R-listers, I am using the package plyr. I am just trying to get the hatching success mean of each nesting event and have typed in the following and received the below results: > tapply(HSuccess, Aeventexhumed, mean) AB C 0.2156265 0.1288559

[R] get data from Perl arrays

2012-04-01 Thread José Ramón Blas Pastor
Hi, a very simple doubt, but I do not know how to manage this. I want to plot a histogram for all data in 'datos.txt'. a) by using R: datos<-scan("datos.txt") pdf("xh.pdf") hist(datos) dev.off() b) How could I invoke R inside Perl to do the same?? #!/usr/bin/perl open(DAT,"datos.txt"); while (

Re: [R] Degrees of Freedom for lme.

2012-04-01 Thread SMH
thanks. well, basically. i ran this analysis once before, with just general linear model, but nothing stuck after multiple comparisons. the question is: do reading scores predict volume change over time (in canonical "reading regions"). so i tried again, using linear mixed effects, adding subje

[R] How to export plot outputs as "gif"

2012-04-01 Thread mrzung
Hi, I really need to export plot image as "gif". I know that other image forms are available with functions like png(), jpeg() etc. However, The reason that I only need the "gif" form is "gimage" function in "gWidgetstcltk" library only works with "gif" or "pnm". I want to lo

[R] Selecting files with a particular string in filename

2012-04-01 Thread Kumar Mainali
I am trying to find an efficient way to select certain text files from a folder with thousands of text files. I used file.list function with a specific "pattern" to obtain 70 files for each of the i's in 1:100. Next, I need to select some files from this list of 70 files. The files to be selected d

Re: [R] simulate correlated binary, categorical and continuous variable

2012-04-01 Thread Burak Aydin
Hello David Duffy-2, I see that you just proved using rmvnorm and then dichotomize/categorize them should work. Thanks but please take a look at this link; http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/CatContinuous and this article; Analysis by Categorizing or Dichotomizing Continuous Vari

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread Rui Barradas
Hello, michaelyb wrote > > Ok. I appreciate your help. i don't understand what you guys mean by > "reproducible example", if you explained better, I will be more than glad > to post it. > > Regards, > Try this: R> A <- list(a=NULL, b=NULL) R> A R> dput(A) Now, the output of 'dput' is a rep

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread michaelyb
Ok. I appreciate your help. i don't understand what you guys mean by "reproducible example", if you explained better, I will be more than glad to post it. Regards, -- View this message in context: http://r.789695.n4.nabble.com/Filling-empty-List-in-a-FOR-LOOP-tp4522694p4524532.html Sent from th

Re: [R] scan() vs readChar() speed

2012-04-01 Thread baptiste auguie
Thanks; I did not notice an appreciable difference between scan() and scan(what=double()) in this example. Adding to my confusion, I noted a strange and apparently systematic discrepency between the timing results when the code is run within R.app, within emacs, or from a terminal. Any idea what mi

Re: [R] How to adjust the stack size of R

2012-04-01 Thread Xiaobo Gu
>>You would need do compile your own copy of R and increase the stack >>size, Can we do this at runtime? >>You need at least 76252 obs and that means the design matrix needs > 46 >>Gbyte! Hence a sensible calculation is not really possible unless you >>have really big machines around. We do

Re: [R] How do I get a rough quick utility plot of a time series?

2012-04-01 Thread Roy Mendelssohn
?ts -Roy On Apr 1, 2012, at 7:57 PM, Hurr wrote: > I got a quick answer on my "pause" question and on my "read.table" question. > But I didn't think this question should be that much harder. > I realize that there is likely a whole range of answers. > Please give me a simple two-function time ser

Re: [R] How do I get a rough quick utility plot of a time series?

2012-04-01 Thread Hurr
I got a quick answer on my "pause" question and on my "read.table" question. But I didn't think this question should be that much harder. I realize that there is likely a whole range of answers. Please give me a simple two-function time series plot so I can get started with time-series plots. Colu

Re: [R] yet another update error

2012-04-01 Thread Alexandre Aguiar
Em Dom 01 Abr 2012, Alexandre Aguiar escreveu: > error reading package index > file /usr/local/lib/R/library/tcltk2/tklibs/datefield0.2/pkgIndex.tcl: > too many nested evaluations (infinite loop?) Sorry. Sorry. Had not uninstalled 2.14.2 before installing 2.15.0. > But don't think they are the cu

Re: [R] Reading first line before using read.table()

2012-04-01 Thread Hurr
Thanks so much. The following are the actual lines I used for testing, and they worked. titleline <- readLines("C:/ad/dta/TryRRead/pureCos2.dta", n=1) print(titleline) dta <- read.table("C:/ad/dta/TryRRead/pureCos2.dta", skip = 1, header = TRUE, sep = ",", colClasses = "character") linDt

[R] R 2.15.0 and Tinn-R

2012-04-01 Thread Jose Claudio Faria
Dears Tinn-R users, Before 2.15.0 the caption of 32 bit was only "R Console" and now it is "R Console (32-bit)". In this way Tinn-R is not recognizing Rgui 32 bit, due the caption is used for it. ( I have been receiving emails about it from the users). So, my suggestion to workaround is (inside

[R] yet another update error

2012-04-01 Thread Alexandre Aguiar
Hi, After upgrading R I always update installed packages to the new version. This time an error I have never seen or heard of appeared: thousands, perhaps millions of lines like the ones below. --8><-- error reading package index file /usr/local/lib/R/library/tcltk2/tkl

Re: [R] Reading first line before using read.table()

2012-04-01 Thread jim holtman
try this: > # test data > temp <- tempfile() > writeLines(text = "main title line + a b # table header + 1 2 + 3 4 + 5 6", temp) > input <- file(temp, 'r') # connection for reading > > # read main > main <- readLines(input, n = 1) > rest <- read.table(input, header = TRUE) > close(input) > > mai

Re: [R] Reading first line before using read.table()

2012-04-01 Thread Steve Lianoglou
Hi, On Sun, Apr 1, 2012 at 8:27 PM, Hurr wrote: > So far I have figured out that the following line > reads our time series files into R OK. > dtLs$dta <- read.table("C:/TryRRead/datFiles/JFeqfi4h.rta", header = TRUE, > sep = ",", colClasses = "character") > But I have to remove a main-title line

Re: [R] How to use Latex code in R loop?

2012-04-01 Thread Henrik Bengtsson
On Sun, Apr 1, 2012 at 4:20 PM, Duncan Mackay wrote: > Hi > > There are a number of packages that produce latex from R, Sweave, brew, > knitr - ones that come to mind. It happens that i use Sweave. > The package you finally use may depend on your preferences > > The graphic output in R may also de

[R] Reading first line before using read.table()

2012-04-01 Thread Hurr
So far I have figured out that the following line reads our time series files into R OK. dtLs$dta <- read.table("C:/TryRRead/datFiles/JFeqfi4h.rta", header = TRUE, sep = ",", colClasses = "character") But I have to remove a main-title line so that the first line is the column titles line. This l

Re: [R] Possibly more coefficients?

2012-04-01 Thread Ben Bolker
Sarah Goslee gmail.com> writes: > > I saw this earlier; double-posting is discouraged. If you don't get a > reply, it's more likely that you wrote a poorly-formed question than > that nobody saw it. > > For instance, this is not a reproducible example, and we know nothing > about your data, so

Re: [R] indexing in a function doesn't work?

2012-04-01 Thread Benjamin Caldwell
Josh, Many thanks - here's a subset of the data and a couple examples: plotter(10,3,fram=rwb,framvec=rwb$prcnt.char.depth,obj=prcnt.char.depth,form1= post.f.crwn.length~shigo.av,form2=post.f.crwn.length~shigo.av-1, form3=leaf.area~(1/exp(shigo.av*x))*n,type=2,xlm=70,ylm=35) plotter(10,3,fram=rwb

Re: [R] Possibly more coefficients?

2012-04-01 Thread Sarah Goslee
I saw this earlier; double-posting is discouraged. If you don't get a reply, it's more likely that you wrote a poorly-formed question than that nobody saw it. For instance, this is not a reproducible example, and we know nothing about your data, so nobody can judge whether the results you're getti

[R] Possibly more coefficients?

2012-04-01 Thread abigailclifton
Hi there, I have this code: Prepared_Data <- na.omit(read.csv("Prepared_Data.csv", header=TRUE)) pd <- Prepared_Data[,-3] ## data minus response variable lev <- sapply(pd,function(x) length(unique(x))) ## total parameters for n variables par(las=1,bty="l") plot(cumprod(lev),log="y") library(M

Re: [R] How to use Latex code in R loop?

2012-04-01 Thread Duncan Mackay
Hi There are a number of packages that produce latex from R, Sweave, brew, knitr - ones that come to mind. It happens that i use Sweave. The package you finally use may depend on your preferences The graphic output in R may also depend on what latex you use and other requirements - eg if you

Re: [R] scan() vs readChar() speed

2012-04-01 Thread Duncan Murdoch
On 12-04-01 2:58 AM, baptiste auguie wrote: Dear list, I am trying to find a fast solution to read moderately large (1 -- 10 million entries) text files containing only tab-delimited numeric values. My test file is the following, nr<- 1000 nc<- 5000 m<- matrix(round(rnorm(nr*nc),3),nr=nr) writ

Re: [R] A function like sum but with functions other than '+'

2012-04-01 Thread Joshua Wiley
Hi Sergio, Look at ?Reduce Cheers, Josh On Sun, Apr 1, 2012 at 3:25 PM, Julio Sergio wrote: > Because I didn't find in R any functions similar to the function 'reduce' from > Python, I'm writing a function "freduce" as follows: > > freduce <- function(f, vec, ValIni=NULL, StopIn=NULL) { >  # f

Re: [R] A function like sum but with functions other than '+'

2012-04-01 Thread Michael Sumner
Try ?Reduce On Monday, April 2, 2012, Julio Sergio wrote: > Because I didn't find in R any functions similar to the function 'reduce' > from > Python, I'm writing a function "freduce" as follows: > > freduce <- function(f, vec, ValIni=NULL, StopIn=NULL) { > # f: is any function that takes two ar

Re: [R] indexing in a function doesn't work?

2012-04-01 Thread Joshua Wiley
Hi, Glancing through your code it was not immediately obvious to me why it does not work, but I can see a lot of things that could be simplified. It would really help if you could give us a reproducible example. Find/upload/create (in R) some data, and examples of how you would use the function.

[R] A function like sum but with functions other than '+'

2012-04-01 Thread Julio Sergio
Because I didn't find in R any functions similar to the function 'reduce' from Python, I'm writing a function "freduce" as follows: freduce <- function(f, vec, ValIni=NULL, StopIn=NULL) { # f: is any function that takes two arguments of the same type # vec: is a vector of n values accepted by

[R] indexing in a function doesn't work?

2012-04-01 Thread Benjamin Caldwell
Hello, I've written a small function that's supposed to save me some time, and it's ending up killing it- the intention is to iteratively subset a dataset fram on framevec, fit a model (either lm or nls depending on type) and return the r2 or AIC from the model, respectively. Although as far as I

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread ilai
On Sun, Apr 1, 2012 at 9:59 AM, michaelyb wrote: > Basically I need to read the data from an external source using many R > commands. > The problem is that sometimes the source is empty, and I get a list with > empty values, and I need to substitute them by "NA". > It is def. not hard, I just don'

Re: [R] How to use Latex code in R loop?

2012-04-01 Thread Liviu Andronic
On Sun, Apr 1, 2012 at 4:48 PM, Manish Gupta wrote: > Hi, > > I am newbie in Latex and R. I am working on one report in which i need to > read file and display content of file by formatting (adding color boxes and > colorful text for each record). For this i need to use latex code in R loop. > How

Re: [R] R process taking over memory

2012-04-01 Thread Prof Brian Ripley
You haven't even told us your OS (see the posting guide). But the usual way is to get your OS to set a memory limit for a process (usually via your shell), and to run things under try/tryCatch. Then the OS will stop R allocating more than the limit, the current task in R will fail, and the lo

Re: [R] How to use Latex code in R loop?

2012-04-01 Thread Ingmar Visser
Look into Sweave or knitr to combine R and LaTeX for producing reports. hth, Ingmar http://www.statistik.lmu.de/~leisch/Sweave/ https://github.com/yihui/knitr On Sun, Apr 1, 2012 at 4:48 PM, Manish Gupta wrote: > Hi, > > I am newbie in Latex and R. I am working on one report in which i need to >

Re: [R] bioconductor help

2012-04-01 Thread Sarah Goslee
At a first guess, you need to install the development packages tcl-dev and tk -dev before you run configure. If running configure fails, no makefile is generated, so your problem is with the configuration step. It's also more likely that you'll get educated help on the Bioconductor list - I've

[R] bioconductor help

2012-04-01 Thread Eric P
Hello, I have a question on how to get bioconductor running properly on Ubuntu 11.10 as I have tried everything it seems like and I keep on getting this message. But before I go farther can you please email and say that you will help me with this because nobody seems to want to help or know how to

[R] Error in xy.coords(x, NULL, log = log) : (list) object cannot be coerced to type 'double'

2012-04-01 Thread Bazman76
Hi there, When I run the code below I get the error Error in xy.coords(x, NULL, log = log) :(list) object cannot be coerced to type 'double' Any tips how I can resolve this? > > library("waveslim") > > vols=read.csv(file="C:/Users/ocuk/My Documents/Abs Vol.csv", header=TRUE, > sep=",") > x<-c

Re: [R] map and shapefile help

2012-04-01 Thread chuck.01
Thanks you very much for your time Michael, and I have noted that this should have been asked at the R-Sig-Geo site cheers! Michael Sumner-2 wrote > > Sorry I take that back, I was using the (independent of GDAL) > shapefile reader in maptools. Using the rgdal package, we get the full > projecti

Re: [R] Filling empty List in a FOR LOOP

2012-04-01 Thread michaelyb
Basically I need to read the data from an external source using many R commands. The problem is that sometimes the source is empty, and I get a list with empty values, and I need to substitute them by "NA". It is def. not hard, I just don't see how In the prvious post, the first example had val

[R] How to use Latex code in R loop?

2012-04-01 Thread Manish Gupta
Hi, I am newbie in Latex and R. I am working on one report in which i need to read file and display content of file by formatting (adding color boxes and colorful text for each record). For this i need to use latex code in R loop. How can i use Latex code in R loop. Any example will help me a lot

[R] extend data frame for plotting heat map in ggplot2

2012-04-01 Thread Till Bayer
Hi all! I want to generate a heat map from an all-vs-all comparison. I have the data, already scaled to 0-1. However, I have the values only for the comparisons in one way, and not for the comparisons between the same group (which are always 1), i.e. I have half the matrix and am missing the

[R] R process taking over memory

2012-04-01 Thread Ramiro Barrantes
Hello, I have a general question on the possibility of how to "catch and stop" a function when it uses too much memory. The problem is that some datasets, when applied to nlme (a relatively older version), cause the nlme function to just hang forever and start taking over memory (this afternoo

Re: [R] Degrees of Freedom for lme.

2012-04-01 Thread Ben Bolker
SHouston gmail.com> writes: > I am trying to run a linear mixed effect model on data. I have 17 > longitudinal subjects and 36 single subjects, and this is the code I'm using > (below). So, INDEX1 is the column with brain volumns, and the predictors > are gort and age, by time ID (time they wer

Re: [R] gWidgetstcltk gtext problem

2012-04-01 Thread j verzani
mrzung gmail.com> writes: > > hi, what I want to do is put a function result(output) into gtext area. > short example is following, > > require("gWidgetstcltk") > options(guiToolkit = "tcltk") > > win<-gwindow() > input<-gedit("",con=win) > run<-gbutton("run",con=win,handler=function(h,...){ >

Re: [R] How to adjust the stack size of R

2012-04-01 Thread Uwe Ligges
On 01.04.2012 08:46, Xiaobo Gu wrote: 2012/3/31 Uwe Ligges On 30.03.2012 03:16, Xiaobo Gu wrote: Hi, I got a stack overflow error when training a glm model with a very long formula. I just tried with a formula of length 1000. How long was yours? Which version of R? Where is the repdro

[R] (no subject)

2012-04-01 Thread abigailclifton
Hi there, I have this code: Prepared_Data <- na.omit(read.csv("Prepared_Data.csv", header=TRUE)) pd <- Prepared_Data[,-3] ## data minus response variable ## how many levels per variable? lev <- sapply(pd,function(x) length(unique(x))) ## total parameters for n variables par(las=1,bty="l") plot

Re: [R] Need for optim() resistant to error on the fit criteria.

2012-04-01 Thread Hurr
This must be a misdirected reply. Personal or system error? -- View this message in context: http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523523.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

Re: [R] pause code in R code?

2012-04-01 Thread Hurr
Thanks to all. I'm learning. -- View this message in context: http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523520.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/

Re: [R] pooling in MICE

2012-04-01 Thread 123
Hi Nicole, Thank you very much for helping. I also got feedback from one of the authors of MICE package: "The problem you encounter with manova() is that it has no vcov() method. The vcov() function is used in the pool() function to calculate the within and between imputation variance. If y

[R] Need for optim() resistant to error on the fit criteria.

2012-04-01 Thread Marc Girondot
Hi, I try to fit parameters based on the comparison between a stochastic model that uses these parameters and observed data. The problem is that two runs with the same set of parameters will produce a fitting criteria slightly different. I found that optim() is highly sensitive to such a situat

Re: [R] pause code in R code?

2012-04-01 Thread Reza Salimi-Khorshidi
Try: ?Sys.sleep() On Sun, Apr 1, 2012 at 2:31 PM, mlell08 wrote: > type '?readline' in your R command prompt to receive help about how to > use the function readline() since this is what you're looking for. > > Regards! > > __ > R-help@r-project.org ma

Re: [R] pause code in R code?

2012-04-01 Thread R. Michael Weylandt
He only wrote one word... it could be that one. For example, plot(1:5) readline("Press wrote: > Sorry, I cannot find your answer in your reply. > > > -- > View this message in context: > http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523348.html > Sent from the R help mailing list

Re: [R] pause code in R code?

2012-04-01 Thread Berend Hasselman
On 01-04-2012, at 15:10, Hurr wrote: > Sorry, I cannot find your answer in your reply. > Answer was given at the top of the message and was ?readline. Read the help of readline. Berend __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] trouble with small multiples on a date variable

2012-04-01 Thread Duncan Mackay
Hi David Are you having problems getting the data in or further down the track If it is dBase III or IV (opens in excel with the appropriate excel extension filter) you can use library(foreign) data <- read.dbf("d:/Cic/dbf/dsw3.dbf") > str(data) 'data.frame': 43730 obs. of 8 variables: $

Re: [R] pause code in R code?

2012-04-01 Thread mlell08
type '?readline' in your R command prompt to receive help about how to use the function readline() since this is what you're looking for. Regards! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posti

[R] lattice levelplot axis ticks labels

2012-04-01 Thread Larry York
Hello, I've searched for help a lot and think I am close, but an still not able to place ticks and labels how I'd like in lattice's levelplot. I've come up with general reproducible code that gives the same problem as I'm having with real data: heat <- array(1:24,c(3,8)) require (lattice) ##bas

[R] Problem about collinearity diagnosis

2012-04-01 Thread frank.chiang
Hi, I try to calculate condition indexes and variance decomposition proportions in order to test for collinearity using colldiag() in perturb package, I got a large index and two variables with large variance decomposition proportions,but one of them is constant item.I also checked the VIF for tha

Re: [R] pause code in R code?

2012-04-01 Thread Hurr
Sorry, I cannot find your answer in your reply. -- View this message in context: http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523348.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list ht

Re: [R] pause code in R code?

2012-04-01 Thread jim holtman
?readline On Sun, Apr 1, 2012 at 7:33 AM, Hurr wrote: > How do I write something like "pause()" in R code like > in other programming languages so I can just press > something to let the program continue? > > > -- > View this message in context: > http://r.789695.n4.nabble.com/pause-code-in-R-co

[R] pause code in R code?

2012-04-01 Thread Hurr
How do I write something like "pause()" in R code like in other programming languages so I can just press something to let the program continue? -- View this message in context: http://r.789695.n4.nabble.com/pause-code-in-R-code-tp4523209p4523209.html Sent from the R help mailing list archive

Re: [R] map and shapefile help

2012-04-01 Thread Michael Sumner
Sorry I take that back, I was using the (independent of GDAL) shapefile reader in maptools. Using the rgdal package, we get the full projection information from the auxiliary .xml file that ships with the other shapefile files. library(rgdal) ## Here my working directory "." contains "NA_CEC_Eco_

Re: [R] map and shapefile help

2012-04-01 Thread Michael Sumner
There is no coordinate system defined for these files- proj4string is NA, see below - otherwise transforming them to that used by the maps package is trivial. I suggest you find out the coordinate system from the provider of the data and ask any further questions on R-Sig-Geo. This is a big file, ~

Re: [R] how to avoid farword slashes in RJSONIO output

2012-04-01 Thread MLSC
Hello jim, Thanks. yes, cat() served the purpose. Regards, mlsc On Sat, Mar 31, 2012 at 4:58 PM, jim holtman wrote: > The forward slashes are to escape quotes and the new lines. Here is > an example showing that when you output the file with 'cat' you > probably get the results you are expectin

[R] gWidgetstcltk gtext problem

2012-04-01 Thread mrzung
hi, what I want to do is put a function result(output) into gtext area. short example is following, require("gWidgetstcltk") options(guiToolkit = "tcltk") win<-gwindow() input<-gedit("",con=win) run<-gbutton("run",con=win,handler=function(h,...){ y<<-as.numeric(svalue(input))+1 }) outarea<-gtext(

[R] scan() vs readChar() speed

2012-04-01 Thread baptiste auguie
Dear list, I am trying to find a fast solution to read moderately large (1 -- 10 million entries) text files containing only tab-delimited numeric values. My test file is the following, nr <- 1000 nc <- 5000 m <- matrix(round(rnorm(nr*nc),3),nr=nr) write.table(m, file = "a.txt", append=FALSE,