Re: [R] Errorbar

2014-02-18 Thread R. Michael Weylandt michael.weyla...@gmail.com
Have you seen the examples at docs.ggplot2.org/0.9.3.1/geom_errorbar.html ? On Feb 18, 2014, at 10:57, Alzahrani, Ahmad K A aka...@essex.ac.uk wrote: Hi All, Can anyone show me how to add a error bar to my graphs. I am currently using this code g-ggplot(means,aes(x=variable,y=value))

Re: [R] quotation marks and scan

2013-11-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
They're not actually there so don't try too hard to rid yourself of them: x - \' length(x) print(x) cat(x, \n) Make sure you're clear on the difference between what's stored by the computer and what it print()s. Rarely the same, though cat() is often slightly more honest. On Nov 17, 2013,

Re: [R] Manually setting coefficients in an lm.

2013-11-12 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Nov 12, 2013, at 11:59, coll...@pitt.edu wrote: Think you're going to have to explicitly define hand tailor. I haven't a clue what you mean. (Someone else might of course). Ah, I want to set a specific coefficient value for each of the terms rather than rely on training. Thus given:

Re: [R] Load Tawny package on R 2.15.3

2013-11-01 Thread R. Michael Weylandt michael.weyla...@gmail.com
The release version of tawny has no such dependency and builds just fine on CRAN. Try updating that instead. Michael On Nov 1, 2013, at 7:10, Tstudent tstud...@gmail.com wrote: I have R version 2.15.3 When i try to load it: library (tawny) i receive this response: package

Re: [R] an rpy2, R cgi type question

2013-10-31 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Oct 31, 2013, at 1:50, Erin Hodgess erinm.hodg...@gmail.com wrote: Hi again: Here is the web output: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. So your Python code is raising an exception somewhere,

Re: [R] an rpy2, R cgi type question

2013-10-31 Thread R. Michael Weylandt michael.weyla...@gmail.com
, and the error appears on the line in which I open the bz2.R file. It's definitely there, and I set the permissions to 777 for experimental permissions. On Thu, Oct 31, 2013 at 7:04 AM, R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com wrote: On Oct 31, 2013

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

2013-10-30 Thread R. Michael Weylandt michael.weyla...@gmail.com
Could you produce a full working example then? Bit hard to debug without knowing what you did. Michael On Oct 30, 2013, at 9:11, Erin Hodgess erinm.hodg...@gmail.com wrote: I did...just didn't show it On Wed, Oct 30, 2013 at 7:01 AM, Michael Weylandt michael.weyla...@gmail.com wrote:

Re: [R] An Apply function question about changing type of variable

2013-09-27 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Sep 27, 2013, at 11:27, Vincent Guyader vincent.guya...@allstat.fr wrote: Hi everyone, plese can you look at this few lines : data(iris) res-apply(iris,MARGIN=2,is) res[1,] the result is : Sepal.Length Sepal.Width Petal.Length Petal.Width Species character character

Re: [R] problem with rJython and modules

2013-09-12 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Sep 12, 2013, at 13:42, Erin Hodgess erinm.hodg...@gmail.com 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 -

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

2013-08-19 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 19, 2013, at 16:05, ivo welch ivo.we...@gmail.com 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'

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

2013-07-19 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 19, 2013, at 20:19, Elaine Kuo elaine.kuo...@gmail.com 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

Re: [R] [r] Problems with Fortran calls when loaded a dll compiled with gfortran-4 Cygwin 4.5.3

2013-04-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 24, 2013, at 7:46 PM, Jens Olofsson jens.olofs...@gmail.com wrote: Ok. I apologise for not understanding. So, I have installed R-tools. It changed my PATH-variable. I didn't installed Cygwin dlls as stated by http://cran.r-project.org/doc/manuals/R-admin.html#The-Windows-toolset.

Re: [R] Source Code

2013-04-20 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 20, 2013, at 6:23 PM, Eva Prieto Castro evapcas...@yahoo.es wrote: Dear all, How can I get the source code of text function? What is the 'text function'? Try typing the name of the function at the prompt without any parentheses after it. If its written in R, then it should be

Re: [R] Source Code

2013-04-20 Thread R. Michael Weylandt michael.weyla...@gmail.com
...@gmail.com michael.weyla...@gmail.com CC: Eva Prieto Castro evapcas...@yahoo.es, r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch Fecha: domingo, 21 de abril, 2013 00:45 On Apr 20, 2013, at 3:34 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: On Apr 20, 2013, at 6:23 PM, Eva

Re: [R] proper way to handle obsolete function names

2013-04-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 17, 2013, at 10:17 AM, Jannis bt_jan...@yahoo.de wrote: Dear R community, what would be the proper R way to handle obsolete function names? I have created several packages with functions and sometimes would like to change the name of a function but would like to create a

Re: [R] R process slow down after a amount of time

2013-04-16 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 16, 2013, at 9:52 AM, Chris82 rubenba...@gmx.de wrote: Hi R users, I have mentioned that R is getting slower if a process with a loop runs for a while. Is that normal? Let's say, I have a code which produce an output file after one loop run. Now after 10, 15 or 20 loop runs the

Re: [R] convert annual data to quarterly frequency

2013-04-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 5, 2013, at 2:12 PM, Ravshonbek Otojanov r.otoja...@qmul.ac.uk wrote: Hi, I was wondering if there is a package I can use to convert my 22 annual observations to quarterly time series so that I will have 88 observations. Please don't post to two lists -- and I think the package

Re: [R] [R-SIG-Finance] error message sending question to the list

2013-04-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
Post in plain text (not HTML) which is a choice within your email client. And please (!!) don't post the same question to multiple lists. If your question is off-topic, the list membership will redirect as needed. Double posting simply wasted the community's energies by duplicating responses.

Re: [R] categorized complete list of R commands?

2013-04-04 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 4, 2013, at 12:34 AM, ivo welch ivo.we...@anderson.ucla.edu wrote: every time I read the R release notes for the next release, I see many functions that I had forgotten about and many functions that I never knew existed to begin with. (who knew there were bibtex facilities in R?

Re: [R] Large loops in R

2012-12-04 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Dec 4, 2012, at 6:47 PM, Charles Novaes de Santana charles.sant...@gmail.com wrote: Dear all, I need to access data from a large matrix (48000 x 48000) and to do it I am trying to run two loops using for command. Surely it is been a very slow job. I heard that for is not the best

Re: [R] A general question: Is language S a component part of R?

2012-11-05 Thread R. Michael Weylandt michael.weyla...@gmail.com
++ -- the later includes the former ... mostly ... except where it doesn't. Michael Regards, Iurie 2012/11/5 R. Michael Weylandt michael.weyla...@gmail.com On Mon, Nov 5, 2012 at 4:43 PM, Iurie Malai iurie.ma...@gmail.com wrote: In the Introduction and preliminaries the An Introduction

Re: [R] R crashing after successfully running compiled code

2012-10-31 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Oct 31, 2012, at 3:13 AM, Adam Clark atcl...@umn.edu wrote: I'm running R 2.15.1x64, though the same problem persists for 2.13.0x32 and 2.13.0x64. I am trying to run compiled C code using the .C convention. The code compiles without problems, dynamically loads within the R workspace

Re: [R] find the Best-ticker

2012-10-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Oct 29, 2012, at 6:11 AM, sheenmaria sheenmar...@gmail.com wrote: i need to find the best ticker from the group of some tickers.? i also need to know on what basis we calculate the best ticker? i have some idea about the if the risk rate low, or the market price high we can say the

Re: [R] Parsing very large xml datafiles with SAX (XML package): What data structure should I favor?

2012-10-26 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'd look into the data.table package. Cheers, RMW On Oct 26, 2012, at 6:00 PM, Frederic Fournier frederic.bioi...@gmail.com wrote: Hello again, I have another question related to parsing a very large xml file with SAX: what kind of data structure should I favor? Unlike using DOM function

Re: [R] Change to daily digest

2012-10-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Oct 25, 2012, at 7:30 PM, Mohamed Radhouane Aniba arad...@gmail.com wrote: Hello folks, I am currently receiving a lot of emails from the list which proves that this is a very important place to get good feedbacks and tips and that the community is here to help .. Excellent thing. I

Re: [R] R Update Failed !!!

2012-10-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
This is being handled on R-SIG-Mac. Please disregard here. Michael On Oct 6, 2012, at 9:05 PM, Jhope jeanwaij...@gmail.com wrote: Hi R-listers, I just tried updating my R and now I can't even open it and it is prompting me to relaunch then relaunch just reappears. And it will not open R.

Re: [R] Calculating the mean in one column with empty cells

2012-10-06 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Oct 6, 2012, at 4:54 PM, fxen3k f.seha...@gmail.com wrote: I created a Microsoft Excel spreadsheet. As you said, I only have as displayed numbers. I just solved the problem by showing 25 decimal places in Excel and then exported the data into a CSV-file. Is there a better way to solve

Re: [R] creating lagged variable in panel data

2012-08-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Of course: colnames(dats)[4] - new name M On Aug 29, 2012, at 9:34 AM, Alok K Bohara, PhD boh...@unm.edu wrote: Hi I found an example in R to create a lagged panel data set which works fine. The only problem is that it adds the lagged variable as follows wage2.dat year

Re: [R] write.table and read.table commands

2012-08-27 Thread R. Michael Weylandt michael.weyla...@gmail.com
It's because read.table returns a data frame, not a matrix. You can coerce to a matrix with as.matrix() but you might loose information if your variables are of different classes. Michael On Aug 27, 2012, at 7:07 PM, Cheryl Johnson johnson.cheryl...@gmail.com wrote: Greetings, When I try

Re: [R] find and replace

2012-08-27 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at gsub() Michael On Aug 27, 2012, at 6:47 PM, Sapana Lohani lohani.sap...@ymail.com wrote: Hi, My data frame (Students) is ID Name Fav_Place 101 Andrew� Phoenix AZ 201 John San Francisco 303 JulieCalifornia / New York 304 Monica� New York How can I replace Phoenix

Re: [R] extract vector elements of unknown range

2012-08-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 25, 2012, at 4:23 AM, Sepp Tannhuber sepp.tannhu...@yahoo.de wrote: Hi, thanks for your quick answers! These solve my problem. Now I have another question. I think I can use head(y, -1) instead of y[-length(y)] Are there differences in terms of performance? The latter

Re: [R] sourcecode for the balloonplot function from the gplots package

2012-08-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
Use getAnywhere() or getS3method(). Michael On Aug 25, 2012, at 4:13 AM, ravi rv...@yahoo.se wrote: Hi, I want to take a look at the sourcecode for balloonplot. I would appreciate it if I could get help on overcoming the following problem : methods(balloonplot) [1] balloonplot.default*

Re: [R] date

2012-08-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
Three steps: 1) as.character to get character representation 2) as.POSIXct to convert to time 3) julian() or strptime() to get Julian date. Read the docs (esp on part 2 and 3) to get the format strings just right. Cheers, Michael On Aug 24, 2012, at 10:30 PM, Veerappa Chetty

Re: [R] plot only x- and y-axis with origin, no box()

2012-08-18 Thread R. Michael Weylandt michael.weyla...@gmail.com
Try adding bty='n' Michael On Aug 18, 2012, at 9:21 AM, ARI BEN bondy93...@hotmail.fr wrote: Envoyé de mon iPhone __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Get the filename from the given path

2012-08-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 17, 2012, at 10:00 AM, Rainer M Krug r.m.k...@gmail.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/08/12 15:04, Berend Hasselman wrote: On Fri, Aug 17, 2012 at 5:28 AM, Rantony antony.akk...@ge.com wrote: Hi, Here i have a file path, for eg : - FPath -

Re: [R] Remove several numbers from a sequence

2012-08-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at ?setdiff Michael On Aug 17, 2012, at 12:18 PM, penguins cat...@bas.ac.uk wrote: Can anyone tell me how to remove several numbers for a sequence. For example: xx- c(1,5,7,10) yy-seq(1,10,1) how do I get take xx away from yy to get the new sequence 2,3,4,6,8,9 Many

Re: [R] dimnames in an array(I'll be grateful if this message will be passed to all list users)

2012-08-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
. Michael regards, A Thu, 16 Aug 2012 00:00:35 -0400 от R. Michael Weylandt michael.weyla...@gmail.com: On Wed, Aug 15, 2012 at 3:57 AM, aleksandr shfets a_shf...@mail.ru wrote: Hi Michael, Thanks for help on double brackets: I wasn't aware of this use of them. I went back to readjust my

Re: [R] Appending many different and separate Excel files using R

2012-08-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 17, 2012, at 4:19 PM, Amir Kasaeian amir_kasae...@yahoo.com wrote: Dear all, Good day! I have a problem in reading Excel files in R and appending them to each other. Suppose we have several Excel files in a directory with headers and want to use R to append them in a single file

Re: [R] R function to fit ARCH and GARCH models

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
Indeed -- many of them (find a recent post on Pat Burns Portfolio Probe blog for a comprehensive discussion) -- also see rugarch. Michael On Aug 13, 2012, at 8:17 AM, Sajeeka Nanayakkara nsaje...@yahoo.com wrote: Is there any R function to fit ARCH and GARCH models for univariate time

Re: [R] Standard introductory presentation

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
You could do much worse than Bill Venables' short course presentation given at UseR 2012. Keep up the good work! Michael On Aug 13, 2012, at 3:13 PM, clangkamp christian.langk...@gmxpro.de wrote: Hi Everyone In the Contributed Documentation part of the R Project website there are dozens

Re: [R] pass by reference

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 13, 2012, at 9:23 PM, Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: Hi Jim, R, What you just showed me simply prints out the 2nd column. If you inspect your original data, it still just has 1 column. So its still passing by value. Yes -- that's entirely by design.

Re: [R] pass by reference

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 13, 2012, at 9:30 PM, Sachinthaka Abeywardana sachin.abeyward...@gmail.com wrote: Think you are missing the point, assigning the value back is the same as passing by value. This is rather inefficient if you ever have to deal with large datasets. You dont want to keep having a local

Re: [R] A drawing problem with R

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
What's your sessionInfo()? And how did you Change the locale? And what was your actual plot command and graphics device? Michael On Aug 13, 2012, at 10:17 PM, Derrick Guan guanyonghu...@gmail.com wrote: Dear R-help mailing list, I have a drawing problem with R: I need to draw an

Re: [R] A drawing problem with R

2012-08-13 Thread R. Michael Weylandt michael.weyla...@gmail.com
And I changed the R Console to English by adding language=English to R properties-Target 2012/8/14 R. Michael Weylandt michael.weyla...@gmail.com michael.weyla...@gmail.com What's your sessionInfo()? And how did you Change the locale? And what was your actual plot command and graphics

Re: [R] Zoo object problem: Find the column name of a univariate zoo object

2012-08-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 9, 2012, at 8:32 PM, jpm miao miao...@gmail.com wrote: Hi everyone and Achim, Achim, I appreciate your help about the function NCOL. When I use NCOL instead of ncol, I can find out the number of columns (number of time series) in the presence of only one time series (one

Re: [R] debug vs regular mode

2012-08-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 9, 2012, at 9:14 PM, David Winsemius dwinsem...@comcast.net wrote: On Aug 9, 2012, at 4:56 PM, Zhang, Peng wrote: Dear all, I had a R segmentation fault, and then invoked debug mode and ran step by step. 2. Why does the same function behave differently under debug and

Re: [R] Vector size limit for table() in R-2.15.1

2012-08-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Aug 9, 2012, at 7:29 PM, Sean Ruddy srudd...@gmail.com wrote: Hi, First, thanks in advance. Some useful info: version platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu version.string R version 2.15.1

Re: [R] r-forge down?

2012-08-07 Thread R. Michael Weylandt michael.weyla...@gmail.com
Entirely different project. (confusingly similar name though) M On Aug 7, 2012, at 5:29 PM, Roy Mendelssohn roy.mendelss...@noaa.gov wrote: http://www.rforge.net -Roy On Aug 7, 2012, at 3:25 PM, Alexander Shenkin wrote: Hi Folks, I've looked around, haven't found anything, and I'm

Re: [R] sapply and matrix command

2012-08-04 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at ?expand.grid Michael On Aug 4, 2012, at 5:03 PM, alijk1989 [via R] ml-node+s789695n463919...@n4.nabble.com wrote: Thanks again for the help looks like this will be useful for what I'm doing. Is there any way to use combn to return combinations of values with themselves:

Re: [R] Plotting in x and y Graph Using 1st Quadrant Only

2012-07-28 Thread R. Michael Weylandt michael.weyla...@gmail.com
plot(1:5) seems to suffice. More generally, plot(x, y, xlim = c(0, max(x)), ylim = c(0, min(y))) if I understand your request. Michael On Jul 27, 2012, at 5:58 PM, Matilda E. Gogos matildaelizabe...@gmail.com wrote: How can I graph in x and y using the 1st quadrant, using the cartesian

Re: [R] Counting frequency within each range

2012-07-26 Thread R. Michael Weylandt michael.weyla...@gmail.com
Combine cut() and table() Michael On Jul 26, 2012, at 8:22 PM, Chintanu chint...@gmail.com wrote: Hi, This is a simple problem, but for the life of me I cannot find the answer. How to determine frequency within given ranges ? I know that table() gives frequency, for example a -

Re: [R] code coverter r to C

2012-07-26 Thread R. Michael Weylandt michael.weyla...@gmail.com
Various abortive attempts have been tried, but no -- nothing of production quality. [To my knowledge] Michael On Jul 26, 2012, at 3:37 PM, suman kumar sumpr...@gmail.com wrote: Hi all, is there a package for converting R code into C code? Thanks. Suman -- View this message in

Re: [R] Linear Model Prediction

2012-07-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 24, 2012, at 1:38 PM, cm bunnylove...@optonline.net wrote: How do I set it up? Because when I do predict(model) I get a ton of points, not just one. You need to supply newdata= . predict() without new data gives predicted values for the predictors you for the model to.

Re: [R] Library control

2012-07-21 Thread R. Michael Weylandt michael.weyla...@gmail.com
They are called packages, not libraries. On Jul 21, 2012, at 5:19 PM, darnold dwarnol...@suddenlink.net wrote: All, 1. Is there a command that tells you what libraries are loaded? Loaded is a fluid idea** in a namespace world, but search() will let you know what's on the search path

Re: [R] Substitute list value

2012-07-11 Thread R. Michael Weylandt michael.weyla...@gmail.com
It should. Reproducible example of it not? Michael On Jul 11, 2012, at 3:06 PM, Charles Stangor cstan...@gmail.com wrote: I can't seem to determine how to get the name of a list member to substitute as a variable name: ll - list(a1 = a,a2 = b) t1[t==ll[1], v] - 99 why doesn't this

Re: [R] Variance Inflation factor

2012-07-11 Thread R. Michael Weylandt michael.weyla...@gmail.com
Which Linux are you running? For distros with package managers, that's usually all you need. Also Check up on the R-SIG-Debian (including Ubuntu) or R-SIG-Fedora as appropriate if you need more help. Michael On Jul 11, 2012, at 6:26 PM, Hui Du hui...@dataventures.com wrote: Thanks, all. I

Re: [R] Use of Sappy and Tappy for Mathematical Calculation

2012-07-10 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 10, 2012, at 11:30 AM, Nordlund, Dan (DSHS/RDA) nord...@dshs.wa.gov wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rantony Sent: Tuesday, July 10, 2012 3:17 AM To: r-help@r-project.org Subject: [R] Use of

Re: [R] Need HELP: how find and use a csv file?

2012-07-10 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 10, 2012, at 2:56 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Tue, 10 Jul 2012, Faradj Koliev wrote: I got a csv file ( skater.csv) which i could read by typing: read.csv(file=/Users/kama/Desktop/skatter.csv, header=TRUE, sep=;) Try: skatter -

Re: [R] Mann-Whitney by group

2012-07-10 Thread R. Michael Weylandt michael.weyla...@gmail.com
Untested, I think you need to lapply() over thing with some sort of extractor: lapply(thing, function(x) x[['p.value']]) Michael On Jul 10, 2012, at 3:45 PM, Oxenstierna david.chert...@gmail.com wrote: This works very well--thanks so much. By way of extension: how would one extract

Re: [R] mfrow and centering plots when there's an odd number

2012-07-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at ?layout Michael On Jul 9, 2012, at 5:15 PM, Dustin Fife fife.dus...@gmail.com wrote: Let me start with an example: par(mfrow=c(2,3)) for (i in 1:5){ x = rnorm(100) y = .5*x + rnorm(100, 0, sqrt(1-.5^2)) plot(x,y) } Note that there's five plots and six spaces

Re: [R] 回复: Re: skipped correlation

2012-07-07 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 5, 2012, at 9:30 PM, qinjiaolongqinjiaol...@126.com wrote: Dear Michael, Thanks a lot for your help. As I searched, the “scor” function is a robust correlation, which is cited by Wilcox, R.R., Inferences Based on a Skipped Correlation Coefficient. Journal of Applied

Re: [R] reshape2 errors on data frame

2012-07-05 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jul 5, 2012, at 1:28 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Thu, 5 Jul 2012, Rich Shepard wrote: I wonder if the issue is with the logical columns; I've not used them before, only dates, factors, and numerals. I'll try without the logicals and see if there's a difference.

Re: [R] loop in list

2012-06-30 Thread R. Michael Weylandt michael.weyla...@gmail.com
I might think replicate() is slightly more idiomatic, but I'm not in a position to check if simplify=FALSE will keep a list. Best, Michael On Jun 30, 2012, at 7:13 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, You can avoid the loop using lapply. f - function(x) sample(100, 10)

Re: [R] Nested For Loop

2012-06-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Don't (can't) use paste0 with sep='' -- that's redundant, and I'm surprised not an error. Michael On Jun 29, 2012, at 7:18 PM, arun smartpink...@yahoo.com wrote: Hi, I knew that you already got many replies. Here is my contribution.

Re: [R] File Handling in R

2012-06-28 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at scan and/or readLines Michael On Jun 28, 2012, at 9:02 AM, HIMANSHU MITTAL hm3...@gmail.com wrote: Hello all, I have a txt file with some data which isn't in any organized form like a table, but just simple text. Is there any way to read the file char by char and store the

Re: [R] R function similar to gradient function in Matlab?

2012-06-21 Thread R. Michael Weylandt michael.weyla...@gmail.com
I don't have a Matlab license or enough experience with it to know what gradient does, but I know there's a Matlab-to-R dictionary out there that many folks find helpful. It might have what you need (or just be generally useful). http://cran.r-project.org/doc/contrib/Hiebeler-matlabR.pdf Not

Re: [R] How to calculate values with percent sign imported from Excel?

2012-06-20 Thread R. Michael Weylandt michael.weyla...@gmail.com
Something like: X - as.character(data.name) X - as.double(gsub(%,, X))/100 mean(X) quantile(X) etc. Untested [I'm not at my computer so the args for gsub() might be out of order] but one possible solution pattern. Michael On Jun 20, 2012, at 8:26 PM, C W tmrs...@gmail.com wrote: Hi R

Re: [R] Inconsistency using seq

2012-06-18 Thread R. Michael Weylandt michael.weyla...@gmail.com
No, this is rather the nature of floating point calculations. You may perhaps be looking for ?all.equal or R FAQ 7.31 (I think that's the one) which is google-able. It's a complicated subject, but those should get you started. Best, Michael On Jun 18, 2012, at 2:58 PM, hamoreno

Re: [R] Multi-threads in R

2012-06-17 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at the parallel package which ships with all current versions of R. Michael On Jun 17, 2012, at 11:39 AM, Gary Dong pdxgary...@gmail.com wrote: Dear R users, I'm wonder if there is a easy way to make R use multi-CPUs on my computer. My computer has four CPUs but R uses only

Re: [R] noob requesting help

2012-06-16 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Jun 16, 2012, at 1:56 PM, capital_P peterv...@hotmail.com wrote: David Winsemius wrote Try dat2 - data.frame(do.call(cbind, dat), stringsAsFactors=FALSE) Use instead: dat2 - data.frame( dat, stringsAsFactors=FALSE) Both do not seem to work: dat2 -

Re: [R] Storing datasets

2012-06-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
Take a look at ?replicate. Michael On Jun 9, 2012, at 5:16 AM, Rody rodric_seu...@hotmail.com wrote: Hi everyone I need to make a work for school in R and one of my questions is to create 225 datasets of 100 observations and they need to be t_225 distributed. So, I know how to make one

Re: [R] evaluate whether function returns error

2012-05-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'm not sure I follow... It's an error -- what do you mean by evaluate? If you are looking to catch errors, you can do so with try or tryCatch and then check for inherits(x, try-error) to see if there was an error. See the examples for details of how exactly to set this up -- I'm not at a

Re: [R] How to change width of bar when there are very few bars?

2012-05-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
You can supply a width argument but you also need xlim if I remember right for the specification to have visible effect. Michael On May 25, 2012, at 2:03 PM, Manish Gupta mandecent.gu...@gmail.com wrote: http://r.789695.n4.nabble.com/file/n4631371/Bar_Chart.png How to control width of

Re: [R] Query about creating time sequences

2012-05-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
One (somewhat kludgy) way would be to use seq() to make one day's worth of times then to pass those to outer() to add in the needed days and then coerce the whole thing back to a sorted vector. I'm not at a computer right now so this won't be quite right but something like x -

Re: [R] triangular matrices input/output

2012-05-16 Thread R. Michael Weylandt michael.weyla...@gmail.com
Do leave the posts for anyone else who might google the same question. (I don't think you really could delete the post anyways, perhaps only on one mirror) You could probably use some combination or rev() and t() to fill by row, but I haven't thought through the geometry all the way yet.

Re: [R] Help with writing data to csv

2012-05-12 Thread R. Michael Weylandt michael.weyla...@gmail.com
By definition a csv is comma-separated so you can't set a separator. The general function which you seem to be seeking is write.table Michael On May 12, 2012, at 3:33 PM, DL chombito...@hotmail.com wrote: I am trying to write data to csv but I am having issues with the separations.

Re: [R] x axis dates

2012-05-12 Thread R. Michael Weylandt michael.weyla...@gmail.com
My guess is that this is sensitive to the size of the graphics device being used so the simplest thing to do is simply make your plot device bigger. Otherwise, we'll need a reproducible example. Michael On May 12, 2012, at 1:49 PM, pip philsiv...@hotmail.com wrote: The following data spans

Re: [R] Matching - finding and listing data that is one object but not in another

2012-05-11 Thread R. Michael Weylandt michael.weyla...@gmail.com
? setdiff Michael On May 11, 2012, at 8:50 AM, James Holland holland.ag...@gmail.com wrote: What is the best way to find out what elements/numbers that are in one object are not in another. I came up with this method, but I'm wondering if there is a more efficient way (and one that

Re: [R] How to re-order clusters of hclust output?

2012-05-11 Thread R. Michael Weylandt michael.weyla...@gmail.com
I don't have a general answer to your question, but 1L and 2L are just the integers 1 and 2 (the L makes them integers instead of doubles which is useful for some things) Michael On May 11, 2012, at 2:15 PM, Emmanuel Levy emmanuel.l...@gmail.com wrote: Hello, The heatmap function

Re: [R] Matrix invert

2012-05-11 Thread R. Michael Weylandt michael.weyla...@gmail.com
a[NROW(a):1, ] Michael On May 11, 2012, at 3:00 PM, Trying To learn again tryingtolearnag...@gmail.com wrote: I all, I have a matrix like this a= 1 4 2 7 3 6 I want to create a new matrix b= 3 6 2 7 1 4 Anyone knows if there is a reverse function? I can do it

Re: [R] missing part of plot after exporting as eps o ps

2012-05-09 Thread R. Michael Weylandt michael.weyla...@gmail.com
Reproducible example? Michael On May 9, 2012, at 6:49 PM, Ricardo Gomez ricardogome...@yahoo.co.nz wrote: I'm using ggplot2 to create some plots. Whenever I export a plot as a eps or ps. only a portion of the plot is printed. This doesn't happen with other formats such png. Has anybody

Re: [R] interactive loop

2012-05-02 Thread R. Michael Weylandt michael.weyla...@gmail.com
I think readline() will do what you want. It can display a message and take user input, assigning it to a character value so you might need as.numeric() Michael On May 2, 2012, at 12:08 PM, Ondřej Mikula onmik...@gmail.com wrote: Dear R-helpers, I have a number of point configurations

Re: [R] Forecast Package for 2.15.0

2012-05-01 Thread R. Michael Weylandt michael.weyla...@gmail.com
No What have you tried? OS? R build? Install method? Error messages? Note this has some C++ dependencies so it might be a little tricky to compile if you are missing necessary tools. Michael On May 1, 2012, at 2:05 PM, slipkid90515 jessica.lyn.ol...@gmail.com wrote: Anyone else having

Re: [R] How to Export an R outcome to an Excel Spreadshee​t

2012-05-01 Thread R. Michael Weylandt michael.weyla...@gmail.com
? write.csv Michael On May 1, 2012, at 4:52 PM, PaulJr paulberna...@gmail.com wrote: Hello R community, I basically created a normal distribution with mean 2500 and standard deviation = 450 with a sample of size 50 and assigned that to a variable named genvar2 with the following

Re: [R] Equivalent of Nothing (in VBA) or [] in Matlab in R

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Perhaps NULL? Or maybe a vector of length 0you can also just leave arguments missing in R thanks to lazy evaluation so there's not a single equivalent to nothing Hth, Michael On Apr 28, 2012, at 6:04 PM, lm shinilku...@hotmail.com wrote: Hi, I am very new to R so please excuse me if I am

Re: [R] generate random numbers for lotteries

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
On Apr 29, 2012, at 2:25 AM, billy am wickedpu...@gmail.com wrote: Interesting set of question.. I am completely new to R but let me try my luck. Random number in R x - runif(60 , 0 , 10) # 60 numbers from 0 to 10 y- runif(60, 15 , 25) # same as above , from 15 to 25 The second

Re: [R] Count number of rows in a matrix with a character pattern

2012-04-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'd use a combination of rownames(), grepl() and sum(). Get the names with the first, test with the second and count the positives (by coercing TRUE - 1) with the last Michael On Apr 29, 2012, at 3:46 PM, katarv katiasm...@gmail.com wrote: Hi, I have a large data set that I input as a

Re: [R] Returning the coef from two coordinates

2012-04-27 Thread R. Michael Weylandt michael.weyla...@gmail.com
There's a link to it at the end of every R-Help posting. Michael On Apr 27, 2012, at 5:47 PM, Hans Thompson hans.thomps...@gmail.com wrote: Where can I find the posting guide? I've been trying to use A handbook of Statistical Analyses Using R and google searching but I will be reading An

Re: [R] Help on time series Hurst exponent

2012-04-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
! Could you plz point to some easy tutorials regarding this? On Wed, Apr 25, 2012 at 8:14 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: You really don't want to use ts() -- if you want to use the tools in fArma use a timeSeries (provided by the package of the same name) Michael

[R] On the Design of the R Language

2012-04-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
http://www.cs.purdue.edu/homes/jv/pubs/ecoop12.pdf A new paper out on R the language -- I'm not all the way through it but it's been an interesting read so far. Thought it might be of interest to the list. Michael Weylandt [[alternative HTML version deleted]]

Re: [R] understanding the FUNCTION function

2012-04-25 Thread R. Michael Weylandt michael.weyla...@gmail.com
Functions are not subroutines; that is, the effects (including assignments) are not global. You need something like F - function(x) x A - F(3) But that seems unnecessary... A - 3 Michael On Apr 25, 2012, at 10:06 PM, michaelyb cel81009...@gmail.com wrote: Hello, I am trying to

Re: [R] Errors Updating Libraries (2.15)

2012-04-24 Thread R. Michael Weylandt michael.weyla...@gmail.com
Perhaps change mirror as well. Michael On Apr 24, 2012, at 4:29 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Tue, 24 Apr 2012, R. Michael Weylandt wrote: system.time(install.packages(c(plyr,reshape2,stringr), type = source)) Strange. Same results: Error in library(reshape2)

Re: [R] Assignment problems

2012-04-22 Thread R. Michael Weylandt michael.weyla...@gmail.com
Look at ?ifelse, a combination of logical subscripting and mean(), or even better ?ave -- I can't say too much more; there's a no homework policy on this list and I recognize that first solution as mine already... (I should have noted that the first time) Michael On Apr 22, 2012, at 2:54 PM,

Re: [R] Help in using unique count by match function

2012-04-19 Thread R. Michael Weylandt michael.weyla...@gmail.com
I think the OP is looking for the construct length(unique(x)) but not really sure what the rest of the question is. Michael On Apr 19, 2012, at 2:12 AM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi Your question is rather cryptic. Why the output shall be 3? What has unique count to do

Re: [R] how to save multiple work space

2012-04-10 Thread R. Michael Weylandt michael.weyla...@gmail.com
You'll need to save them manually to avoid name conflicts -- save.image() is the function to do so but you need to give a file name. Michael On Apr 10, 2012, at 7:41 AM, ya xinxi...@163.com wrote: Hi guys, I have a question. I am running 3 R sessions simultaneously for different

Re: [R] plot with a regression line(s)

2012-04-04 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'm not sure what your definition of easier would be, but there are some style things you might want to be aware of: I) the name is likely to hit up against the S3 generic plot() when applied to a glm object. This might lead to strange bugs at some point. II) you can test !is.null once and use

Re: [R] CSPADE error: system invocation error

2012-04-03 Thread R. Michael Weylandt michael.weyla...@gmail.com
I'm heading to bed now but will try to get a look at this in the morning - forwarding this to R-help so others have a chance of getting to it before me. (Particularly those who know the package better than me) Michael On Apr 4, 2012, at 12:44 AM, Sue Xu sue...@hollard.com.au wrote: Hi

Re: [R] time my process

2012-03-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
?Sys.sleep() or set par(ask=TRUE) Michael On Mar 29, 2012, at 4:43 AM, threshold r.kozar...@gmail.com wrote: Dear R users, given a simple plotting procedure below, how can I make the figures changing on a slower rate (say every 2 sec) for(i in 1:100){ts.plot(rnorm(i))} Best, robert

Re: [R] Load datasets

2012-03-29 Thread R. Michael Weylandt michael.weyla...@gmail.com
Yes, but if the OP wants to assign the values to ineed (which I think is the request), he'll need get() Michael On Mar 29, 2012, at 12:50 PM, David Winsemius dwinsem...@comcast.net wrote: On Mar 29, 2012, at 12:13 PM, R. Michael Weylandt wrote: Perhaps something like alldata =

Re: [R] lapply and paste

2012-03-28 Thread R. Michael Weylandt michael.weyla...@gmail.com
Siefker ebs15...@gmail.com wrote: Thank you, I was confused about that. What exactly is lapply for then, if R handles this kind of thing automatically? Are there functions that are not vectorized? On Wed, Mar 28, 2012 at 1:37 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: I think

  1   2   3   >