[R] estimate value from simulations

2013-05-16 Thread Zilefac Elvis
Hello, I need your help on this matrix:    1 1 1 1 1 1  2 2 2 2 2 2  3 3 3 3 3 3   5 5 5 5 5 5  2 2 2 2 2 2  3 3 3 3 3 3   6 6 6 6 6 6  2 2 2 2 2 2  3 3 3 3 3 3   1 1 1 1 1 1  2 2 2 2 2 2  3 3 3 3 3 3  First three rows represent first simulation, next three rows = second simulation etc. I

Re: [R] estimate value from simulations

2013-05-16 Thread Pascal Oettli
Hi, You probably should read R documentation and learn how to use seq ?seq ?rowMeans HTH, Pascal On 05/16/2013 03:17 PM, Zilefac Elvis wrote: Hello, I need your help on this matrix: 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 5 5 5 5 5 5 2 2 2 2 2 2 3 3 3 3 3 3 6 6 6 6 6 6 2 2 2

Re: [R] Loop through a simulation

2013-05-16 Thread arun
HI, Try this: dat1- read.csv(data2.csv,header=FALSE,sep=\t)   dim(dat1) #[1] 345156  5 res- aggregate(V5~V2+V3+V4,data=dat1,FUN=mean)  dim(res) #[1] 16436 4  head(res) #    V2 V3 V4 V5 #1 1961  1  1 0.51761905 #2 1962  1  1 0.0467 #3 1963  1  1 1.14761905 #4 1964  1  1

Re: [R] How to suppress default legend in plot.cuminc()

2013-05-16 Thread rob
You could also try the following: plot(xx,lty=1,color=1:6,wh=c(0,3)) The wh-argument sets the coordinates for the topleft corner of the legend-box. By giving coordinates that fall outside the plot no legend will appear. You can later add a custom legend with the legend()-function. Hope this

Re: [R] mosaic plot (vcd)

2013-05-16 Thread Achim Zeileis
On Wed, 15 May 2013, Vanessa Vetter wrote: Hello everyone, is there a way to increase the distance between the legend label of the Pearson residuals and the bar, which shows the color of the residuals, in the mosaic plot argument (see picture attached)? The minus signs of the

[R] R 3.0.1 is released

2013-05-16 Thread Peter Dalgaard
The build system rolled up R-3.0.1.tar.gz (codename Good Sport) this morning. The list below details the changes in this release. You can get the source code from http://cran.r-project.org/src/base/R-3/R-3.0.1.tar.gz or wait for it to be mirrored at a CRAN site nearer to you. Binaries for

Re: [R] R-Help: nparLD Package Non-parametric Repeated Measures

2013-05-16 Thread Gerrit Eichner
Hello, James, see my comments inline. ... Main issue/question: In R the nparLD ANOVA-type Test showed a significant p-value for diel period, no effect of season, and no interaction between diel period and season. But a post-hoc Wilcoxon Signed-Rank Test did NOT find a significant difference

Re: [R] estimate value from simulations

2013-05-16 Thread Rui Barradas
Hello, Try the following. mat - matrix(scan(text = 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 5 5 5 5 5 5 2 2 2 2 2 2 3 3 3 3 3 3 6 6 6 6 6 6 2 2 2 2 2 2 3 3 3 3 3 3 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3 ), ncol = 6, byrow = TRUE) idx - 1 + (seq_len(nrow(mat)) - 1) %% 3 aggregate(mat,

[R] reconstructing original series based on differenced data

2013-05-16 Thread Preetam Pal
Hi all, I have a time series X_t which has been differenced thrice to get Y_t. I know these y values only and nothing else. Is there a function in R which can be used to lead back to the original X_t's? Any help is welcome. Thanks, Preetam -- Preetam Pal (+91)-9432212774 M-Stat 2nd Year,

[R] Failed to open *.img in rgdal

2013-05-16 Thread Eddie Smith
Hi guys, Anybody willing to help? SST1982003 - readGDAL(daily_sst_1982003_nighttime.img) Error in SST1982003 - readGDAL(daily_sst_1982003_nighttime.img) : invalid (do_set) left-hand side to assignment The data can be downloaded from googledrive

Re: [R] reconstructing original series based on differenced data

2013-05-16 Thread Berend Hasselman
On 16-05-2013, at 11:52, Preetam Pal lordpree...@gmail.com wrote: Hi all, I have a time series X_t which has been differenced thrice to get Y_t. I know these y values only and nothing else. Is there a function in R which can be used to lead back to the original X_t's? Brute force

Re: [R] Failed to open *.img in rgdal

2013-05-16 Thread Pascal Oettli
Hi, I am able to read it by changing the name inside your example... ('daily_sea_surface_temperature_1982003_night.img') summary(SST1982003) Object of class SpatialGridDataFrame Coordinates: min max x 96.5 165.5 y -16.5 26.5 Is projected: FALSE proj4string : [+proj=longlat +datum=WGS84

Re: [R] Failed to open *.img in rgdal

2013-05-16 Thread Eddie Smith
Thanks Pascal. Got it! Is there any option that I could read many images in one go? 200 images in a folder for example? On Thu, May 16, 2013 at 11:22 AM, Pascal Oettli kri...@ymail.com wrote: Hi, I am able to read it by changing the name inside your example...

Re: [R] How to capture the expression corresponding to the i param in the [ function

2013-05-16 Thread Nhan Vu Lam Chi
Sorry David for this belate thank. Your code helped me so much. I tested a class that does not inherit the data.frame class and it also worked. Maybe I had problems with different kinds of method signatures of [ function. For example, this does not work: setMethod([, signature(x=BigDataFrame,

Re: [R] Failed to open *.img in rgdal

2013-05-16 Thread Michael Sumner
Not really in one go, but, R has basic string functions and looping. See ?list.files, ?file.path and ?Control, and probably ?sprintf. Though, there is the raster package which will read (on demand) all the rasters into a single object from many files, as long as they share the same spatial extent

[R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Öhagen Patrik
I have, say, three plots with several medical terms on the y-axis plotted against HR's on a log-scaled x-axis. In order to highlight the time profile for the different plots, I would like to merge (put them next to each other, if that makes sense) together the log scaled x-axises and present

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Jim Lemon
On 05/16/2013 09:50 PM, Öhagen Patrik wrote: I have, say, three plots with several medical terms on the y-axis plotted against HR's on a log-scaled x-axis. In order to highlight the time profile for the different plots, I would like to merge (put them next to each other, if that makes sense)

Re: [R] recode categorial vars into binary data

2013-05-16 Thread Alain D.
Hi David, [This is a late reaction to a question I posted some time ago...] thanks to your suggestion I found another solution which does carry out the random assignment. df[,2] - as.numeric( rank(df[,2],ties.method=random) length(df[,2])/2 ) Maybe this will be of interest to the R-List (and

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread John Kane
Can you supply us with a bit of sample data? It's not clear from your description of the problem if you are working with equivalent x -scales where it would be very easy to just plot all curves on one plot or if there are scale or item differences that might require diffferent panels.

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Öhagen Patrik
Hi Jim,Thank you for your input! I am working with the text and arrow command in each of the graphs. I think it would be far to messy to plot them all in one graph (50+ point estimates and confidence intervals). par(mfrow=c(1,3)) is a step in the proper direction but I fail to see how I can

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Öhagen Patrik
Hi John, Thank you for your input! The thing is that the graph would be to messy if I plotted all the data in a single plot. I wish I could share some data but I am all of the stuff is highly confidential. Sorry. Cheers, Patrik -Ursprungligt meddelande- Från: John Kane

Re: [R] animating plots over time with a slider

2013-05-16 Thread Adams, Jean
Gavin, This works for numeric version of dates. I changed the name of your data frame from c to df. Jean df - c rm(a, Start, End, dates, b, c) library(rpanel) df$znum - as.numeric(df$z) stopznum - median(df$znum) if (interactive()) { hist.draw - function(panel) { mydat -

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Duncan Murdoch
On 16/05/2013 7:50 AM, Öhagen Patrik wrote: I have, say, three plots with several medical terms on the y-axis plotted against HR's on a log-scaled x-axis. In order to highlight the time profile for the different plots, I would like to merge (put them next to each other, if that makes sense)

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread John Kane
Okay so you do want independent panels. When I asked for sample data it does not have to be anything real. All we need is something that has a similar data structure. We can do the same type of graph with earhquake data, medical data or voter response. Just substite random names for the

Re: [R] estimate value from simulations

2013-05-16 Thread arun
May be this helps: mat1- as.matrix(read.table(text=  1 1 1 1 1 1  2 2 2 2 2 2  3 3 3 3 3 3  5 5 5 5 5 5  2 2 2 2 2 2  3 3 3 3 3 3  6 6 6 6 6 6  2 2 2 2 2 2  3 3 3 3 3 3  1 1 1 1 1 1  2 2 2 2 2 2  3 3 3 3 3 3 ,sep=,header=FALSE)) colnames(mat1)- NULL  t(sapply(1:3,function(i)

Re: [R] matrix - pairwise comparison of columns

2013-05-16 Thread Hermann Norpois
Thank you very much. This was very helpful. Exactly what I wanted. thanks Hermann 2013/5/16 arun smartpink...@yahoo.com Hi, May be this helps: c1-combn(seq_len(ncol(m)),2) mat1- matrix(0,ncol=3,nrow=3,dimnames=list(colnames(m),colnames(m)))

Re: [R] Fwd: NaN-result from fuzzy_inference (package sets) with certain input

2013-05-16 Thread David Meyer
The problem is a numeric issue. As a quick (and dirty!) fix, you can use FUN - matchfun(function(x,y) isTRUE(all.equal(x,y))) `%is%` - function(x, y) cset_charfun(cset(x, matchfun = FUN))(y) before calling fuzzy_inference(). I will probably have to change the fuzzy stuff to csets with FUN as

[R] R looping help

2013-05-16 Thread rishard
Hey I'm not really sure what I should put on here, but I am having trouble with my R code. I am trying to get the p-values, R^2s etc for a number of different groups of variables that are all in one dataset. This is the code: #Stand counter st-1 #Collections stands-numeric(67)

[R] Trouble Runing R Version 2.13.0

2013-05-16 Thread ziad.elmously
To Whom It May Concern, I have an R script that requires the Windows XP platform, version 2.13.0. When launching R, however, I get the error message below: Error in loadNamespace(name). there is no package called kernlab. Unable to restore saved data in .RData. Note that I also have version

Re: [R] erreur dans R

2013-05-16 Thread John Kane
It is better if we have the question in English also. C'est meillier si nous avons le question en Anglais aussi. Et un exemple. Voir/See https://github.com/hadley/devtools/wiki/Reproducibilityhttps://github.com/hadley/devtools/wiki/Reproducibility

Re: [R] 3d interactive video using the rgl package

2013-05-16 Thread Duncan Murdoch
On 16/05/2013 4:06 AM, Xavier Hoenner wrote: Hi all, I've been using the 'rgl' package to visualise in 3d the water temperature recorded by a glider deployed off the coast of Australia (see snapshot attached). Using the writeWebGL function, I'm able to produce an html file of the scene with

Re: [R] animating plots over time with a slider

2013-05-16 Thread Adams, Jean
Good! Glad to hear it. Post questions for further guidance to R-help. Jean On Thu, May 16, 2013 at 8:49 AM, Gavin Rudge g.ru...@bham.ac.uk wrote: Hi Jean, ** ** Many thanks for your help. I’ve only been playing with your solution for a few minutes and I’ve learned some really

Re: [R] Trouble Runing R Version 2.13.0

2013-05-16 Thread Duncan Murdoch
On 16/05/2013 7:00 AM, ziad.elmou...@tnsglobal.com wrote: To Whom It May Concern, I have an R script that requires the Windows XP platform, version 2.13.0. When launching R, however, I get the error message below: Error in loadNamespace(name). there is no package called kernlab. Unable to

[R] How to extract value from image in R ?

2013-05-16 Thread Kristi Glover
Hi R User, I am wondering how I can extract the value and want to see the value in table. Is there way? suppose I do have image (raster package) r class : RasterLayer dimensions : 192, 186, 35712 (nrow, ncol, ncell) resolution : 0.5, 0.5 (x, y) extent : -125, -32, -56, 40

Re: [R] How to extract value from image in R ?

2013-05-16 Thread Michael Sumner
tab - cbind(coordinates(r), as.data.frame(r)) should do it. Also, R-Sig-Geo is a mailing list specific for this topic On Fri, May 17, 2013 at 12:21 AM, Kristi Glover kristi.glo...@hotmail.com wrote: Hi R User, I am wondering how I can extract the value and want to see the value in table. Is

Re: [R] date and time coding question

2013-05-16 Thread MacQueen, Don
The difftime() function has a units argument, so it seems kind of obvious to me to think of objects of class 'difftime' as having units. And indeed they do, stored as an attribute: str(difftime( Sys.time()+3700, Sys.time(), units='min')) Class 'difftime' atomic [1:1] 61.7 ..- attr(*, units)=

Re: [R] date and time coding question

2013-05-16 Thread William Dunlap
you should think of the result of converting from difftime to numeric (using as.numeric) as the opportunity (or rather requirement) to specify what time units you want. Here is an example of the trouble you can have if you do not specify the units when converting a difftime object to a

[R] Fwd: empirical and GPD for time series simulation

2013-05-16 Thread Al Ehan
Hi, Does anyone know how to simulate a long time series (say 1000 daily series) or generally a series, with inverse empirical distribution and generalized pareto distribution (meaning to say the time series has a marginal distribution of empirical and GPD distribution.) using the R package? Does

[R] Fwd: empirical and GPD for time series simulation

2013-05-16 Thread Al Ehan
Hi, Does anyone know how to simulate a long time series (say 1000 daily series) or generally a series, with inverse empirical distribution and generalized pareto distribution (meaning to say the time series has a marginal distribution of empirical and GPD distribution.) using the R package? Does

Re: [R] Help with how to process multiple column variable in a read.table

2013-05-16 Thread arun
Hi, Try this: unemp.wy - read.table(ftp://ftp.bls.gov/pub/time.series/la/la.data.59.Wyoming;, header=TRUE, sep=\t,stringsAsFactors=FALSE,na.strings=) dim(unemp.wy) #[1] 46692 5  head(unemp.wy) #  series_id year period value footnote_codes #1 LASST5603 1976    M01   4.2   

[R] Contour lines in a persp plot

2013-05-16 Thread smsome
Hello folks, i'm a R beginner and i want to put in a same plot both contour lines and persp plot. For example, fn-function(x,y){sin(x)+2*y} #this looks like a corrugated tin roof x-seq(from=1,to=100,by=1) #generates a list of x values to sample y-seq(from=1,to=100,by=1) #generates a list

[R] Error: contrasts can be applied only to factors with 2 or more levels

2013-05-16 Thread Belair, Ethan D
I have a dataframe that I am attempting to analyze using the lmList() function in package lme4. I'm using this funciton to select which parameters in this model wqarrant random effects. I have a subset of the data below. I input data and change class of necessary items so that I have several

[R] sapply error produced by grid search

2013-05-16 Thread Patel, Shreena
Dear R User, I'm trying to perform a grid-search for the ML estimator of the Box-Cox parameter for a linear mixed model. However using sapply to perform the grid search returns an error message. Here's a small example to demonstrate: library(lme4) # Function to fit model for a given lambda:

Re: [R] date and time coding question

2013-05-16 Thread Jeff Newmiller
I stand by my previous statement: you should avoid thinking of difftime objects as having units. At the point when you learn to regard the units argument as being associated with the numeric values you pass TO as.difftime or that you extract FROM a difftime object with as.numeric, then you will

Re: [R] Error: contrasts can be applied only to factors with 2 or more levels

2013-05-16 Thread John Kane
Beautiful first question. 333 ch.list - lmList(h12~spp+t+w+l+inih|id, data=mydata) Should that not be data= chm John Kane Kingston ON Canada -Original Message- From: ebel...@purdue.edu Sent: Thu, 16 May 2013 15:05:35 + To: r-help@r-project.org Subject: [R] Error: contrasts

Re: [R] estimate value from simulations

2013-05-16 Thread David Winsemius
On May 15, 2013, at 11:24 PM, Pascal Oettli wrote: Hi, You probably should read R documentation and learn how to use seq ?seq ?rowMeans HTH, Pascal On 05/16/2013 03:17 PM, Zilefac Elvis wrote: Hello, I need your help on this matrix: 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3

[R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-16 Thread Aldi
Hi, If I have an R object UUU, where the second element is U2, based on g column of my.table my.table of UUU is: mmm ggg gindex map Info aaa123 U1 1 1 1 aaa124 U1 1 2 1 bbb1378U2 2 1

Re: [R] sapply error produced by grid search

2013-05-16 Thread Berend Hasselman
On 16-05-2013, at 17:31, Patel, Shreena s.pate...@lancaster.ac.uk wrote: Dear R User, I'm trying to perform a grid-search for the ML estimator of the Box-Cox parameter for a linear mixed model. However using sapply to perform the grid search returns an error message. Here's a small

Re: [R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-16 Thread Rui Barradas
Hello, If I understood it correctly, the following should do it. fun1 - function(x, what, map, value){ y - x[[what]] i1 - seq_len(map - 1) i2 - seq_along(y)[-i1] x[[what]] - c(y[i1], value, y[i2]) x } fun2 - function(x, what, map, value){ y -

Re: [R] Contour lines in a persp plot

2013-05-16 Thread David Winsemius
On May 16, 2013, at 8:23 AM, sms...@univ-fcomte.fr wrote: Hello folks, i'm a R beginner and i want to put in a same plot both contour lines and persp plot. For example, fn-function(x,y){sin(x)+2*y} #this looks like a corrugated tin roof x-seq(from=1,to=100,by=1) #generates a list

Re: [R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-16 Thread Rui Barradas
Hello, Sorry, there's an error in fun2. Corrected: fun2 - function(x, what, map, value){ y - x[[what]] i1 - seq_len(map - 1) i2 - seq_len(nrow(y))[-i1] x[[what]] - rbind(y[i1, ], value, y[i2, ]) x } Rui Barradas Em 16-05-2013 17:54, Rui Barradas

[R] To List or Not To List

2013-05-16 Thread Sparks, John James
Dear R Helpers, A few weeks ago I asked for some help on how to accomplish modifications to data in a set of data frames. As part of that request I mentioned that I realized that one way to accomplish my goal was to put the data frames together in a list but that I was looking for a way to do it

Re: [R] Loop through a simulation

2013-05-16 Thread arun
Hi, May be this is what you meant. dat1- read.csv(data2.csv,header=FALSE,sep=\t) library(plyr) res1- ddply(dat1,.(V2,V3,V4),summarize,V5=round(mean(V5),2))  head(res1) #    V2 V3 V4   V5 #1 1961  1  1 0.52 #2 1961  1  2 0.00 #3 1961  1  3 0.00 #4 1961  1  4 0.00 #5 1961  1  5 0.12 #6 1961  1  6

[R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-16 Thread Aldi
Hi, If I have an R object UUU, where the second element is U2, based on g column of my.table my.table of UUU is: mmm ggg gindex map Info aaa123 U1 1 1 1 aaa124 U1 1 2 1 bbb1378 U2 2 1

Re: [R] how to calculate the mean in a period of time?

2013-05-16 Thread arun
Hi, The output you showed is not clear especially the for the scores3,   2                         2           2011-09-22    3     65            2.6       0.8            0.8 2                        3             2011-10-26   4      34            2.7     0.8            0.8 3                    

Re: [R] Error: contrasts can be applied only to factors with 2 or more levels

2013-05-16 Thread arun
Hi, The example dataset only shows 1 level for ID. chm   id site plot rx rxg rxl t w l spp inid inih d09  d10  d11  d12 h09 h10 1  1  C-H 2002  1   1  Mn N N 14.55  ac  9.6 74.5 9.6 13.0 13.5 14.2  96 109 2  1  C-H 2002  1   1  Mn N N 14.55  ac  7.4 69.5 6.0  9.8   NA 10.7  72  77 3  1  C-H

[R] connect to local mySQL database

2013-05-16 Thread Martin Batholdy
Hi, I would like to access a local mysql database. In python using the sqlite3 library it is quite straightforward. I just have to pass the path to the sqlite-file; sqlite3.connect('.../xy.sqlite') Is there something similar in R (or specifically in the RMySQL package)? It seems like I have

[R] Chi square 1 d.f.

2013-05-16 Thread Luis Fernando García Hernández
Dear Fellows, I am trying to find the exact p-value for some values using chisquare test with one d.f. So, for example the exact p-value for a calculated chi square of 14.62 would be 0,0038. I got this data on another software but I would like to know how to do it on R. Any advice will be really

[R] Why is it not working the MaxEnt analysis (package maxent, and dismo)?

2013-05-16 Thread Kristi Glover
Hi R-user, I was trying to compute probability of species distribution using MaxEnt. the MaxEnt uses only teh sites in which species present, I tried to run but did not work, would you give me some hints? I have given an example table and how I tried it.

Re: [R] connect to local mySQL database

2013-05-16 Thread Sarah Goslee
Hi Martin, Can you clarify: are you trying to connect to a mySQL database, or to a sqlite database? They're not at all the same thing, and I can't tell from your question which you're after. You need either RMySQL, or if you actually want an sqlite database, RSQLite or sqldf. Sarah On

Re: [R] Chi square 1 d.f.

2013-05-16 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Luis Fernando García Hernández Sent: Thursday, May 16, 2013 2:41 PM To: r-help@r-project.org Subject: [R] Chi square 1 d.f. Dear Fellows, I am trying to find the exact

Re: [R] connect to local mySQL database

2013-05-16 Thread Martin Batholdy
Can you clarify: are you trying to connect to a mySQL database, or to a sqlite database? It is a sqlite database. Thanks for pointing that out! Now it works just like in python ;). con - dbConnect(SQLite(), dbname=xy.sqlite) res - dbSendQuery(conn = con, SELECT * FROM table1 WHERE x = y)

Re: [R] Chi square 1 d.f.

2013-05-16 Thread peter dalgaard
On May 16, 2013, at 23:41 , Luis Fernando García Hernández wrote: Dear Fellows, I am trying to find the exact p-value for some values using chisquare test with one d.f. So, for example the exact p-value for a calculated chi square of 14.62 would be 0,0038. I got this data on another

Re: [R] Trouble Runing R Version 2.13.0

2013-05-16 Thread Uwe Ligges
On 16.05.2013 15:54, Duncan Murdoch wrote: On 16/05/2013 7:00 AM, ziad.elmou...@tnsglobal.com wrote: To Whom It May Concern, I have an R script that requires the Windows XP platform, version 2.13.0. When launching R, however, I get the error message below: Error in loadNamespace(name).

Re: [R] R looping help

2013-05-16 Thread MacQueen, Don
You can use basic debugging techniques to help understand what is going wrong. For example, insert a cat() statement right before the statement which is giving the warning. Like this: ## your code mses[st]-sum(resid(model)^2)/(length(xi)-2) ssr-var(yi)*(length(xi)-1)-sum(resid(model)^2) ##

[R] strftime

2013-05-16 Thread Dominic Roye
Hello, I'm a little surprised about the result of strftime for my data. str(time) chr [1:315504] 2006-01-01 00:10:00 2006-01-01 00:20:00 2006-01-01 00:30:00 ... str(strftime(time,format=%Y-%m-%d %H:%M:%S)) chr [1:315504] 2006-01-01 00:00:00 2006-01-01 00:00:00 2006-01-01 00:00:00 ... Why

Re: [R] To List or Not To List

2013-05-16 Thread William Dunlap
You can use an environment with much of the same syntax that you use a list; in particular assign() and get() are not needed because you can use env[[name]] instead of assign(name, envir=env) and get(name, envir=env). You are using quantmod so I assume you are using getSymbols() to retrieve the

Re: [R] Loop through a simulation

2013-05-16 Thread Zilefac, Elvis
Thanks AK. It works as expected. Atem. From: arun [smartpink...@yahoo.com] Sent: Thursday, May 16, 2013 11:16 AM To: Zilefac, Elvis Cc: R help Subject: Re: Loop through a simulation Hi, May be this is what you meant. dat1-

[R] convert a data.frame to matrix

2013-05-16 Thread Hermann Norpois
Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). jam vec1 vec3 d1 d2 1 172 173 223 356 dput (jam) structure(list(vec1 = 172L, vec3 = 173L, d1 = 223L, d2 = 356L), .Names =

Re: [R] convert a data.frame to matrix

2013-05-16 Thread Sarah Goslee
Why not simply: matrix(jam, ncol=2) [,1] [,2] [1,] 172 223 [2,] 173 356 On Thu, May 16, 2013 at 4:46 PM, Hermann Norpois hnorp...@gmail.com wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and

Re: [R] strftime

2013-05-16 Thread David Winsemius
On May 16, 2013, at 10:43 AM, Dominic Roye wrote: Hello, I'm a little surprised about the result of strftime for my data. str(time) chr [1:315504] 2006-01-01 00:10:00 2006-01-01 00:20:00 2006-01-01 00:30:00 ... str(strftime(time,format=%Y-%m-%d %H:%M:%S)) chr [1:315504] 2006-01-01

Re: [R] convert a data.frame to matrix

2013-05-16 Thread David Winsemius
On May 16, 2013, at 1:46 PM, Hermann Norpois wrote: Hello, I fail to tranfer data from a dataframe to a matrix. jam is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). jam vec1 vec3 d1 d2 1 172 173 223 356 dput (jam)

Re: [R] Error: contrasts can be applied only to factors with 2 or more levels

2013-05-16 Thread Rolf Turner
In the example data that you provide, the factor id has only one level, namely 1. Your example date appears to be just the head (first 6 rows) of your real data, so this may not be the real story. It's hard to tell from what you've said. Also see in line below. cheers, Rolf

[R] rggobi error

2013-05-16 Thread Lopez, Dan
Hi R Expert Community, I need your help in getting rggobi and ggobi to work. I tried running ggobi under Rattle's Explore tab and interactive option but got an error. I then tested library('rggobi')and noticed I get the same error. So it's not Rattle specific. I have GGOBI and rggobi

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Jim Lemon
On 05/16/2013 11:07 PM, Öhagen Patrik wrote: Hi Jim,Thank you for your input! I am working with the text and arrow command in each of the graphs. I think it would be far to messy to plot them all in one graph (50+ point estimates and confidence intervals). par(mfrow=c(1,3)) is a step in the

Re: [R] R looping help

2013-05-16 Thread rishard
Thanks for the reply, running that gave me this: http://r.789695.n4.nabble.com/file/n4667260/Untitled.png I tried understanding it using the example you gave but I'm not to R savy. Does this output mean anything to you? -- View this message in context:

Re: [R] Three plots with logged X-axis in the same plot

2013-05-16 Thread Duncan Mackay
Hi Patrik, Using plot you could give the panel extra height by changing the cex of the labels etc and mai of the top expecially. Otherwise you could use xyplot and split the data into 3 - lattice with panels can be space saving dat - data.frame(max = hr_max, min=hr_min, med = med_names)

[R] How could I see the source code of functions in an R package?

2013-05-16 Thread jpm miao
Hi, How could I see the source code of functions in an R package? If we type ?function_name , we will see documentations of the function_name. If we type function_name, is what returns just the source code? Could we just save it in an .R file and modify as we want? However, it seems that

Re: [R] How could I see the source code of functions in an R package?

2013-05-16 Thread arun
HI, methods(xyplot) #[1] xyplot.formula* xyplot.ts* #  #  Non-visible functions are asterisked lattice:::xyplot.formula function (x, data = NULL, allow.multiple = is.null(groups) ||     outer, outer = !is.null(groups), auto.key = FALSE, aspect = fill,     panel =

[R] peering inside functions in a package?

2013-05-16 Thread Seth Myers
Let's say I would like to look inside the function corBrownian in library (ape). When I type in the function name I get the following, which is not nearly the detail that goes into this function. I am wondering how to begin cracking this function open (and others) so I can learn more about it

[R] Problem with ordiellipse coloured factor in Vegan

2013-05-16 Thread Suparna Mitra
Hello R experts, I am trying to plot ordiellipse for my data but the col according to factors. Metabolites_raw= read.csv(file.choose(), head = TRUE) #file 21Metabolites.csv Metabolites_t=t(Metabolites_raw[,2:82]) ord - metaMDS(Metabolites_t, distance=bray)

[R] negative extents to matrix

2013-05-16 Thread Muhammad Azam
Dear friends! Hope all of you are fine. I am doing work on decision trees. I have made  following program to construct classification trees. It works but some times it gives an error message e.g. negative extents to matrix. I tried to solve the issue but could not. Now, I need help, how to avoid

[R] FW: Why is it not working the MaxEnt analysis (package maxent, and dismo)?

2013-05-16 Thread Kristi Glover
Hi Timothy, I was trying to get a probability of the species based on MaxEnt function. As per the theory of MaxEnt,I uses the sites where only species is present. Therefore I selected only those rows where the species is present, my data is : 'dd', in which- there are X,Y coordinates and 4

Re: [R] How could I see the source code of functions in an R package?

2013-05-16 Thread David Winsemius
Do this search with your favorite search tool Accessing the sources ligges (Uwe Ligges is the author of a comprehensive article on the topic in R News.) -- David. On May 16, 2013, at 6:58 PM, jpm miao wrote: Hi, How could I see the source code of functions in an R package? If we type

Re: [R] negative extents to matrix

2013-05-16 Thread Bert Gunter
Dear Muhammed: You have got to be kidding! Learn to use R's debugging tools! See the section in the R Language Definition Manual on Debugging and get to work. -- Bert On Thu, May 16, 2013 at 7:42 PM, Muhammad Azam maza...@yahoo.com wrote: Dear friends! Hope all of you are fine. I am doing

[R] Rcmdr Bug?

2013-05-16 Thread Knut Krueger
may be it is a bug: if a excel file is not containing headlines the first data row will not be imported Knut __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide