[R] Writing Unicode Text into Text File from R (in Windows)

2014-02-04 Thread Majid Einian
Dear R Helpers, See the Code: a - intToUtf8(1777) show(a) zz - file(description=test.txt,open=w,encoding=UTF-8) cat(a, file = zz) close(zz) in a Unicode aware environment (such as RGui console or RStudio Console) you will see this as output: [1] Û± but the character is not written correctly

[R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca
Dear Contributors I am asking some advice on how to solve the following problem. I have a list composed of 78 elements, each of which is a matrix of factors and numbers, similar to the following bank_name date px_last_CIB Q.Yp_made p_for 1 CIB 10/02/061.33 p406-q406

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca
Dear Contributors sorry but the message was sent involuntary. I am asking some advice on how to solve the following problem. I have a list composed of 78 elements, each of which is a matrix of factors and numbers, similar to the following bank_name date px_last_CIB Q.Yp_made p_for 1

[R] Running the Loop

2014-02-04 Thread Katherine Gobin
Dear R forum, I have following data.frames dat = data.frame(id = c(1:3), root = c(0.10, 0.20, 0.74), maturity_period = c(20, 155, 428), mtm = c(1000, 1, 10), curve = c(USD, USD, USD)) dat   id root maturity_period   mtm curve 1  1 0.10              20 1e+03   USD 2  2 0.20            

Re: [R] Capturing output of a C executable

2014-02-04 Thread Duncan Murdoch
On 14-02-03 5:44 PM, Phil Spector wrote: Dennis - The return value from .C will almost never be useful. Are you limiting this to the specific situation Dennis described, or making a more general claim? The more general claim is clearly false. Lots of packages return useful results

Re: [R] Fit Negbin glm model with autoregressive correlation structure

2014-02-04 Thread F.Vial
Dear Cristiano, Thank you for your suggestion. It looks like an interesting option for what we are trying to do. We'll look at your paper and package in more details. Regards, Flavie -- View this message in context:

Re: [R] Writing Unicode Text into Text File from R (in Windows)

2014-02-04 Thread Duncan Murdoch
On 14-02-04 5:49 AM, Majid Einian wrote: Dear R Helpers, See the Code: a - intToUtf8(1777) show(a) zz - file(description=test.txt,open=w,encoding=UTF-8) cat(a, file = zz) close(zz) in a Unicode aware environment (such as RGui console or RStudio Console) you will see this as output: [1] Û±

Re: [R] creating an equivalent of r-help on r.stackexchange.com ?

2014-02-04 Thread Marc Schwartz
On Feb 3, 2014, at 8:54 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Mon, Feb 3, 2014 at 8:41 PM, Marc Schwartz marc_schwa...@me.com wrote: Hi All, As I have noted in a prior reply in this thread, which began last November, I don't post in SO, but I do keep track of the

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread arun
Hi, Try: If `lst1` is the list: do.call(rbind,lapply(lst1,function(x) x[x[,p_made]==406,])) A.K. On Tuesday, February 4, 2014 8:53 AM, Francesca francesca.panco...@gmail.com wrote: Dear Contributors sorry but the message was sent involuntary. I am asking some advice on how to solve the

[R] Handling special characters in reading and writing to CSV

2014-02-04 Thread Venkata Kirankumar
Hi All, I have some data with different special characters, newline character, and different language characters in a CSV file like `~!@#$%^*| ()-_+={[}]|\:;',.?/ in data, while I am trying to read this CSV and trying to do calculations I am not able to get this data as there in single cell. I

[R] correlog function in pgirmess package

2014-02-04 Thread Alicia
Dear R-help, I used the correlog function of pgirmess package to create a spatial correlogram for Moran's I. The function gives Moran's coefficient with a p value for each distance class. My question is what is the unit for the distance classes? Here is the outcome of the function: Moran I

[R] GCV=0

2014-02-04 Thread Husam El Alqamy
Dear List I am trying to use gam function in mgcv 17.26. I have a big data set of about 40,000 data points. Every time that I run it ,it results in GCV score of 0 Family: gaussian Link function: identity Formula: D ~ s(Ghazl_res) + s(Depth) Estimated degrees of freedom: 3.77 2.91

[R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread ashrafali
R_format.csv http://r.789695.n4.nabble.com/file/n4684711/R_format.csv Hi, I am new to R Programming and need help on categorizing and plotting the data in the attached excel file into tabular format. Please help. -- View this message in context:

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread Greg Snow
First, .csv files are not Excel files (and I was unable to open the one you link to). Second, while the word Help is used many ways, this list is intended to assist, i.e. you show that you have done some work and tell us where you are stuck and we are happy to give hints and pointers to help you

Re: [R] update.formula() to add interaction terms

2014-02-04 Thread Marie-Pierre Sylvestre
Many thanks, that is exactly what I was looking for. I did not know about bquote, interesting! MP On Mon, Feb 3, 2014 at 6:29 PM, William Dunlap wdun...@tibco.com wrote: Is this the sort of thing you are looking for? fm - y ~ x1 + x2 + x3 + log(x4) # Use terms() instead of just

[R] mgcv: distribution of dev with Poisson data

2014-02-04 Thread Greg Dropkin
mgcv: distribution of dev hi I can't tell if this is a simple error. I'm puzzled by the distribution of dev when fitting a gam to Poisson generated data. I expected dev to be approximately chi-squared on residual d.f., i.e. about 1000 in each case below. In particular, the low values in the 3rd

[R] How to describe gls post-hoc test in manuscript

2014-02-04 Thread Beaulieu, Jake
Hello, I used the gls function from the nlme package to run a generalized least squares model. One of the predictor variables is a factor with 3 levels. Here is a reproducible example: library(nlme) response - c(rnorm(5,1,3), rnorm(5,6,1), rnorm(5,10,5)) foo - data.frame(response = response,

[R] Not able to find files in working directory

2014-02-04 Thread Sschratz87
Hello. I am new to R here and I am coming across a small error in my code I am trying to run. I am trying to make a table of some value from a folder on my computer. I was able to pull a txt file from the folder and make bar graphs etc... however now I cannot do anything from this file and R is

Re: [R] Change file name

2014-02-04 Thread arun
Hi, Try: from1 - list.files() ##folder where files are stored  from1 #[1] p126r62_5t19880613_nn1.tif.gz p126r62_5t19880613_nn2.tif.gz #[3] p200r65_5t19880613_nn1.tif.gz to1 - gsub(^p(\\d+)r(\\d+)\\_.{2}(\\d{8})\\_nn(.*),LT5\\10\\2\\3_B\\4,from1)  file.rename(from1,to1) #[1] TRUE TRUE TRUE  

[R] R Books from Chapman Hall/CRC

2014-02-04 Thread Calver, Rob
Take advantage of a 20% discount on the most recent R books from Chapman Hall/CRC! We are pleased to offer our latest R books at a 20% discount through our website. To take advantage of this offer, simply visit www.crcpress.com, choose your titles, and insert code EZL20 in the Promotion Code

Re: [R] Not able to find files in working directory

2014-02-04 Thread Ista Zahn
You need to read the file in first. More generally, you need to spend some time with an introductory R tutorial. There are many, including the Introduction to R shipped with every copy of R, as well as the ones listed on the R website at http://cran.r-project.org/other-docs.html. Best, Ista On

[R] two active RGL device / linked devices

2014-02-04 Thread Omphalodes Verna
Dear list! My question is, if there is an option in RGL, that two devices can be active. It means, when eg. points in first device is rotated also points in second devies is rotated. For example: library(rgl) x - rnorm(1000) y - rnorm(1000) z - rnorm(1000) open3d() points3d(x,y,z) open3d()

Re: [R] creating an equivalent of r-help on r.stackexchange.com ?

2014-02-04 Thread Keith S Weintraub
My sentiments exactly! Thanks to all for taking the time to flesh out the potential flaws of the stackexchange solution. KW Date: Tue, 04 Feb 2014 10:36:21 +1300 From: Rolf Turner r.tur...@auckland.ac.nz To: Bert Gunter gunter.ber...@gene.com Cc: r-help@r-project.org r-help@r-project.org

Re: [R] two active RGL device / linked devices

2014-02-04 Thread Duncan Murdoch
On 04/02/2014 12:08 PM, Omphalodes Verna wrote: Dear list! My question is, if there is an option in RGL, that two devices can be active. It means, when eg. points in first device is rotated also points in second devies is rotated. For example: library(rgl) x - rnorm(1000) y - rnorm(1000) z -

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-04 Thread Law, Jason
Clint and Liviu, Stackoverflow also has rss feeds available, if you prefer being pushed the information that way. For the R tagged questions it's here: http://stackoverflow.com/feeds/tag/r. Since some e-mail clients double as feed readers, you may be able to read the feed from your e-mail

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Francesca Pancotto
Hello A. k. thanks for the suggestion. I tried this but it does not work. I probably use it in the wrong way. This is what it tells me, do.call(rbind,lapply(bank.list,function(x) x[x[,p_made]==406,])) Errore in match.names(clabs, names(xi)) : names do not match previous names What am I

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread Rui Barradas
Hello, With me the following worked: URL - http://r.789695.n4.nabble.com/file/n4684711/R_format.csv; dat - read.csv(URL) str(dat) 'data.frame': 34 obs. of 2 variables: $ Tasks : Factor w/ 10 levels Code upgrade BE/FE,..: 4 4 4 4 8 6 6 6 6 6 ... $ Client.Mnemonic: Factor w/ 18

Re: [R] MCPMod method

2014-02-04 Thread Adams, Jean
I can't answer your question, but I did notice the CRAN page for the MCPMod package states, The MCPMod package will not be further developed, all future development of the MCP-Mod methodology will be done in the DoseFinding R-package. http://cran.r-project.org/web/packages/MCPMod/index.html Jean

Re: [R] Which analysis for a set of dummy variables alone ?

2014-02-04 Thread Adams, Jean
This sounds more like a statistics question than an R question. You may have better luck posting to a different forum, e.g., Cross Validated, http://stats.stackexchange.com/. Jean On Tue, Feb 4, 2014 at 3:19 AM, sylvain willart sylvain.will...@gmail.comwrote: Dear R-users, I have a dataset

Re: [R] GLM weights for the Poisson family

2014-02-04 Thread David Winsemius
On Feb 3, 2014, at 11:12 PM, IamRandom wrote: I am running a simple example of GLM. If I include weights when family=poisson then the weights are calculated iteratively and $weights and $prior.weights return different values. The $prior.weights are what I supplied and $weights are the

Re: [R] GLM weights for the Poisson family

2014-02-04 Thread Rolf Turner
On 04/02/14 20:12, IamRandom wrote: I am running a simple example of GLM. If I include weights when family=poisson then the weights are calculated iteratively and $weights and $prior.weights return different values. The $prior.weights are what I supplied and $weights are the posterior

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-04 Thread Clint Bowman
Jason, Thanks--I've found an RSS feed from EPA very useful and will check Stackoverflow's. Clint Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread arun
Hi, Looks like the colnames of list elements are not the same. For e.g. lst1 - list(structure(list(bankname = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = CIB, class = factor), date = structure(c(1L, 2L, 3L, 1L, 2L, 3L), .Label = c(10/02/06, 10/23/06, 11/22/06 ), class = factor), px_last_CIB =

Re: [R] Handling special characters in reading and writing to CSV

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 7:58 AM, Venkata Kirankumar wrote: Hi All, I have some data with different special characters, newline character, and different language characters in a CSV file like `~!@#$%^*| ()-_+={[}]|\:;',.?/ in data, while I am trying to read this CSV and trying to do

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread Jim Lemon
On 02/05/2014 06:54 AM, Francesca Pancotto wrote: Hello A. k. thanks for the suggestion. I tried this but it does not work. I probably use it in the wrong way. This is what it tells me, do.call(rbind,lapply(bank.list,function(x) x[x[,p_made]==406,])) Errore in match.names(clabs, names(xi))

Re: [R] Selecting elements in lists with a row condition

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 11:54 AM, Francesca Pancotto wrote: Hello A. k. thanks for the suggestion. I tried this but it does not work. I probably use it in the wrong way. This is what it tells me, do.call(rbind,lapply(bank.list,function(x) x[x[,p_made]==406,])) Errore in

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 8:49 AM, Greg Snow wrote: First, .csv files are not Excel files (and I was unable to open the one you link to). This is what was in the linked file: Tasks,Client Mnemonic Ibus ,ANMC_AK Ibus ,ANMC_AK Ibus ,YAVA_AZ Ibus ,YAVA_AZ Release upgrade(BE),ANMC_AK OS upgrades

Re: [R] Renumber series

2014-02-04 Thread arun
Hi, Try: set.seed(89)  dat1 - within(data.frame(column1=LETTERS[1:5],column2=rnorm(5)),order1 - order(order(column2))+32)  within(dat1,order2 - order(order(dat1$order1)))  column1    column2 order1 order2 1   A -1.4516020 33  1 2   B  0.7081001 35  3 3   C  1.5930974  

Re: [R] Renumber series

2014-02-04 Thread Bert Gunter
??? What's wrong with simply order - 32 ?? -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. H. Gilbert Welch On Tue, Feb 4, 2014 at 2:37 PM, arun smartpink...@yahoo.com

[R] Revolution blog: January 2014 roundup

2014-02-04 Thread David Smith
[Apologies if you already saw this on r-devel, email error on my behalf -- DMS] Revolution Analytics staff write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread ashrafali
I have converted the excel file to csv and imported the data using R Studio. This is the file R_format.xlsx http://r.789695.n4.nabble.com/file/n4684737/R_format.xlsx I have coded the following: list(R_format$Tasks) list(R_format$Client.Mnemonic) task.freq=table(R_format$Tasks) task.freq

Re: [R] Not able to find files in working directory

2014-02-04 Thread Sschratz87
I have already done that. It was working and now it isn't. The program was not closed or restarted. It just stopped working. Squid-read.table(Squid.txt,header=T) Error in file(file, rt) : cannot open the connection In addition: Warning message: In file(file, rt) : cannot open file

[R] Adjusting the x axis range in effects plots

2014-02-04 Thread Mark Hovenden
G'day All, I am having some difficulties with effects plots from the effects package. I am doing partial regression analyses of normal linear models and obtain lovely effect plots with a linear effect line and 95%CL. No problem so far. The problem is that I want to overlay the actual datapoints

[R] Merging xts List created using panel data

2014-02-04 Thread Jairaj Gupta
Hi, I have done the following: library(foreign) RNOM - read.dta(Return Panel without missing.dta) library(PerformanceAnalytics) RNOM_list-split(RNOM,RNOM$gvkey) xtsList - lapply(RNOM_list, function(x) { attrCol - c(conm) numCol - c(gvkey,prccm,trfm, trt1m) y - xts(x[,numCol],

Re: [R] Merging xts List created using panel data

2014-02-04 Thread Joshua Ulrich
This is related to: http://stackoverflow.com/q/21393866/271616 http://stackoverflow.com/q/21484267/271616 -- Joshua Ulrich | about.me/joshuaulrich FOSS Trading | www.fosstrading.com On Tue, Feb 4, 2014 at 6:07 PM, Jairaj Gupta j.gu...@2012.hull.ac.uk wrote: Hi, I have done the following:

Re: [R] Running the Loop

2014-02-04 Thread arun
Hi Katherine,Not sure if this helps.  I was able to the result after making up some additional conditions into your function. fun1 - function(x){     lst1 - lapply(seq(n-1),function(i){     with(x,if(maturity_period D[i] maturity_period D[i+1]){             

[R] Pubmed (XML) data to data.frame

2014-02-04 Thread Marc Marí Dell'Olmo
Dear all, I would like to obtain a data.frame with some data selected from pubmed information. For example, I would like to do an specific search and obtain a data.frame with the title of each article and the publication type. Example of syntax: library(reutils) library(XML) pmid -

Re: [R] Categorizing and displaying excel data in tabular format

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 1:40 PM, ashrafali wrote: I have converted the excel file to csv and imported the data using R Studio. This is the file R_format.xlsx http://r.789695.n4.nabble.com/file/n4684737/R_format.xlsx I have coded the following: list(R_format$Tasks)

[R] Obtain the hex code for a given character.

2014-02-04 Thread Rolf Turner
If I have a character such as £ stored in a object called xxx, how can I obtain the hex code representation of this character? In this case I know that the hex code is \u00A3, but if I didn't, how would I find out? I would like a function foo() such that foo(xxx) would return, say, the

Re: [R] Adjusting the x axis range in effects plots

2014-02-04 Thread John Fox
Dear Mark, -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Mark Hovenden Sent: Tuesday, February 04, 2014 6:52 PM To: r-help@r-project.org Subject: [R] Adjusting the x axis range in effects plots G'day All, I am having

Re: [R] GLM weights for the Poisson family

2014-02-04 Thread Rolf Turner
You should direct your inquiry to R-help, not to me personally. I am taking the liberty of cc-ing my reply back to the list. I really haven't the time at the moment to think the issue through thoroughly, but off the top of my head: If you are going to use weighted log likelihoods then any

Re: [R] Obtain the hex code for a given character.

2014-02-04 Thread Duncan Murdoch
On 14-02-04 7:57 PM, Rolf Turner wrote: If I have a character such as £ stored in a object called xxx, how can I obtain the hex code representation of this character? In this case I know that the hex code is \u00A3, but if I didn't, how would I find out? charToRaw will give you the bytes

[R] Justify axis labels in mosaic plot

2014-02-04 Thread Derickson, Ryan, VHACIN
Hello All, I'm trying to right-justify the y-axis labels in a mosaic plot from base R. I've tried too many commands (adj specifically) to list here and nothing works so far. I'm sure this could be done in the vcd or ggplot2 packages, but I would prefer to do it with mosaicplot in base R if at

Re: [R] Obtain the hex code for a given character.

2014-02-04 Thread Jim Lemon
On 02/05/2014 01:01 PM, Duncan Murdoch wrote: On 14-02-04 7:57 PM, Rolf Turner wrote: If I have a character such as £ stored in a object called xxx, how can I obtain the hex code representation of this character? In this case I know that the hex code is \u00A3, but if I didn't, how would I

Re: [R] Obtain the hex code for a given character.

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 4:57 PM, Rolf Turner wrote: If I have a character such as £ stored in a object called xxx, how can I obtain the hex code representation of this character? In this case I know that the hex code is \u00A3, but if I didn't, how would I find out? I would like a

Re: [R] Obtain the hex code for a given character.

2014-02-04 Thread David Winsemius
On Feb 4, 2014, at 8:56 PM, David Winsemius wrote: On Feb 4, 2014, at 4:57 PM, Rolf Turner wrote: If I have a character such as £ stored in a object called xxx, how can I obtain the hex code representation of this character? In this case I know that the hex code is \u00A3, but if

Re: [R] creating an equivalent of r-help on r.stackexchange.com ? (was: Re: Should there be an R-beginners list?)

2014-02-04 Thread Liviu Andronic
Dear all, On Sun, Feb 2, 2014 at 10:49 PM, Liviu Andronic landronim...@gmail.com wrote: It seems that StackOverflow is officially proposing user-generated content for download/mirroring: http://blog.stackoverflow.com/2014/01/stack-exchange-cc-data-now-hosted-by-the-internet-archive/?cb=1

[R] error in building R-2.15.3: configure: error: linking to Fortran libraries from C fails

2014-02-04 Thread Dinesh
Hi, I am trying to build R-2.15.3 and get the following error in /configure --with-readline --enable-R-shlib snip checking for dummy main to link with Fortran 77 libraries... unknown configure: error: in `/home/dinesh/R-build/R-2.15.3': configure: error: linking to Fortran libraries from C

Re: [R] Justify axis labels in mosaic plot

2014-02-04 Thread Jim Lemon
On 02/05/2014 12:41 PM, Derickson, Ryan, VHACIN wrote: Hello All, I'm trying to right-justify the y-axis labels in a mosaic plot from base R. I've tried too many commands (adj specifically) to list here and nothing works so far. I'm sure this could be done in the vcd or ggplot2 packages, but