Re: [R] Reading Chinese Language (GB2312) Input

2012-10-27 Thread Prof Brian Ripley
On 26/10/2012 18:25, jgreenb1 wrote: I am trying to read a csv file with Chinese language text in it. The file should look like this: userid,jobid,Title,companyid,industryids1 82497,1160,互联网产品经理,12 96429,658,企划经理(商业公司),24 14471,95,产品运营经理,25,6 14471,1708,产品营销高级经理,727,2 14471,1558,产品总监,611,4 14471

Re: [R] summation sign

2012-10-27 Thread peter dalgaard
On Oct 27, 2012, at 01:34 , sffarooqi wrote: > Hi all, > I have a very quick question on how to use the summation sign in R for the > function. > Here´s a basic example: the function is sum(i=1 to 5)log(1-xi^2) > Id be grateful if someone knows how to do this without writing it out 5 > times - I

Re: [R] List of multidimensional arrays

2012-10-27 Thread Loukia Spineli
Dear all, for the first array I can get ten 2x2matrices (and I am partially happy for this). Now, I have problem with the 2nd array. It gives three 2x2 matrices for both rows, while it was "supposed" to give five 2x2 matrices in the first row and three 2x2 matrices ONLY in the second row. What cou

Re: [R] Searching up a list of values

2012-10-27 Thread Rui Barradas
Hello, Try the following. idx <- B$ID %in% A B[idx, ] In the case of your data example, the return value is 0 rows. (No matches) Also, the best way to post a data example is using ?dput dput( head(B, 30) ) # copy & paste the output of this Hope this helps, Rui Barradas Em 27-10-2012 07:07,

Re: [R] Optimization in R similar to MS Excel Solver

2012-10-27 Thread Berend Hasselman
On 26-10-2012, at 21:41, Richard James wrote: > > That solution works very well. > > The only issue is that 'rnorm' occasionally generates negative values which > aren't logical in this situation. > Try another random generator. Lognormal, uniform, ... > Is there a way to set a lower limit

[R] why sd() can be applied to character vector?

2012-10-27 Thread Jinsong Zhao
Hi there, In the following example, sd() can be applied to a character vector. However, mean() can not be run in a similar way. Why? I have read sd() man page, however, I don't find information about that behavior. > x <- as.character(1:10) > sd(x) [1] 3.02765 > mean(x) [1] NA Warning messa

Re: [R] why sd() can be applied to character vector?

2012-10-27 Thread R. Michael Weylandt
On Sat, Oct 27, 2012 at 10:16 AM, Jinsong Zhao wrote: > Hi there, > > In the following example, sd() can be applied to a character vector. > However, mean() can not be run in a similar way. Why? > > I have read sd() man page, however, I don't find information about that > behavior. > >> x <- as.ch

[R] Remote access to R/Bioconductor on EBI's 64-bit Linux Cluster

2012-10-27 Thread veepsirtt
Hi Rusers Here is a place for testing R on Cloud. http://www.ebi.ac.uk/Tools/rcloud/ Start the workbench by downloading the package for your operating system (Macintosh or Windows), or via Java Web Start, and you will get access to an instance of R running

Re: [R] why sd() can be applied to character vector?

2012-10-27 Thread Prof Brian Ripley
On 27/10/2012 10:16, Jinsong Zhao wrote: Hi there, In the following example, sd() can be applied to a character vector. However, mean() can not be run in a similar way. Why? I have read sd() man page, however, I don't find information about that behavior. Well, it is there: x: a numer

Re: [R] Encoding

2012-10-27 Thread Eva Prieto Castro
Hi again: I could make tha package (in Windows 7) but it does not run in Mac. Please could you tell me how to make a package in Windows PC with source code saved in utf-8 in the way the package runs on a Mac ? In my pc (where I create the package) : > l10n_info() $MBCS [1] FALSE $`UTF-8` [1] F

Re: [R] rollapply() by time, not entries (width)

2012-10-27 Thread R. Michael Weylandt
I might suggest you take a look at period.apply() in the xts package. Cheers, Michael On Fri, Oct 26, 2012 at 7:33 PM, Jaguar83 wrote: > Hi all- > > Thank you for reading my post. Please bear in mind that I'm very much a > newbie with R! My question is this: > > I'm trying to use rollapply() on

Re: [R] Encoding

2012-10-27 Thread Duncan Murdoch
On 12-10-27 7:28 AM, Eva Prieto Castro wrote: Hi again: I could make tha package (in Windows 7) but it does not run in Mac. Please could you tell me how to make a package in Windows PC with source code saved in utf-8 in the way the package runs on a Mac ? One likely problem is that you need

Re: [R] Searching up a list of values

2012-10-27 Thread arun
Hi, Try this: B<-readLines(textConnection("2534215 4.73483 3.06499 0.70032 2.20247 2.57014 2.68004 5.20362 4.56531 5.53275 4.6597 4.49301 3.26696 4.45926 3.33294 4.91008 4.69106 2.80828 3.85168 4.31348 3.84926 2620456 7.13062 7.40361 7.41215 7.12816 6.03347 7.77204 8.37129 8.4811 8.4156 8.48804 8.

Re: [R] regression analysis in R

2012-10-27 Thread eliza botto
Dear Arun, Barradas and Peter,thankyou so very much for your favour. i was actually more interested in using "Leaps" command. anyway, your replies have helped me to a great deal. Dear Bert Gunter: i know i m not an expert of R, like you. I have been using this forum for the last so many days n

Re: [R] rollapply() by time, not entries (width)

2012-10-27 Thread Joshua Ulrich
On Sat, Oct 27, 2012 at 6:52 AM, R. Michael Weylandt wrote: > I might suggest you take a look at period.apply() in the xts package. > I don't think that will work because it sounds like "J" wants analysis on overlapping intervals, and period.apply works on non-overlapping intervals. I'd suggest u

Re: [R] using match-type function to return correctly ordered data from a dataframe

2012-10-27 Thread Markus Weisner
Hi Jeff. I believe my Function #1 actually does use "%in%" to select the data. I use "%in%" all the time but, as far as I can tell, it can only return a vector of logical values. As a result, it does keep the order of the dataframe from which you are selecting data. It does not, however, appear

Re: [R] using match-type function to return correctly ordered data from a dataframe

2012-10-27 Thread William Dunlap
Is the following what you want? > dfLETTERS <- data.frame(LETTER=LETTERS[1:5], lData=c("Ay","Bee","Cee","Dee","Eee"), row.names=sprintf("LRow%d",1:5)) > z <- c("D", "B", "A", "B") > dfLETTERS[match(z, dfLETTERS$LETTER), ] LETTER lData LRow4D Dee LRow2B Bee

[R] help install RExcel

2012-10-27 Thread tt
Hello, I just installed RExcel but I have some problems. I am writing you the set of commands that I used: > install.packages("RExcelInstaller", "rcom", "rsproxy") > library(rcom) > comRegisterRegistry() > library(RExcelInstaller) > installstatconnDCOM() > installRExcel() But when I select RStar

Re: [R] summation sign

2012-10-27 Thread sffarooqi
thank you vm for the reply! Just to make things a little more complicated --does the equation hold even if the values of x are unknown? More specifically perhaps we can still refer to the made up example Sum(n equal 5)log(1-xi^2) In the problem I am working on, I am writing a modified Newton Opt

[R] Getting error while running unix commands within R using system() function

2012-10-27 Thread siddu479
Hello All, I use Cygwin ( unix on windows) heavily for all my text data processing. Also use Cygwin inbuilt *R* to do numerical processing. *My aim is to integrate R and unix commands to avoid heavy memory usage that R takes normally.* I can run many unix commands using system("some unix comma

Re: [R] Openbugs- Array Index

2012-10-27 Thread SuzieK
Thank you, I'll try the site you suggested. -- View this message in context: http://r.789695.n4.nabble.com/Openbugs-Array-Index-tp4647587p4647659.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https

Re: [R] help install RExcel

2012-10-27 Thread Jeff Newmiller
For RExcel support, see http://rcom.univie.ac.at, where they have various support options including a mailing list. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#.

Re: [R] Getting error while running unix commands within R using system() function

2012-10-27 Thread William Dunlap
To diagnose a problem in R it pays to pull apart your expression into a sequence of simpler ones. E.g., replace your expression system(" awk '{print "Hello"$1}' infile.txt") with the sequence sysCmd <- " awk '{print "Hello"$1}' infile.txt" system(sysCmd) and you will see an error when runnin

Re: [R] SPACECAP error "subscript out of bounds"

2012-10-27 Thread jim holtman
Now is the time to learn how to debug your scripts. First order of business is to add: options(error = utils::recover) to your script. Then type in: ?recover ?browser and carefully read the documentation. Then when the error occurs, you will be in the "browser" and can examine that values of

Re: [R] Stata Database & R

2012-10-27 Thread Daniel Nordlund
Or use read.dta from foreign package. Dan On Oct 26, 2012 1:15 PM, "Loukia Spineli" wrote: > Install the "ares" library first. Then type import.data("the direction you > have saved the data","dta"). > > On Fri, Oct 26, 2012 at 11:10 PM, Lorenzo Isella > wrote: > > > Dear All, > > I am given some

[R] Trouble with first passage time analysis using adehabitatLT

2012-10-27 Thread zlong
Hey all, I've run into a few problems running first passage time analysis. I'm hoping someone might be able to help me sort this out. I'm fine up to the point of creating the ltraj object from a dataset. /test<-read.table("~/Desktop/R_Directory/test.txt",header=TRUE) attach(test) library(adehabi

Re: [R] Getting error while running unix commands within R using system() function

2012-10-27 Thread siddu479
Thanks William, This solved my problem very well. Look like I asked a very trivial question. - Sidda Business Analyst Lead Applied Materials Inc. -- View this message in context: http://r.789695.n4.nabble.com/Getting-error-while-running-unix-commands-within-R-using-system-function

[R] keep average values and delete duplicate rows

2012-10-27 Thread fuckecon
Hello experts, I am sorry that my subject line is confusing, because I am confused as nuts. Let me take a shot at explaining what I am trying to do. I have a data set of log GDP, education, democracy index, and a whole bunch of variables for every country from 1950 to 2000. Each country accounts

Re: [R] keep average values and delete duplicate rows

2012-10-27 Thread Jeff Newmiller
Please read the posting guide... this is not a homework help line. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] keep average values and delete duplicate rows

2012-10-27 Thread arun
HI, I guess it is a bit confusing as to what you want.  In the example dataset, there was no democracy_index, but in the result you want it.  Regarding the median calculation, I guess you want to calculate the median for each country.  I created one more country (China) with fake data.  May b