Re: [R] accessing CRAN through a proxy on 3.2.2

2015-08-21 Thread Michael Weylandt
On Fri, Aug 21, 2015 at 12:00 PM, jim holtman wrote: > With the previous versions of R (my latest is 3.2.1) I have had no problem > getting through the proxy for the firewall at work. I installed the latest > version (3.2.2) and now cannot get through the firewall. There is the > session: > > R

Re: [R] Error: cannot allocate vector of size 18.4 Gb (NbClust)

2013-08-22 Thread Michael Weylandt
On Aug 22, 2013, at 7:39, Ben Harrison wrote: > I have a 70363 x 5 double matrix that I am playing with. > > > head(df) >GR SP SN LN NEUT > 1 1.458543 1.419946 -0.2928088 -0.2615358 -0.5565227 > 2 1.432041 1.418573 -0.2942713 -0.2634204 -0.5927334 > 3 1.4066

Re: [R] random sampling vector from any dsitribution

2012-12-18 Thread Michael Weylandt
On Dec 18, 2012, at 9:07 AM, Kairos2012 wrote: > Hi, > > help is very much appreciated. Thanks in advance!!! > > rgamma(...) > As far as I know with this function (code) one can randomly sample 100 > numbers simultanously. > > Question is: is it possible to sample 100 random numbers e.g. fro

Re: [R] How to convert xts data into list

2012-12-19 Thread Michael Weylandt
On Dec 19, 2012, at 1:07 PM, arun wrote: > Hi, > > I didn't understand ">". I think it's the result of HTMangLing the R prompt. M __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h

Re: [R] Retrieve indexes of the "first occurrence of numbers" in an effective manner

2012-12-27 Thread Michael Weylandt
?duplicated will help. M On Dec 27, 2012, at 8:17 PM, Emmanuel Levy wrote: > Hi, > > That sounds simple but I cannot think of a really fast way of getting > the following: > > c(1,1,2,2,3,3,4,4) would give c(1,3,5,7) > > i.e., a function that returns the indexes of the first occurrences of

Re: [R] listing all test functions in base R

2013-01-03 Thread Michael Weylandt
Certainly apropos() is easier, no? Michael On Jan 2, 2013, at 1:56 PM, "M.Gagolewski" wrote: > On 02.01.2013 13:40, Data Analytics Corp. wrote: >> Is there a way to create a list of all statistical test functions in >> base R? For example, there's t.test, ks.test, chisq.test, etc. I'd >> like

Re: [R] multiple versions of function

2013-01-10 Thread Michael Weylandt
th Recall() to make the recursive structure a little more robust. Though it seems that generic functions make more sense here. Michael Weylandt > > > On Tue, Jan 8, 2013 at 8:00 AM, David Winsemius > wrote: >> >> On Jan 7, 2013, at 6:58 PM, ivo welch wrote: &

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread Michael Weylandt
Try a different CRAN mirror. MW On Jan 17, 2013, at 7:42 AM, vaseem shaikh wrote: > Hi, > > Please find the snap shot attached for the error reported wile installing > Hmisc Package. > > Is there any thing you can help me with. > > Currently using "R i386 2.15.2" Version of R on windows 7 p

Re: [R] Problems Desing Package

2013-01-31 Thread Michael Weylandt
Use rms instead. MW On Jan 31, 2013, at 10:09 PM, Gabriela Agostini wrote: > Hi! > > I need to work whir Desing Package. > > I used > >> library(Design) > > but the following error is displayed on the console > >> library("Design", lib.loc="C:/Program Files/R/R-2.15.1/library") > Error e

Re: [R] Armadillo error in R extension

2013-02-01 Thread Michael Weylandt
Look up the terribly wonderful RcppArmadillo package. MW On Feb 1, 2013, at 8:38 PM, Simon Zehnder wrote: > Is there anyway with some experience in using armadillo in R C++ extensions? > > My problem is the following: > > I programmed a function in a header looking like > > #include > > i

Re: [R] error installing manipulate package.

2013-02-06 Thread Michael Weylandt
On Feb 6, 2013, at 9:23 PM, David Winsemius wrote: > > On Feb 6, 2013, at 9:01 AM, Nicole Ford wrote: > >> hello, all. >> >> I am having his problem. i looked in archives and could not find a solution. > > Did you look in the rhelp archives or in the package archives? > >> >> --- Please

Re: [R] Saving model and other objects from caret

2013-02-07 Thread Michael Weylandt
On Feb 7, 2013, at 9:51 PM, James Jong wrote: > Thanks Stephan. I can't believe I didn't try that first. I greatly > appreciate it. > > James > > > On Thu, Feb 7, 2013 at 4:45 PM, Stephan Kolassa wrote: > >> Have you looked at ?save and ?load? I generally prefer their *RDS counterparts whi

Re: [R] Addressing Columns in a Data Frame

2013-02-09 Thread Michael Weylandt
On Feb 9, 2013, at 1:40 PM, Lorenzo Isella wrote: > Dear All, > Probably a one liner, but I am banging my head against the floor. > Consider the following > > DF <- data.frame( > x=1:10, > y=10:1, > z=rep(5,10), > a=11:20 > ) > > mn<-names(DF) > > but then I cannot retrieve a column

Re: [R] (no subject)

2013-02-21 Thread Michael Weylandt
?colSums MW On Feb 21, 2013, at 11:26 AM, PIKAL Petr wrote: > Hi > > ?ncol > > Regards > Petr > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of nandita srivastava >> Sent: Thursday, February 21, 2013 8:34 AM >> To:

Re: [R] problem subsetting data.frame in R version 2.15.2 for Windows

2013-03-21 Thread Michael Weylandt
On Mar 21, 2013, at 7:39, Pierrick Bruneau wrote: > Hi Borja, > > You may issue: > > attach(data) No -- bad idea -- dangerous -- confusing statefulness, etc. (See explanations in the archives as to why) > > which results in adding your column names to the search path of R for name > resol

Re: [R] read.pnm question

2013-03-22 Thread Michael Weylandt
On Mar 22, 2013, at 4:04, Erin Hodgess wrote: > Dear R People: > > I am trying to replicate a cool example that I saw on the R-bloggers some > time ago by kafka399. > > Here are the lines tI think may be causing the trouble: > > gray_file <- read.pnm(path) > > pos[i,] <- c(gray_file@grey)

Re: [R] Iterative regression through a series

2013-04-02 Thread Michael Weylandt
Also look at zoo's rollapply. MW On Apr 2, 2013, at 13:51, Rui Barradas wrote: > Hello, > > The error comes from NAs where you would expect coefficients. Try the > following. > > > > set.seed(7511) # Make the example reproducible > > N <- 100 > Time <-1:N > Price <- rnorm(N, 8, 2) > >

Re: [R] custom startup/welcome message

2013-04-04 Thread Michael Weylandt
On Apr 4, 2013, at 6:20, lejeczek wrote: > hi everybody > > I wonder if there is a simple way, but not simple would be > ok too, > to customize info/welcome page at session start time? Probably easiest to do it by way of some cat() calls in your .Rprofile. See ?Startup for details. MW >

Re: [R] 10% off Intro R training from RStudio: NYC May 13-14, SF May 20-21

2013-04-16 Thread Michael Weylandt
On Apr 16, 2013, at 12:43, Bert Gunter wrote: > Hadley: > > I don't think this is appropriate. Think of what it would be like if everyone > shilled their R training and consulting wares here. Echoing others, this seems an accepted practice on the lists, endorsed at least in one instance by P

Re: [R] Q-Q Plot for comparing two unequal data sets

2013-04-16 Thread Michael Weylandt
On Apr 16, 2013, at 20:12, Janh Anni wrote: > Hello All, > > Would anyone be able to help me understand how R computes a > quantile-quantile plot for comparing two data samples with unequal sample > sizes? Normally, the procedure should be to rearrange the larger data > sample into n equally-

Re: [R] R not loading

2013-04-22 Thread Michael Weylandt
On Apr 22, 2013, at 21:15, "Barbour, Russell" wrote: > I am having a problem with loading R on my 64 bit computer. It used to > load perfectly until I upgraded to R 3.0.0 now it takes about 10 to even > 20 minutes ? Does anyone know how to remedy this problem? > OS and install inf

Re: [R] Bootstrapping in R

2013-04-25 Thread Michael Weylandt
On Apr 25, 2013, at 7:02, Preetam Pal wrote: > Hi all, > > 1>i have 3 vectors a,b and c, each of length 25... i want to define a > new data frame z such that z[1] = (a[1] b[1] c[1]), z[2] = (a[2] b[2] c[2]) > and so on...how do i do it in R > z <- data.frame(a, b, c) > > 2> Then i wan

Re: [R] R 3 and Debian Testing

2013-05-05 Thread Michael Weylandt
This might be a question best posed to the r-sig-Debian list. Cheers, MW On May 5, 2013, at 9:55, Lorenzo Isella wrote: > Dear All, > I am using Debian testing on multiple machine machines at home. > This is my source list > > deb http://ftp.ch.debian.org/debian/ testing main contrib non-free

Re: [R] More discussion on R usage statistics

2013-05-29 Thread Michael Weylandt
Interesting idea but would you be willing to change the name. Twitter, Stackoverflow, and the like use rstats to refer to R itself and confusion seems probable. https://mobile.twitter.com/search?q=%23rstats Michael On May 29, 2013, at 19:21, Johnny Zhang wrote: > Dear R users, > > There ha

Re: [R] Trying to build up functions with its names by means of lapply

2013-06-04 Thread Michael Weylandt
On Jun 5, 2013, at 3:53, Julio Sergio wrote: > I want to generate specific gamma distribution functions, given fixed > parameters. > This is I have k, and theta, say > > k <- 32.2549 # shape > theta <- 26.32809 # scale > > > # I have an auxiliary function that produces funcion

Re: [R] Proper way to implement package internal functions

2013-06-12 Thread Michael Weylandt
On Jun 12, 2013, at 16:34, Bryan Hanson wrote: > Thanks Duncan... > > Silly me, it's section 1.6.1 not version 1.6.1! > > So this warning from check is not a problem in the long run: > > * checking for missing documentation entries ... WARNING > Undocumented code objects: > ‘ang0to2pi’ ‘dAB

Re: [R] set.seed(x)

2013-06-13 Thread Michael Weylandt
On Jun 13, 2013, at 18:32, Duncan Murdoch wrote: > On 13/06/2013 11:59 AM, Pooya Lalehzari wrote: >> Hello, >> If I use set.seed(x) to set a seed for the random number generator, how can >> I undo that to revert a random output every time I run my code? > > If you remove .Random.seed, then th

Re: [R] Problems with R package building

2013-06-14 Thread Michael Weylandt
On Jun 14, 2013, at 7:18, jpm miao wrote: > Hi, > > I try to build a toy package by running the following codes in an R > program > > require(stats) > f <- function(x,y) x+y > g <- function(x,y) x-y > d <- data.frame(a=1, b=2) > e <- rnorm(1000) > package.skeleton(list=c("f","g","d","e"), na

Re: [R] R-3.0.1 for Centos 5?

2013-06-16 Thread Michael Weylandt
On Jun 17, 2013, at 7:32, Erin Hodgess wrote: > Dear R People: > > I am working with a Centos 5 machine and would like to install R-3.0.1. > > However, the only version that shows up "automatically" is R-2.15.2. > > I have tried the following: > > root@erinminfo [~]# wget > http://dl.fedora

Re: [R] Input and output of time series data - any function or packages that helps?

2012-09-30 Thread Michael Weylandt
On Oct 1, 2012, at 4:38 AM, jpm miao wrote: > Hello, > > I work with time series data. From time to time I run programs to > produce results that are in time series form (e.g., quarterly or monthly > data). After a few days I might need to access part of the results and to > run another prog

Re: [R] R process must die - can I save history?

2012-10-02 Thread Michael Weylandt
Agreed -- very cool trick. Thanks Prof Ripley Michael On Oct 2, 2012, at 9:59 PM, steven mosher wrote: > thanks Dr. R. this will come in handy in the future as I have a knack for > hanging R. > On Oct 2, 2012 12:01 PM, "Prof Brian Ripley" wrote: > >> On 02/10/2012 18:29, Bert Gunter wrote: >>

Re: [R] correlated events in time series

2012-10-25 Thread Michael Weylandt
Yes, but you'll need to learn vector (multivariate) time series methods. See, perhaps firstly, B Pfaff's book and corresponding R packages. It's dense, but not too long and will get you going the right way. Terms like VAR and VECM will help guide your googling Michael On Oct 25, 2012, at 8:34

Re: [R] xts Annual series

2014-04-08 Thread Michael Weylandt
On Apr 8, 2014, at 15:15, Erin Hodgess wrote: > Hello! > > If I have the following: > > x <- as.yearqtr(2000 + seq(0,7)/4) > x > [1] "2000 Q1" "2000 Q2" ... > > which is as it should be. > Then if I set up time as > time <- xts(1:8,x) > time > 2000 Q1 1 > 2000 Q2 2 > 2000 Q3 3 > . > . >

Re: [R] xts Annual series

2014-04-08 Thread Michael Weylandt
On Apr 8, 2014, at 17:32, John Laing wrote: > > That doesn't feel very eXtensible to me. > xts is quite obviously past tense. ;-) The list of allowable index classes is found in is.timeBased IIRC and the exclusion of integers is because there's no obvious way to have them play nice with o

Re: [R] constructing a sequence of POSIXct dates

2014-04-21 Thread Michael Weylandt
On Apr 21, 2014, at 10:55, Erin Hodgess wrote: > Never mindsolved it xkcd.com/979/ > > > On Mon, Apr 21, 2014 at 9:48 AM, Erin Hodgess wrote: > >> Hello! >> >> I have the following: >> >>> time1a <- as.POSIXct(paste(2008,08,01,sep="-")) >>> time1b <- as.POSIXct(paste(2008,08,11,sep=

Re: [R] a simple list question

2012-11-07 Thread Michael Weylandt
On Nov 7, 2012, at 6:07 AM, Rolf Turner wrote: > On 07/11/12 18:35, Erin Hodgess wrote: >> Dear R People >> >> I have a simple list question, please: >> >> I have vectors x.1, x.2,...x.n (each of different lengths) and I would >> like to combine them into a list. >> >> However, I'm sure that

Re: [R] Beginner help about output in R

2012-11-08 Thread Michael Weylandt
o values to an output datafile. I > tryed the following function: > > function (x) {write.table(data.frame(value1(x),value2(x)),file=output.txt)} > Type ?write.table and then add append=TRUE to your function call. Michael Weylandt > My problem is that I would like to calculate

Re: [R] plotting 1000 simulations, error message: plot.new has not been called yet

2012-11-21 Thread Michael Weylandt
On Nov 21, 2012, at 6:07 PM, Maximilian Lklweryc wrote: > Hi, > I know this is not a mailing list for r, It's not? I'm confused then! > but I posted my question on > several help pages and did not get any help. I really don't know how > to solve my problem, maybe you could help me? > > want

Re: [R] What is the . in formula ~. syntax?

2012-11-23 Thread Michael Weylandt
On Nov 23, 2012, at 4:26 AM, Brian Feeny wrote: > I know if I have a dataframe with columns y, x1, x2 and I wish to have y as > my y value and x1 and x2 as x values I can do: > y ~ x1 + x2 > > or > > y ~. > > but can someone explain what . actually is or what its transposed into? Everythi

Re: [R] bbmle "Warning: optimization did not converge"

2012-11-25 Thread Michael Weylandt
On Nov 25, 2012, at 1:52 PM, arun4 wrote: > I am using the Ben bolker's R package "bbmle" to estimate the parameters of a > binomial mixture distribution via Maximum Likelihood Method. For some data > sets, I got the following warning messages: > *Warning: optimization did not converge (code 1:

Re: [R] error, R commends cannot show the expected output

2012-11-28 Thread Michael Weylandt
On Nov 28, 2012, at 4:13 AM, Jack Bryan wrote: > > Thanks ! > > I solved it. Don't you mean David did? > > I run sink() to get the output on command line. No, not really -- you run sink to 'turn off' an earlier call to sink which, in the interactive REPL, returns you to the command lin

Re: [R] Can R be embedded in html?

2012-11-28 Thread Michael Weylandt
Google for the new Shiny package from RStudio. Michael On Nov 28, 2012, at 3:04 PM, chawla wrote: > Hi > I have previously used PHP script in HTML to connect website with the > database and do analysis. > Is it also possible to execute R scripts within HTML files? > Basically I want to create

Re: [R] possible bug in function 'mclapply' of package parallel

2012-12-13 Thread Michael Weylandt
Mailing list ate the attachment. Can you send it plain text (if short) or post it somewhere online? Michael On Dec 13, 2012, at 1:54 AM, Asis Hallab wrote: > Dear parallel users and developers, > > I might have encountered a bug in the function 'mclapply' of package > 'parallel'. I construct

Re: [R] rpy2 and user defined functions from R

2013-10-30 Thread Michael Weylandt
Presumably you need to define 'buzz' first, but I don't see evidence that you've done so. Michael On Oct 30, 2013, at 0:06, Erin Hodgess wrote: > Hello again! > > I'm using python with a module rpy2 to call functions from R. > > It works fine on built in R functions like rnorm. > > However

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread Michael Weylandt
Either dir() or list.files() Michael On Jul 4, 2012, at 8:24 AM, Ajay Ohri wrote: > Dear List, > > Say I can use getwd() and setwd() to change my working directory. How can I > read in all the files within that directory using command line (like a ls() > but for the path specified) > > Regard

Re: [R] how to check convergence of arima model

2012-07-04 Thread Michael Weylandt
Also look at auto.arima in the forecast package. Michael On Jul 4, 2012, at 4:38 AM, Rui Barradas wrote: > Hello, > > Put the fitted models in a list and then use lapply with AIC(). Like this > > > set.seed(1) > x <- 1:100 + sqrt(1:100 + runif(100)) + rnorm(100) > models <- list() > models[

Re: [R] How to intall "car" package on linux

2012-07-06 Thread Michael Weylandt
ing. > What's the problem?? > > Thanks, > Chenwei > > On Fri, Jul 6, 2012 at 11:08 PM, R. Michael Weylandt > wrote: > Install.packages needs a quoted argument -- the error message suggests > that its looking for a variable named `car` and not finding it -- in >

Re: [R] How to replace a column in a data frame with another one with a different size

2012-07-08 Thread Michael Weylandt
On Jul 8, 2012, at 9:31 AM, Stathis Kamperis wrote: > Hello everyone, > > I have a dataframe with 1 column and I'd like to replace that column > with a moving average. > Example: > >> library('zoo') >> mydat <- seq_len(10) >> mydat > [1] 1 2 3 4 5 6 7 8 9 10 >> df <- data.frame("V1"

Re: [R] cbind and cbind.data.frame

2012-07-09 Thread Michael Weylandt
Short answer: there is a default method used here which returns a matrix. It's defined at the C-level for speed so you don't see it with methods() Longer: cbind() isn't a regular S3 generic since it has no UseMethod(). Look at WRE and R-Internals (internal generics) for more info. Best (and go

Re: [R] outer() or some other function for regression prediction with 2 IVs

2012-07-09 Thread Michael Weylandt
Your problem is the sum() call -- it's not vectorized (in the regular sense) so it breaks some of the internal assumptions of outer(). Easiest way is probably to do matrix multiplication (%*%) directly here Michael On Jul 9, 2012, at 10:19 PM, Joseph Clark wrote: > > Hi there, I'm trying to

Re: [R] browser() question

2012-07-11 Thread Michael Weylandt
Incidentally, the OP might want to take a look at ?rle. Michael On Jul 11, 2012, at 3:42 AM, Sarah Goslee wrote: > Hi, > > On Wednesday, July 11, 2012, darnold wrote: > >> All, >> >> How come i=1 in the first case, but i=2 in the second case. The second case >> seems to work, but the first

Re: [R] How to Read source code of function as string vector or matrix

2012-07-12 Thread Michael Weylandt
?deparse And please include context -- relatively few of us use Nabble. Michael On Jul 12, 2012, at 4:16 AM, purushothaman wrote: > Hi, > > readLines read a file and retrun as vector. > > i need to read particular function in Rfile. > > Thanks > B.Purushothaman > > -- > View this message i

Re: [R] how to add a variable to a graph title

2012-07-12 Thread Michael Weylandt
plot(1:5, main = paste0("Figure 1: x=", x)) Michael On Jul 12, 2012, at 3:30 PM, JeffND wrote: > Hi folks, > > To simplify my question, consider an example: > > x=runif(1,0,1) > plot(1:5,1:5) > > Now I want to add a title to the above plot showing the vaue of x, so if the > generated x is 0.

Re: [R] Data from Stock and Watson or DAgostino papers?

2012-07-16 Thread Michael Weylandt
Not a direct answer, but CRAN package quantmod can get FRED data for you, which may be of help. Michael On Jul 16, 2012, at 10:15 AM, Matt Considine wrote: > Hello, > I am interested in looking at the dataset used by Stock and Watson in their > "Macroeconomic Forecasting Using Diffusion Inde

Re: [R] R2WinBUGS

2012-07-17 Thread Michael Weylandt
Reproducible code? The error seems to be rather clear. Also, this seems more of a BUGS question than an R question. Michael On Jul 17, 2012, at 11:06 AM, PRAGYA SUR wrote: > Dear R users, >Can anyone tell me why I might get the error message > "the array index is greater t

Re: [R] check whether connection can be opened

2012-07-18 Thread Michael Weylandt
I think you'll need to roll your own using tryCatch() around open(). Michael On Jul 18, 2012, at 5:09 AM, Berry Boessenkool wrote: > > > Hi all, > > I'm working on a function that reads online data that is only available to > certain IPs. It then writes a subset of the data into a file. >

Re: [R] QUADRATIC PROGRAMMING

2012-07-24 Thread Michael Weylandt
We don't do homework on this list: also, this is basic calculus, not quadratic programming. Best, Michael On Jul 24, 2012, at 1:10 PM, Joel Muli wrote: > hi, > what code in R would I use to solve the problem below? > > An apartment complex has 250 apartments to rent.If they rent x apartments

Re: [R] old weird error message

2012-07-25 Thread Michael Weylandt
I dont think it's network connection related. Type ??? :-) Michael On Jul 25, 2012, at 6:49 AM, Ivan Calandra wrote: > Dear users, > > I have a weird questions. A friend of mine, some years ago, supposedly trying > to access help files without Internet connection, got something like this >

Re: [R] Appending the Column names

2012-07-28 Thread Michael Weylandt
You can't have two sets of colnames on a single data.frame What are you trying to do (big picture wise)? Michael On Jul 28, 2012, at 12:56 PM, namit wrote: > Hi Freinds, > > I have two data frames X,Y. I want to append both the data frames into one, > along with the columns names from both t

Re: [R] Convert variable to STring

2012-07-30 Thread Michael Weylandt
You may be searching for the deparse(substitute(x)) idiom. Michael On Jul 30, 2012, at 5:47 AM, Alaios wrote: > Dear all, > I have a variable that I would like also to use it as a string. The reasons > is that I want to collect results from different function to one table.. So > when I use t

Re: [R] How to link two R packages together

2012-08-01 Thread Michael Weylandt
Isn't this what package dependencies are for? See the description of the DESCRIPTION file in Writing R Extensions Michael On Aug 1, 2012, at 5:27 PM, xuan zhao wrote: > Hi, > I have built two R packages. One of them (PKG1) needs to use the functions > of the other package (PKG2). > So I need

Re: [R] How to link two R packages together

2012-08-01 Thread Michael Weylandt
y, when load my package, I have to do: > library("PKG1",lib.loc=/directory/), in this case, how to write the > dependency? > Like 'Depends: PKG1', where can I specify the path? > Thank you so much again! > Yours, > Xuan > > -Original Message- >

Re: [R] ggplot does not show in knitr

2012-08-02 Thread Michael Weylandt
You need to explicitly print() the graphs to make them show -- or in recent ggplot2 versions I think you can also use plot() as an alias. Michael On Aug 2, 2012, at 2:37 PM, "firdaus.janoos" wrote: > Hello, > > I'm having some issues getting a ggplot figure to show up in the knitr > output,

Re: [R] Need Help in Finite Element Analysis

2012-08-02 Thread Michael Weylandt
On Aug 2, 2012, at 3:23 PM, Abdul wrote: > Hi everybody > I need help to solve the following problem in finite element > A field variable f(x,y)=xᵌ y is defined over a rectangle domain > Ω={K: 0≤x≥4 , 0≤y≥6” Given the expression > g=∬_(0 0)^(6 4)▒〖X^3 Y dx dy〗 > And assume the following

Re: [R] Head or Tails game

2012-08-03 Thread Michael Weylandt
On Aug 3, 2012, at 9:14 PM, darnold wrote: > David, > > set.seed(123) # always good to make reproducible > winnings <- sum(sample(c(-1,1), 1, replace=TRUE)) > > Unfortunately, that's not the game. The game requires 40 flips of a coin. > > Then you have to play the game 10,000 times. >

Re: [R] How can we compare two vectors?

2012-08-08 Thread Michael Weylandt
Either == or %in% if you care about order or not. Michael On Aug 8, 2012, at 7:00 AM, Sri krishna Devarayalu Balanagu wrote: > x=c(5, 8, 28, 29, 30) > y=c(5, 8, 28, 29, 31) > How can we compare these two vectors, whether each element is exactly matched > with the elements in the other vector

Re: [R] R Commander - Time Series

2012-08-09 Thread Michael Weylandt
On Aug 9, 2012, at 9:21 AM, John Kane wrote: > I don't think a lot of people here use R Commander so diagnosing something > from there may be difficult. > > Probably the first thing to do is to supply us with some sample data. The > best way do do this is usually to use the dput() comman

Re: [R] summarize a vector

2012-08-10 Thread Michael Weylandt
I wouldn't be surprised if one couldn't get an *apply-free solution by using diff(), cumsum() and selective indexing as well. Cheers, Michael On Aug 10, 2012, at 5:07 PM, David Winsemius wrote: > > On Aug 10, 2012, at 12:57 PM, Bert Gunter wrote: > >> ... or perhaps even simpler: >> >>> sz

Re: [R] How do I find the apparent magnitude of a galaxy from a FITS file?

2012-08-11 Thread Michael Weylandt
On Aug 11, 2012, at 6:34 AM, andrej wrote: > > [2] I obtained R (actually R64) from the following website: > http://cran.cnr.berkeley.edu/bin/macosx/ > > I guess it didn't come with an 'sos' package. I assume it's here: > http://cran.r-project.org/web/packages/sos/index.html > > and when I d

Re: [R] Error in if-command

2012-08-12 Thread Michael Weylandt
Take a look at ?ifelse Cheers, Michael On Aug 12, 2012, at 3:12 AM, Dominic Roye wrote: > Hello everybody, > > I don't understand what I'm doing wrong. But it isn't possible that each > element of the if-condition is tested for each vector element? > > y <- c(1:20) >> y > [1] 1 2 3 4 5

Re: [R] Using R as Shared Library

2012-08-12 Thread Michael Weylandt
On Aug 12, 2012, at 6:09 AM, Thorsten Jolitz wrote: > Thorsten Jolitz writes: > > Let me reformulate my question (since I managed to make 'native' calls > to C functions in libR by now): > I still wonder whats 'in there' in libR - only the core C functions, or > all the functions written in

Re: [R] Error in metafor documentation on maximum iterations

2012-08-15 Thread Michael Weylandt
Send this to Wolfgang directly. See maintainer("metaphor") Michael On Aug 15, 2012, at 12:13 PM, John Hodgson wrote: > Both the official R documentation and Wolfgang's paper in the Journal of > Statistical Science describing this (extremely useful) package, name the > control variable for maxi

Re: [R] Trace values in the function ca.jo()

2012-08-21 Thread Michael Weylandt
This is somewhat technical and I'd advise you post to R-Sig-Finance and cc the package maintainer, Dr Pfaff, directly. Use maintainer("urca") to get his email. Cheers, Michael On Aug 21, 2012, at 4:48 AM, Rmillan wrote: > Hi all R users, > > I'm trying to replicate the same results that are

Re: [R] help on plot on the log scale but showing original values on axis

2012-08-30 Thread Michael Weylandt
Possibly easier: plot(x, y, log = "x") Cheers, Michael On Aug 30, 2012, at 5:47 AM, Rui Barradas wrote: > Hello, > > The following is the general idea. > > x <-c(0.25,0.5,1,2,4,8,16,32) > y <-c(1,1,1,1,0.9,0.8,0.6,0.2) > > plot(log(x),y,type="b", xaxt = "n") > axis(1, at = log(x), labels = x

Re: [R] Announcing TIBCO Enterprise Runtime for R

2013-07-11 Thread R. Michael Weylandt
Hi Louis, I apologize in advance if this isn't the right forum; feel free to direct me elsewhere. Can you say a bit more about what exactly constitute the advantages of TERR over R as most readers of this list know it? Some random points of interest to me: 1. Do you have concrete benchmarks of w

Re: [R] how to calculate the average values of each row in a matrix

2013-07-19 Thread R. Michael Weylandt
On Jul 19, 2013, at 20:19, Elaine Kuo wrote: > Hello, > > I have a matrix (class matrix) composed of GridCell (row and column). > The matrix value is the beta diversity index value between two grids. > > Now I would like to get the average value of each GridCell. > Please kindly advise how to

Re: [R] constructing a daily time series

2013-07-25 Thread R. Michael Weylandt
On Mon, Jul 22, 2013 at 11:17 PM, Pascal Oettli wrote: > Hello, > > ?zoo > > Regards, > Pascal > > > 2013/7/23 shanxiao > >> Dear all, >> >> >> >> I have a vector of observations through day, and based on it, I try to >> construct a daily time series with the R function ts(), but it seems that >>

Re: [R] model syntax processed --- probably common

2013-08-19 Thread R. Michael Weylandt
On Aug 19, 2013, at 16:05, ivo welch wrote: > thank you. but uggh...sorry for my html post. and sorry again for > having been obscure in my attempt to be brief. here is a working > program. > > fama.macbeth <- function( formula, din ) { I think most users would expect 'din' to be 'data' he

Re: [R] Appropriateness of R functions for multicore

2013-08-23 Thread R. Michael Weylandt
On Mon, Aug 19, 2013 at 2:08 PM, Patrick Connolly wrote: > On Sat, 17-Aug-2013 at 05:09PM -0700, Jeff Newmiller wrote: > > > |> In most threaded multitasking environments it is not safe to > |> perform IO in multiple threads. In general you will have difficulty > |> performing IO in parallel proce

Re: [R] How to rebuild an R package that has been removed from CRAN?

2013-08-23 Thread R. Michael Weylandt
On Mon, Aug 19, 2013 at 6:07 PM, Shang Zuofeng wrote: > So this is an alternative method. The package can be installed from > source() rather than rebuilt. Although the warnings exist, the package > itself may still be useful. Can you let me know how to installed from > source? > Note that these

Re: [R] problem with rJython and modules

2013-09-12 Thread R. Michael Weylandt
On Sep 12, 2013, at 13:42, Erin Hodgess wrote: > Dear R People: > > I have been experimenting with rPython, rSymPy, and rJython. Here is my > latest snag: > >> library(rJython) > Loading required package: rJava > Loading required package: rjson >> library(rSymPy) >> rJython <- rJython() >> x

Re: [R] Rounding

2013-01-05 Thread R. Michael Weylandt
On Sat, Jan 5, 2013 at 6:42 PM, David Arnold wrote: > Hi, > > Can someone explain this: > >> options(digits=20) >> 1/3 > [1] 0.1483 > > Why the 1483 at the end? To be curt, "it's complicated," but it basically comes down to the fact that 1/3 is not expressible by a finite sequence

Re: [R] Rounding

2013-01-05 Thread R. Michael Weylandt
On Sat, Jan 5, 2013 at 6:48 PM, R. Michael Weylandt wrote: > To be curt, "it's complicated," but it basically comes down to the > fact that 1/3 is not expressible by a finite sequence of powers of 2 > so it can't be perfectly represented in binary. But of course, th

Re: [R] lapply (and friends) with data.frames are slow

2013-01-05 Thread R. Michael Weylandt
On Sat, Jan 5, 2013 at 7:38 PM, Kevin Ushey wrote: > Hey guys, > > I noticed something curious in the lapply call. I'll copy+paste the > function call here because it's short enough: > > lapply <- function (X, FUN, ...) > { > FUN <- match.fun(FUN) > if (!is.vector(X) || is.object(X)) >

Re: [R] Have problem to do loop to generate transformed chi-squared variates

2013-01-07 Thread R. Michael Weylandt
Hi Agnes, I think this is likely homework, right? If that's the case, we're really not supposed to give you help. If not, why not simply use rchisq to generate chi-sq variates exactly? MW On Mon, Jan 7, 2013 at 4:13 PM, Agnes Ayang wrote: > Hello R-helpers, > > I need to generate standard vari

Re: [R] list of lists to matrix

2013-01-07 Thread R. Michael Weylandt
Something like do.call(cbind, lists) ? MW On Mon, Jan 7, 2013 at 4:13 PM, eliza botto wrote: > > dear R family, > [a text file has been attached for better understanding] > i have a list of 16 and each of of that is further subdivided into variable > number of lists. So, i have a kind of list

Re: [R] During startup - Warning messages:

2013-01-07 Thread R. Michael Weylandt
I'd suggest you do as the following message suggests and follow the R-MAC-FAQ section 9 notes on locales and whatnot. If you need specific advice on following this, we'll need to know what version of OS X you're running and what your local settings are. That said, I don't think you'll actually hit

Re: [R] ./R: error while loading shared libraries

2013-01-10 Thread R. Michael Weylandt
I'd move this to the R-SIG-Fedora list and, in doing so, give more info about your install process: built yourself, package manager, etc. MW On Wed, Jan 9, 2013 at 7:31 PM, Adam Dahman wrote: > Hi, > > I have installed R on linux using a non root account. > > I am getting this error when trying

Re: [R] Precision of values > 53 bits

2013-01-10 Thread R. Michael Weylandt
Perhaps here?: https://r-forge.r-project.org/projects/rmpfr/ M On Thu, Jan 10, 2013 at 10:58 AM, Stephan Mueller wrote: > > > I am working with large numbers and identified that R looses precision > for such high numbers. > > The precision is lost exactly when the number is equal or larger than

Re: [R] The three-dot question

2013-01-14 Thread R. Michael Weylandt
Hi Feng, I'm afraid I don't entirely understansd your question -- the `...` construct only allows you to pass variable numbers of arguments, not to have arbitrary access to the parent frames. You need to manually extract "b" from the dots inside of testFun. Also, it's quite frowned upon to put ##

Re: [R] function coverage

2013-01-14 Thread R. Michael Weylandt
Possibly you could trace() all the functions you're interested in. E.g., lapply(ls("package:stats"), trace) # Untested. MW On Mon, Jan 14, 2013 at 9:08 PM, Ross Boylan wrote: > Is there an easy way to identify all the functions called as a result of > invoking a function? Getting the calling h

Re: [R] Need help: R for repetitive tasks

2013-01-15 Thread R. Michael Weylandt
list.files() to get all the files in the directory (use the pattern argument to be more specific). Then loop over the file names, reading in the data one at a time, do the desired processing, and then use the file name to make the graphics file name as well. Cheers, MW On Tue, Jan 15, 2013 at 12:

Re: [R] Issue while installing Hmisc package

2013-01-17 Thread R. Michael Weylandt
RAN have any role > to play here??? You can't "escape" CRAN entirely in this case (unless you know where the source is, which I don't) -- it's the distribution network. MW > > > BR- > Vaseem Shaikh > On Thu, Jan 17, 2013 at 3:03 PM, Michael Weylandt >

Re: [R] how to use "..."

2013-01-17 Thread R. Michael Weylandt
On Thu, Jan 17, 2013 at 2:36 PM, Ivan Calandra wrote: > Dear users, > > I'm trying to learn how to use the "...". > > I have written a function (simplified here) that uses doBy::summaryBy(): > # 'dat' is a data.frame from which the aggregation is computed > # 'vec_cat' is a integer vector defining

Re: [R] foreach takes foreever?

2013-01-21 Thread R. Michael Weylandt
You're probably being killed by the overhead of parallelization which is, in this case, far more than actual computation time. I've not dug through foreach() in a while, but I think this winds up spawning many many subprocesses which isn't cheap in Windows. MW On Mon, Jan 21, 2013 at 3:59 PM, And

Re: [R] importing data

2013-01-23 Thread R. Michael Weylandt
On Wed, Jan 23, 2013 at 9:16 AM, Ray Cheung wrote: > Dear All, > > Sorry for asking a newbie question. I want to ask how to import 1000 > datasets whose file names are labelled from data1.dat to data1000.dat into > R so that they are named M[1, , ] to M[1000, , ] accordingly. Thank you > very much

Re: [R] importing data

2013-01-25 Thread R. Michael Weylandt
On Fri, Jan 25, 2013 at 6:11 AM, Ray Cheung wrote: > Dear Michael, > > Thanks for your codes. However, lapply does not work in my case since I've > some files missing in the data (say, the file data101.dat). Do you have any > suggestions on this?? Thank you very much. > You could simply add a tes

Re: [R] How to name the elements of list

2013-01-25 Thread R. Michael Weylandt
names(X) <- c("0-10", "11-20") MW On Fri, Jan 25, 2013 at 9:39 AM, Tammy Ma wrote: > > HI, > > > I have the array list: > > X<-vector("list", 2) > > X[[1]] : data frame 1 > X[[2]]: dataframe2 > > > now i want to change index 1 and 2 into: "0-10" , "11-20" ,. > > finally I want to have > X[["0

Re: [R] platform specific "Depends" argument?

2013-01-28 Thread R. Michael Weylandt
I think this is only a legacy question, right? In recent R, you can/should use "parallel" instead of either multicore or snowfall. That said, no answer if you want back compatability with older versions of R. MW On Mon, Jan 28, 2013 at 10:43 AM, Florian Schwaiger wrote: > Dear R users, > > we h

Re: [R] Query on package to use for investment quotes

2013-01-28 Thread R. Michael Weylandt
I'd look into the quantmod package. Cheers, MW On Mon, Jan 28, 2013 at 1:52 PM, Bruce Miller wrote: > Hi all, > > Diverging from my research based number crunching I am interested to see > what, if any R packages are out there that can access daily market values of > investment funds (e.g. using

  1   2   3   4   5   6   7   8   9   10   >