Re: [R] enableJIT(2) causes major slow-up in rpart

2012-04-13 Thread Tal Galili
Thank you very much Luke, With regards, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) -

Re: [R] Tobit Fixed Effects

2012-04-13 Thread Arne Henningsen
Hi Felipe On 22 March 2012 10:13, Felipe Nunes wrote: > I'm using censReg() to run a random effects model, but R is having an error. > Can you help me understanding why? > > When I run this model, everything works fine: > > tob1 <- censReg(transfers.cap ~ factor(year) + district2 + gdp.cap - 1, >

Re: [R] A little exercise in R!

2012-04-13 Thread Justin Haynes
Since I thought this was a cool question, I posted it to StackOverflow. Vincent Zookynd's answer is amazing and really exercises the power of R. http://stackoverflow.com/questions/10150161/ordering-117-by-perfect-square-pairs/10150797#10150797 On Fri, Apr 13, 2012 at 10:06 PM, Bert Gunter wr

Re: [R] how to divide data by week

2012-04-13 Thread Özgür Asar
Dear Stefano, A practical way might be as the following R> acc<-read.table("acc.txt",header=T) #reading your data into R R> acc.may<-acc[acc[,3]==5,] #subsetting data with respect to may R> acc.may.order<-acc.may[order(acc.may[,4]),] #ordering with respect to day R> mean(acc.may.order[1:7,5]) # m

Re: [R] how to divide data by week

2012-04-13 Thread Hasan Diwan
Stefano, On 13 April 2012 20:51, Stefano Sofia wrote: > I have a data frame as below specified. > From the 1st of May to the 30th of September of several years (e.g. from > 2004 to 2011) I have a frequency of accidents. > I need the mean of accidents divided by weeks (i.e. the mean of accidents >

Re: [R] A little exercise in R!

2012-04-13 Thread Bert Gunter
... and a moment's more consideration immediately shows it cannot be done for n = 18, since 16,17, and 18 cannot all be at an end. -- Bert On Fri, Apr 13, 2012 at 9:59 PM, Bert Gunter wrote: > Folks: > > IMHO this is exactly the **wrong** way t go about this. These are > mathematical exercises t

Re: [R] A little exercise in R!

2012-04-13 Thread Bert Gunter
Folks: IMHO this is exactly the **wrong** way t go about this. These are mathematical exercises that should employ mathematical thinking, not brute force checking of cases. Consider, for example, the 1 to 17 sequence given by Ted. Then 17 **must** be one end of the sequence and 16 the other. (Why

Re: [R] A little exercise in R!

2012-04-13 Thread Petr Savicky
On Fri, Apr 13, 2012 at 10:34:49PM +0100, Ted Harding wrote: > Greetings all! > A recent news item got me thinking that a problem stated > therein could provide a teasing little exercise in R > programming. > > http://www.bbc.co.uk/news/uk-england-cambridgeshire-17680326 > > Cambridge Universit

[R] how to divide data by week

2012-04-13 Thread Stefano Sofia
Dear list users, I have a data frame as below specified. From the 1st of May to the 30th of September of several years (e.g. from 2004 to 2011) I have a frequency of accidents. I need the mean of accidents divided by weeks (i.e. the mean of accidents from the 1st to the 7th of May of all the year

Re: [R] Help - Importing data from txt and xlsx files

2012-04-13 Thread steven mosher
read your file with readLines(). copy the first few lines for me to read here test <- readLines(yur filename) test[1:5] post the result. we can figure it out from there On Apr 13, 2012 11:46 AM, "AMFTom" wrote: > Dear Thierry, > > Thanks for your help. Now though, I try to import data from a tx

Re: [R] Curve fitting, probably splines

2012-04-13 Thread Greg Snow
This sounds like possibly using logsplines may be what you want. See the 'oldlogspline' function in the 'logspline' package. On Thu, Apr 12, 2012 at 7:45 AM, Michael Haenlein wrote: > Dear all, > > This is probably more related to statistics than to [R] but I hope someone > can give me an idea h

Re: [R] some questions about sympy (that is, rSymPy)

2012-04-13 Thread Kjetil Halvorsen
see below. On Fri, Apr 13, 2012 at 8:50 PM, Kjetil Halvorsen wrote: > I am experimenting with rSymPy, and it seems to work nice. > > > However, I dislike the need to wrap all sympy expressions within > quotes, it leads to ugly calls like > library(rSymPy) > Var("x,y,z") > sympy("(x+y)**2") > and

[R] some questions about sympy (that is, rSymPy)

2012-04-13 Thread Kjetil Halvorsen
I am experimenting with rSymPy, and it seems to work nice. However, I dislike the need to wrap all sympy expressions within quotes, it leads to ugly calls like library(rSymPy) Var("x,y,z") sympy("(x+y)**2") and so on. Inspired by the function cq from mvbutiles package: library(mvbutils) > cq fun

Re: [R] A little exercise in R!

2012-04-13 Thread Philippe Grosjean
Hi all, I got another solution, and it would apply probably for the ugliest one :-( I made it general enough so that it works for any series from 1 to n (n not too large, please... tested up to 30). Hint for a better algorithm: inspect the object 'friends' in my code: there is a nice pattern

Re: [R] A little exercise in R!

2012-04-13 Thread Justin Haynes
I thought this was kinda cool! Here's my solution, its not robust or probably efficient I'd to hear improvements or other solutions! Justin sq.test <- function(a, b) { ## test for number pairs that sum to squares. sqrt(sum(a, b)) == floor(sqrt(sum(a, b))) } ok.pairs <- function(n, vec

[R] Geostatitics 3D Variogram Map

2012-04-13 Thread Murphy, Mark P (AU)
Dear R Helpers I'm investigation the geostatistics tools in R and have found the package 'gstat', which looks to be useful four two dimensional data. However, I usually deal with three dimensional information. I would like to compute a 3D variogram map using the variogram tool but cannot seem

[R] Merging two data frames with different columns names

2012-04-13 Thread Johnny Liseth
I am trying to merge two data frames, but one of the column headings are different in the two frames. How can I rjoin or rbind the tho frames? Johnny # Generate 2 blocks by confounding on abc d1 <- conf.design(c(1,1,1), p=2, block.name="blk", treatment.names = c("A","B","C")) d2 <- conf.design(c(

[R] predict GLM with offset MASS

2012-04-13 Thread smfa
Hi, I know this is probably a stupid question... But I don't seem to find the answer. I'm fitting a GLM with a Poisson family, using MASS, and then tried to get a look at the predictions, however the offset does seem to be taken into consideration: model_glm=glm(cases~rhs(data$year,2003)+lhs(d

Re: [R] list.dirs() full.names broken?

2012-04-13 Thread J Toll
OK, well list.dirs() seems broken to me. In case someone else needs a working version, I wrote a new function called lsdir(). It adds the ability to choose whether to include hidden directories. It should work on Mac and probably Linux/Unix. lsdir <- function(path, format = "relative", recursiv

[R] deep copy?

2012-04-13 Thread Whit Armstrong
Is putting a variable into a list a deep copy (and is tracemem the correct way to confirm)? warmstrong@krypton:~/dvl/R.packages$ R > x <- rnorm(1000) > tracemem(x) [1] "<0x3214c90>" > x.list <- list(x.in.list=x) tracemem[0x3214c90 -> 0x2af0a20]: > Is it possible to put a variable into a list with

Re: [R] How to define format of number

2012-04-13 Thread Bert Gunter
Well... ?format (strangely enough). Try searching in R at least a wee bit before posting. -- Bert On Fri, Apr 13, 2012 at 12:35 PM, mrzung wrote: > hi all, > > What I want to do is show a number with thousand expression. > > I dont know exactly the expression name but here is example. > >  1,0

Re: [R] Coding columns for survival analysis

2012-04-13 Thread jim holtman
try this: > x <- read.table(text = " tree live1 live2 live3 live4 live5 +1 tree1 0 0 0 1 1 +2 tree2 0 0 1 1 0 +3 tree3 0 1 1 0 0 +4 tree4 1 1 0 0 0 +6 tree4 1 1 1 1 0 # anothe

Re: [R] How to define format of number

2012-04-13 Thread jim holtman
try this: > prettyNum(1, big.mark = ",") [1] "100,000,000" > On Fri, Apr 13, 2012 at 3:35 PM, mrzung wrote: > hi all, > > What I want to do is show a number with thousand expression. > > I dont know exactly the expression name but here is example. > > 1,000 > 10,000,000 > > is ther

Re: [R] R Large Dataset Problem

2012-04-13 Thread efulas
I am using the codes below, options(max.print=5.5E5) x=rep(1,1052) b=read.fwf(file="efetez.binary", widths=c(6,x),header=FALSE) and i get " C stack usage is too close to the limit" this error. I want to get my data like ; molecul id v1 v2 v3 . 190

[R] Seemingly simple "lm" giving unexpected results

2012-04-13 Thread Gene Leynes
I can't figure out why this is returning an NA for the slope in one case, but not in the other. I can tell that R thinks the first case is singular, but why isn't the second? ## Define X and Y ## There are two versions of x ## 1) "as is" ## 2) shifted to start at 0 y = c(58, 57, 57, 279,

Re: [R] problem with svyby and NAs (survey package)

2012-04-13 Thread A.F.Fenton
> I'm trying to get the proportion "true" for dichotomous variable for various > subgroups in a survey. Sorry, I'm new to the list, and just saw the advice about minimally reproducible code. Here goes: library(survey) foo <- data.frame(id = 1:25, weight = runif(25),

[R] Odd characters at beginning of file

2012-04-13 Thread Lee Hachadoorian
I'm use RPostgreSQL to access data on a Postgres server. I would like to keep my SQL statements in external files, as they're easier to write and debug in pgAdmin, then I use readLines to bring them into R and feed to dbGetQuery. Here's the problem. When I create a SQL script with pgAdmin, then lo

[R] R: Colouring phylogenetic tip labels and/or edges

2012-04-13 Thread Monroe, Melanie
Hi, I have reconstructed ancestral character states on a phylogeny using MuSSE in the diversitree package and plotted the character state probabilities as pie charts on the nodes. I would, however, like to colour the character states of my extant species, i.e. the tip labels, the same colours a

[R] How to define format of number

2012-04-13 Thread mrzung
hi all, What I want to do is show a number with thousand expression. I dont know exactly the expression name but here is example. 1,000 10,000,000 is there a way to express a number like that? -- View this message in context: http://r.789695.n4.nabble.com/How-to-define-format-of-number-tp4

[R] Question with R CMD SHLIB in 64 bit R

2012-04-13 Thread Katharine Miller
Hi, I have some C++ code that I compiled into a dll for use in 32 bit R and would like to recompile for use in 64bit R. I thought it would be as easy as going to R-2.15.0\bib\x64 and running R CMD SHLIB mfregRF.c but that doesn't do anything. It doesn't give me any error messages, but it also

[R] A little exercise in R!

2012-04-13 Thread Ted Harding
Greetings all! A recent news item got me thinking that a problem stated therein could provide a teasing little exercise in R programming. http://www.bbc.co.uk/news/uk-england-cambridgeshire-17680326 Cambridge University hosts first European 'maths Olympiad' for girls The first European gir

Re: [R] loess function take

2012-04-13 Thread Duncan Mackay
As lowess() is mentioned another in similar vein is locfit() from package locfit Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 Email home: mac...@northnet.com.au At 00:07 14/04/2012, you wrote: Since you have only one dependent varia

Re: [R] enableJIT(2) causes major slow-up in rpart

2012-04-13 Thread luke-tierney
The level 2 is a heuristic meant to help with certain kinds of programming idioms. It isn't always going to work. In this case trace(cmpfun) will show three functions being compiled each time through. Not sure why -- I'll try to find out and see if it can be avoided. luke On Thu, 12 Apr 2012, T

Re: [R] Can't read a binary file

2012-04-13 Thread Roy Mendelssohn
Hi Scott: On Apr 13, 2012, at 1:45 PM, Waichler, Scott R wrote: > Hi, I've read up on readBin() and chapter 6 in the R Data Import/Export > manual, but I still can't read a binary file. Here is how the creator of the > file described the code that would be needed in Fortran: > > "Every record

[R] Coding columns for survival analysis

2012-04-13 Thread Alexander Shenkin
Hello Folks, I have 5 columns for thousands of tree records that record whether that tree was alive or dead. I want to recode the columns such that the cell reads "found" when a live tree is first observed, "alive" for when a tree is found alive and is not just found, and "mort" when it was previ

[R] Can't read a binary file

2012-04-13 Thread Waichler, Scott R
Hi, I've read up on readBin() and chapter 6 in the R Data Import/Export manual, but I still can't read a binary file. Here is how the creator of the file described the code that would be needed in Fortran: "Every record has a return in fortran. The length of each record is nx*ny*4. To read y

Re: [R] Can't get R to recognize Java for rJava installation

2012-04-13 Thread Waichler, Scott R
Milan, Merci. I did find the javah file and put it in /usr/bin, where R can now find it. However, I still get a similar error message when trying to install rJava, i.e. configure: error: One or more Java configuration variables are not set. The only field that doesn't have a value now are t

Re: [R] writing spdiags function for R

2012-04-13 Thread Ben Bolker
Ben Bolker gmail.com> writes: > > I'm not quite sure how to do it, but I think you should look > at the ?band function in Matrix. In combination with diag() of a > suitably truncated matrix, you should be able to extract bands > of sparse matrices efficiently ... > getband <- function(A,k

[R] is there a way to call python like source(file, echo = TRUE) in R?

2012-04-13 Thread Yihui Xie
Sorry this is more like a Python question, but I believe many R users also know well about Python, so here is my question: I want to run python code like source(file, echo = TRUE) in R, i.e. echo both the source code and the output. This only shows the output: python -c 'print "hello"' Thanks!

Re: [R] rgl_0.92.879 package broke with R 2.15

2012-04-13 Thread Grimes Mark
Duncan Brilliant. This solved the problem. Library (rgl) is now accessiible, and the plot3d function works fine in X11 (which I think is how it worked before anyway). Whatever I may be missing, I don't think I'll notice. Best, Mark On Apr 13, 2012, at 11:08 AM, Duncan Murdoch wrote:

Re: [R] #!/usr/bin/env Rscript --vanilla ??

2012-04-13 Thread Berend Hasselman
On 13-04-2012, at 10:32, Martin Maechler wrote: > I think that's my first true question (rather than answer) > to R-help. > > As R has, for a long time, become my primary scripting and > programming language, I'm prefering at times to write Rscript > files instead of shell scripts, notably when

Re: [R] writing spdiags function for R

2012-04-13 Thread Ben Bolker
Moreno I. Coco sms.ed.ac.uk> writes: [snip snip snip] > > So, I have written my own spdiags function (below); following > also a suggestion in an old, and perhaps unique post, about > this issue. > > It works only for square matrices (that's my need), however I > have a couple of issues, mai

Re: [R] Displayed Date Format in Plot Title.

2012-04-13 Thread R. Michael Weylandt
as.Date() attemps to coerce a character string to a date where you specify the input format -- if you want to specify an output format, you need ?strftime [str + f + time == string format time] E.g., titleDate <- as.Date("2011-05-03", format = "%Y-%m-%d") plot(1:10, main = strftime(titleDate, "%

Re: [R] Help - Importing data from txt and xlsx files

2012-04-13 Thread MacQueen, Don
Have you correctly set the value of the 'sep' argument to read.table? -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 4/13/12 7:28 AM, "AMFTom" wrote: >Dear Thierry, > >Thanks for your help. Now though, I try to impor

Re: [R] Help - Importing data from txt and xlsx files

2012-04-13 Thread jim holtman
This is a case where you need to provide a sample of your data. Most likely it is not in a format that read.table can read with the parameters you have given it. It may have different field separators, it might have "#" in data fields, you might have unbalanced quotes, etc. So it is a problem in

Re: [R] vif calculation with car and HH packages

2012-04-13 Thread Özgür Asar
Dear Prof. Fox, I got the point, things are clear now. Thank you very much, Best wishes Ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309 -- View this message in conte

[R] Displayed Date Format in Plot Title.

2012-04-13 Thread Sam Albers
Hello all, I can't seem to figure out how to format a date as a title. I have something like this: plot(x=1:10, y=runif(10,1,18), main=paste(as.Date("2011-05-03", format="%Y-%m-%d"))) ## When I would really like this plot(x=1:10, y=runif(10,1,18), main=paste("May-03-2011")) ## I thought to try

[R] problem with svyby and NAs (survey package)

2012-04-13 Thread A.F.Fenton
Hello I'm trying to get the proportion "true" for dichotomous variable for various subgroups in a survey. This works fine, but obviously doesn't give proportions directly: svytable(~SurvYear+problem.vandal, seh.dsn, round=TRUE) problem.vandal SurvYear FALSE TRUE 1995 8906 786

[R] could not find function when compiling PDF

2012-04-13 Thread damiloveu
Hi all, I could use the function when I am in the console. After I finish my assignment and compile them to the pdf, there was an error said, could not find the function XXX. How come this happen? I am a new user to R. Thanks for everyone's help! -- View this message in context: http://r.789695

Re: [R] Remove superscripts from HTML objects

2012-04-13 Thread Chris Stubben
Sorry if I was not clear. I wanted to remove the superscripts using xpath queries if possible. For example this will get p nodes with superscripts, but how do I remove the superscripts if there are many matching nodes and different superscripts? xpathSApply(doc, "//p[sup]", xmlValue) [1] "Cata"

Re: [R] correlation matrix between data from different files

2012-04-13 Thread Rui Barradas
Hello, jeff6868 wrote > > Dear users, > > I'm quite a new french R-user, and I have a problem about doing a > correlation matrix. > I have temperature data for each weather station of my study area and for > each year (for example, a data file for the weather station N°1 for the > year 2009, a

Re: [R] could not find function when compiling PDF

2012-04-13 Thread damiloveu
it works in console, like this: > mult.corr(X,Y) $mult.corr [1] 0.8382398 $p.mult [1] 3.570699e-12 $partial.corr [1] 0.18447499 -0.09837888 0.12007457 $p.partial [1] 0.2094076 0.5058976 0.4162641 and it doesn't work when compiling. Error: chunk 3 (label = ques3) Error in eval(expr, envir, e

Re: [R] [BioC] Read .idat Illumina files in R

2012-04-13 Thread grimbough
I posted this to BioC yesterday, but I'll include it here for completeness: The expression array idats are indeed encrypted. However you can read them using the package available here: http://www.compbio.group.cam.ac.uk/Resources/IDATreader/ You can get back a data.frame containing the summar

Re: [R] Partial Dependence and RandomForest

2012-04-13 Thread jmc
Thank you Andy. I obviously neglected to read into the help file and, frustratingly, could have known this all along. However, I am still interested in knowing the relative maximum value in the partial plots via query instead of visual interpretation (and possibly getting at other statistical mea

Re: [R] Applying a function to categorized data?

2012-04-13 Thread Robert Latest
Hello Steve, thank you for your reply. You're right, just before I read your post I'd found aggregate() and indeed it brought me a long way towards my goal. I've been a C programmer for 20+ years, and I'm fairly firm in SQL, so to understand R I need to lose my scalar and row (record) oriented th

Re: [R] Help - Importing data from txt and xlsx files

2012-04-13 Thread AMFTom
Dear Thierry, Thanks for your help. Now though, I try to import data from a txt file, and it says either > mydataframe <- read.table("Lv2.8.txt") Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 3 did not have 15 elements or > mydataframe <- read.table("Lv

Re: [R] Gradients in bar charts XXXX

2012-04-13 Thread Greg Snow
Here is one approach: tmp <- rbinom(10, 100, 0.78) mp <- barplot(tmp, space=0, ylim=c(0,100)) tmpfun <- colorRamp( c('green','yellow',rep('red',8)) ) mat <- 1-row(matrix( nrow=100, ncol=10 ))/100 tmp2 <- tmpfun(mat) mat2 <- as.raster( matrix( rgb(tmp2, maxColorValue=255), ncol=10) ) for(i in

Re: [R] vif calculation with car and HH packages

2012-04-13 Thread John Fox
Dear Özgür, car::vif() produces a warning, not an error. It will proceed to compute VIFs based on the correlation matrix of the coefficients (take a look at car:::vif.lm) even if there is no intercept, and even though this would not normally correspond to variance inflation due to correlation o

Re: [R] using wildcards in download.file?

2012-04-13 Thread steven mosher
one way to solve your problem is to fetch the directory using rcurl. then mapply using the dirlist as a parameter passed to download file On Apr 13, 2012 9:24 AM, "MacQueen, Don" wrote: > If you take a thorough look at the help page for download.file, and follow > its advice, you may find a solut

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-13 Thread Frank Harrell
Make sure you use the log S(t) basis on both systems (and avoid log-log S(t) basis as this results in instability in the front part of the survival curve). Frank Paul Miller wrote > > Hi Enrico, > > Not sure how SAS builds the CI but I can look into it. The SAS > documentation does have a sectio

Re: [R] caret package: custom summary function in trainControl doesn't work with oob?

2012-04-13 Thread Max Kuhn
Matt, > I've been using a custom summary function to optimise regression model > methods using the caret package. This has worked smoothly. I've been using > the default bootstrapping resampling method. For bagging models > (specifically randomForest in this case) caret can, in theory, uses the >

[R] vif calculation with car and HH packages

2012-04-13 Thread Özgür Asar
Dear all, I have faced a problem while calculating VIF values via the packages, car and HH for the models witout intercepts. Below is an illustrative example: 1) via the car package > y<-rnorm(100,0,1) > x1<-rnorm(100,0,1) > x2<-rnorm(100,0,1) > x3<-rnorm(100,0,1) > model1<-lm(y~-1+x1+x2+x3) > m

Re: [R] R Large Dataset Problem

2012-04-13 Thread jim holtman
When using 'scan' I had no problem reading a string that had 1000 'columns' > x <- scan('/temp/tempxx.txt', what = list(0L, '')) Read 14 records > > str(x) List of 2 $ : int [1:14] 129876 129876 129876 129876 129876 129876 129876 129876 129876 129876 ... $ : chr [1:14] "10101011100000011

Re: [R] using wildcards in download.file?

2012-04-13 Thread MacQueen, Don
If you take a thorough look at the help page for download.file, and follow its advice, you may find a solution. Hint: The help page for download.file says, -- quote -- The function 'download.file' can be used to download a single file as described by 'url' from the internet and store it in

Re: [R] Long command in Sweave

2012-04-13 Thread Gavin Simpson
I use Emacs and ESS, with the coding standards in one of the R manuals. I have to insert the carriage returns where I want them, but Emacs/ESS indents the code correctly G On Fri, 2012-04-13 at 22:17 +0800, Wincent wrote: > Thanks, Gavin and Duncan. > > In that case, what I need is a suitable ed

Re: [R] Long command in Sweave

2012-04-13 Thread Yihui Xie
You can probably try knitr; see the manual for example: https://github.com/downloads/yihui/knitr/knitr-manual.pdf Code reformatting is based on the formatR package (https://github.com/yihui/formatR/wiki), which tries to preserve your comments while breaking your long lines into shorter ones. Howe

Re: [R] how to read netcdf file in R

2012-04-13 Thread David William Pierce
On Fri, Apr 13, 2012 at 12:09 AM, Yogesh Tiwari wrote: > Dear David, > > Thanks, > > I could read and open .nc file in R, but now how to plot a simple filled > color. [...] Hi Yogesh, glad to hear that the ncdf package is doing its job correctly. I'm sure you understand that I don't have the res

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-13 Thread Paul Miller
Hi Enrico, Not sure how SAS builds the CI but I can look into it. The SAS documentation does have a section on computational formulas at: http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_lifetest_a000259.htm Although I can't provide my dataset, I can p

Re: [R] Execution speed in randomForest

2012-04-13 Thread Liaw, Andy
Without seeing your code, it's hard to say much more, but do avoid using formula when you have large data. Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jason & Caroline Shaw Sent: Friday, April 06, 2012 1:20 PM To: jim ho

Re: [R] Long command in Sweave

2012-04-13 Thread Wincent
Thanks, Gavin and Duncan. In that case, what I need is a suitable editor which can break the command properly. All the best On 13 April 2012 19:33, Gavin Simpson wrote: > On Fri, 2012-04-13 at 17:46 +0800, Wincent wrote: >> Dear useRs, >> >> I am writing a vignette for a package, which contains

Re: [R] Simple Problem: Plotting mathematical functions

2012-04-13 Thread R. A. Bilonick
On 04/12/2012 09:11 PM, David Winsemius wrote: On Apr 12, 2012, at 3:49 PM, Aye wrote: Okay, i got this far: f <- function(x) 0.25*x^2 + 6.47*x -32.6 g <- function(x) 0.99*x^2 -6*x -195 h <- function(x) 0.77*x^2 +14*x -495 j <- function(x) 0.001*x^2 + 65*x -785 k <- function(x) 0.9*x^2 -2*x -6

[R] list.dirs() full.names broken?

2012-04-13 Thread J Toll
Hi, I am trying to list all the sub-directories in a particular directory and having a few issues. list.dirs seems to be slightly broken and/or poorly labelled. My issue appears to be the same as this one, from the archives: http://tolstoy.newcastle.edu.au/R/e16/help/11/11/1156.html Here is so

[R] group comparison for ordinal variable

2012-04-13 Thread Weiwei Shi
Hi there, I have a task of two group samples' comparison for ordinal variable, the possible values are from 0 to 3 with many many ties for about 60 samples totally. I am wondering if wilcox test is a proper one and which wilcox test like a regular wilcox.test in R or the version wilcox_test in pac

Re: [R] loess function take

2012-04-13 Thread Bert Gunter
Since you have only one dependent variable, try using lowess() instead. It is less flexible -- only does local linear robust fitting -- but has arguments built in that allow you to sample and interpolate and limit the number of robustness iterations. It runs considerably faster as a result. -- Ber

Re: [R] getting the value from previous row

2012-04-13 Thread Milan Bouchet-Valat
Le vendredi 13 avril 2012 à 06:09 -0700, arunkumar a écrit : > Hi > > I've a dataset with record A = 100,200,300,400... > > There will be a parameter n. say n=10 means i have add 10% of previous > value to the current row > > current_Val New_value > 100 100 > 200

Re: [R] Partial Dependence and RandomForest

2012-04-13 Thread Liaw, Andy
Please read the help page for the partialPlot() function and make sure you learn about all its arguments (in particular, "which.class"). Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jmc Sent: Wednesday, April 11, 2012 2:4

Re: [R] loess function take

2012-04-13 Thread Liaw, Andy
Alternatively, use only a subset to run loess(), either a random sample or something like every other k-th (sorted) data value, or the quantiles. It's hard for me to imagine that that many data points are going to improve your model much at all (unless you use tiny span). Andy From: r-help-b

Re: [R] How do I convert factors to numeric? It's an FAQ but...

2012-04-13 Thread David Winsemius
On Apr 13, 2012, at 9:08 AM, John Coulthard wrote: Dear R list people I loaded a file of numbers into R and got a dataframe of factors. So I tried to convert it to numeric as per the FAQ using as.numeric(). Actually you used as.numeric(as.character()) which should have been successful

Re: [R] #!/usr/bin/env Rscript --vanilla ??

2012-04-13 Thread Dirk Eddelbuettel
On 13 April 2012 at 10:32, Martin Maechler wrote: | I think that's my first true question (rather than answer) | to R-help. | | As R has, for a long time, become my primary scripting and | programming language, I'm prefering at times to write Rscript | files instead of shell scripts, notably whe

Re: [R] How do I convert factors to numeric? It's an FAQ but...

2012-04-13 Thread ONKELINX, Thierry
f is a dataframe of factor, not a factor use either as.numeric(levels(f$your.factor))[f$your.factor] or if f only contains factors apply(f, 2, function(x){as.numeric(levels(x))[x]}) ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Bio

Re: [R] How do I convert factors to numeric? It's an FAQ but...

2012-04-13 Thread Milan Bouchet-Valat
Le vendredi 13 avril 2012 à 13:08 +, John Coulthard a écrit : > Dear R list people > > I loaded a file of numbers into R and got a dataframe of factors. So I tried > to convert it to numeric as per the FAQ using as.numeric(). But I'm getting > errors (please see example), so what am I gett

Re: [R] R Large Dataset Problem

2012-04-13 Thread Milan Bouchet-Valat
Le vendredi 13 avril 2012 à 05:44 -0700, efulas a écrit : > Thank you very much for your helps guys. Both message help me to run the data > in R. However, R is omitting many columns from my data. Am i missing > something? Please read the posting guide. If you don't provide the code you ran and the

[R] getting the value from previous row

2012-04-13 Thread arunkumar1111
Hi I've a dataset with record A = 100,200,300,400... There will be a parameter n. say n=10 means i have add 10% of previous value to the current row current_Val New_value 100 100 200210 (200+10) 300330( 300 +20+10) 400

[R] How do I convert factors to numeric? It's an FAQ but...

2012-04-13 Thread John Coulthard
Dear R list people I loaded a file of numbers into R and got a dataframe of factors. So I tried to convert it to numeric as per the FAQ using as.numeric(). But I'm getting errors (please see example), so what am I getting wrong? Thanks for your time. John Example... #my data object > f

[R] Boxcox transformation

2012-04-13 Thread ruchi
I am time series data in Eviews to see the fitting of logistic and gompertz model with my data. I used NLS and then the Box cox transformation. I need to see my graph of original data Vs predicted values / fiited values on single graph . I cam do this when dealing only with NLS but I am not able t

Re: [R] Help - Importing data from txt and xlsx files

2012-04-13 Thread ONKELINX, Thierry
Dear Tom, R does not searches your entire file system for the file. It only looks in the working directory. Have a look at ?setwd() and ?getwd() So you will need to set the working directory, use a relative path to the file or use and absolute path to the file. Best regards, ir. Thierry Onkel

Re: [R] R Large Dataset Problem

2012-04-13 Thread efulas
Thank you very much for your helps guys. Both message help me to run the data in R. However, R is omitting many columns from my data. Am i missing something? Many Thanks -- View this message in context: http://r.789695.n4.nabble.com/R-Large-Dataset-Problem-tp4554469p4554698.html Sent from the

Re: [R] Organizations where IT has approved the use of R software

2012-04-13 Thread lynnland
Hi All, Thanks for all the responses and interest. I was aware of Revolution Analytics and had seen some of the other links but some were new. The list received should be of great help. Given the R courses that used to be offered through the USGS site, I would assume they are using it but have

Re: [R] Remove superscripts from HTML objects

2012-04-13 Thread S Ellison
> h <- "CataDog" > sub("","",h) Probably safer to do gsub("","",h) to avoid replacing multiple superscripts. eg h2 <- "CataDogMouseaRaccoon" sub("","",h2) #drops everything between first gsub("","",h2)#Drops each xxx ***

Re: [R] Help with vectorization

2012-04-13 Thread Filoche
Thank you all. Problem solved. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Help-with-vectorization-tp4552638p4554565.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list h

[R] Help - Importing data from txt and xlsx files

2012-04-13 Thread AMFTom
Hi all, I have just started to use R for my PhD project and have no previous experience in programming. I am having trouble importing data to R. This is the output: > mydata <- read.table("Lv2.8.txt") Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(

Re: [R] R Large Dataset Problem

2012-04-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/04/12 14:20, Milan Bouchet-Valat wrote: > Le vendredi 13 avril 2012 à 04:32 -0700, efulas a écrit : >> Dear All, >> >> I have a problem with my data. First problem is that my data is really large >> and R is >> omitting some columns from my dat

Re: [R] R Large Dataset Problem

2012-04-13 Thread Alekseiy Beloshitskiy
I would perform data pre-processing before loading in R. Best, -Alex From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of efulas [ef_u...@hotmail.com] Sent: 13 April 2012 14:32 To: r-help@r-project.org Subject: [R] R Large Datase

Re: [R] scatterplot3d(); customise axes

2012-04-13 Thread Uwe Ligges
On 13.04.2012 09:52, Tonja Krueger wrote: Hi all! I’m using scatterplot3d() to show the distribution of data for different locations. As I wound like to show distances between the locations and also label the locations, I was wondering whether there is a function similar to

Re: [R] R Large Dataset Problem

2012-04-13 Thread Milan Bouchet-Valat
Le vendredi 13 avril 2012 à 04:32 -0700, efulas a écrit : > Dear All, > > I have a problem with my data. First problem is that my data is really > large and R is omitting some columns from my data. Is there any way to read > the whole data without omitting. How did you import it? Please be precis

[R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-13 Thread Paul Miller
Hello All,   Am replicating in R an analysis I did earlier using SAS. See this as a test of whether I'm ready to start using R in my day-to-day work.   Just finished replicating a Kaplan Meier analysis. Everything seems to work out fine except for one thing. The 95% CI around my estimate for the

Re: [R] Plotting leapfrog in R

2012-04-13 Thread Jim Lemon
On 04/13/2012 12:25 PM, Colstat wrote: Dear List Is there a package for leapfrog plotting (Hamiltonian Monte Carlo estimation) in R? I tried the actual "LEAPFrOG" package which doesn't actually give the plot like this one? http://xianblog.files.wordpress.com/2010/09/hamilton.jpg How doe one pl

[R] R Large Dataset Problem

2012-04-13 Thread efulas
Dear All, I have a problem with my data. First problem is that my data is really large and R is omitting some columns from my data. Is there any way to read the whole data without omitting. Another problem is that my data have 102k columns and each column have active or inactive molecules. The da

Re: [R] Help with stemDocument

2012-04-13 Thread Alekseiy Beloshitskiy
Check this slideshare.net/whitish/textmining-with-r Best, -Alex From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf of Deborah H. Deng [deborah.d...@alumni.utexas.net] Sent: 13 April 2012 10:27 To: r-help@r-project.org Subject: [R]

[R] Week number of a date in a month

2012-04-13 Thread arunkumar1111
Hi I have a requirement such that a a week should be ending on sunday. monday is the week start date. if a month start on sunday. then 2nd day of the month the monday will be in week 2 I need help in creating the week number - Thanks in Advance Arun -- View this message in contex

  1   2   >