[R] Use gather with a various number of columns

2019-08-27 Thread lionel sicot via R-help
Hello, I'm using the gather function from the tidyr package to reshape data.frames. For example, for the the following dataframe, I apply the command below.df_initial<-data.frame(col1name=c(1,2,3,4,5,6,7), col2name=c(4,5,6,7,8,9,1), col3name=c(9,8,7,6,5,4,3))df_reshaped<-gather(df_initial, "col1

Re: [R] Structuring Inventory in R

2019-08-27 Thread Jeff Newmiller
Perhaps dta <- data.frame( SKU=c("4950","8488","1159"), Price=c(10,15,3),Qty=c(24,144,16),ID=c("10208473","38447769","43759115") ) Lists are not as easy to optimize performance with as tables are... unless you have a specific reason to use them I would minimize your use of single-element items

Re: [R] Structuring Inventory in R

2019-08-27 Thread Jim Lemon
Hi Alex, At a guess you may want something like this: data.frame(item="SKU",price=10,qty=2,ID="1") This produces a data frame with one row. You will probably want many more rows. Jim On Wed, Aug 28, 2019 at 2:21 PM Alex Naverniak wrote: > > Hi, > I am trying to create Inventory structure w

[R] Structuring Inventory in R

2019-08-27 Thread Alex Naverniak
Hi, I am trying to create Inventory structure with item SKU and 3 subitems like "Price"; "Qty"; "ID". I tried list(SKU,list("Item1","Item2","Item3")). It seem not to work. Please help with ideas. Thanks. Alex [[alternative HTML version deleted]] ___

Re: [R] File corrupted in R/magic number

2019-08-27 Thread Sarah Goslee
Summoning my telepathy, I suspect that you tried to use load() to get your CSV file into R, instead of read.csv() Here's the first link that came up when I searched for "read csv file into R" http://rprogramming.net/read-csv-in-r/ On Tue, Aug 27, 2019 at 2:00 PM pusuluri madhu wrote: > > Please

Re: [R] File corrupted in R/magic number

2019-08-27 Thread John Kane
To be honest , we would probably have to see a sample of the data. Can you supply a location for small data sample. Other than that we are guessing. Other than that , can you open it in a text editor? That will help assure it is really not a corrupt file. After using R for over 15 years, the wo

Re: [R] parsing files with "\" character

2019-08-27 Thread Jeff Newmiller
The principles of regex are basically the same between R and those other languages, so I don't see why you would switch... but if you did, asking here would be inappropriate. I think the short answer is yes, but can't be specific without a reproducible example. ([1] is recommended but not requi

Re: [R] Confidence Intervals with mlp forecasts

2019-08-27 Thread Nikolaos Kourentzes
Hi Paul, Currently it does not provide prediction intervals, as it is not assuming a generative model or a particular error distribution. I think the best way forward, with nnfor, is to construct empirical ones. Have a look at this paper for some relatively straightforward approaches that work q

[R] File corrupted in R/magic number

2019-08-27 Thread pusuluri madhu
Please help me to get rid out of this situation. While loading the csv file error msg like Error: bad restore file manager (file may be corrupted)-- no data loaded. In addition warning message: file "S_D.csv" has magic number GeneN. Use of save versions more than 2 is deprecated. Please kindly sug

Re: [R] parsing files with "\" character

2019-08-27 Thread Michael Dewey
Dear April Can you show us an example of what you are trying to do and how it fails? There are rules about backspaces but I find that if one backspace does not work try two, three, four until it works. It would be better to understand the rules but life is short. Michael On 27/08/2019 06:56

[R] parsing files with "\" character

2019-08-27 Thread April Ettington
Is there any way to parse files that include the \ character in a string? When I try to use grep to extract strings with a pattern that includes "\" it fails. If there is no way to do it with R, is it possible with python or a bash script? Thank you, April [[alternative HTML version d

Re: [R] Data frame organization

2019-08-27 Thread Arnaud Mosnier
Aaaah finally !!! Thanks a lot !!! Arnaud Le lun. 26 août 2019 18 h 28, Jim Lemon a écrit : > Hi Arnaud, > The reason I wrote the following function is that it always takes me > half a dozen tries with "reshape" before I get the syntax right: > > amdf<-read.table(text="A 10 > B 5 > C

Re: [R] Code modification for post-hoc power

2019-08-27 Thread Michael Dewey
Anne sent me off-line the error message. error message starts here == This error message: "Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27 Error in `[.default`(xj, i) : type 'closure' d'indice incorrect" appears after the following R codes: library(gee) attach(g

Re: [R] [r] Applying rollapply in VR test

2019-08-27 Thread Subhamitra Patra
Actually, after running this code, z object is creating which has no observation, means there are no outputs in the z object. When I am giving the command to plot or view z object, it is showing an error. I thought there is some error in the code, so I posted. Please help me regarding this. Than

Re: [R] [r] Applying rollapply in VR test

2019-08-27 Thread Gabor Grothendieck
If I run this (which is identical to your code except I supplied some random input since your post did not include any) I get no error: library(vrtest) library(zoo) set.seed(123) x <- rnorm(100) y <- zoo(x) z <- rollapply(y,50, function(x) AutoBoot.test(x,nboot=30, wild="Normal")$A

[R] Confidence Intervals with mlp forecasts

2019-08-27 Thread Paul Bernal
Dear friends, Hope you are all doing well. I am currently using function mlp (to fit multiple layer percentron model) to generate forecasts using package nnfor. I would like to know if the mlp function provides, or is there a way to construct confidence intervals for the forecasts generated by th

Re: [R] Change of language interface in R

2019-08-27 Thread PIKAL Petr
Hi Google tells it to you in seconds https://stackoverflow.com/questions/13575180/how-to-change-language-settings-in-r BTW this was the first hit from phrase R how to change the language interface Cheers Petr > -Original Message- > From: R-help On Behalf Of CHATTON Anne > via R-help

[R] Change of language interface in R

2019-08-27 Thread CHATTON Anne via R-help
Can anyone please tell me how to change the language interface so as to receive error messages in English. Currently it's a mixed jargon of French an English. Thank you for any help. Anne [[alternative HTML version deleted]] __ R-help@r-proj

Re: [R] Code modification for post-hoc power

2019-08-27 Thread Michael Dewey
Dear Anne Can you resend the eror message which you accidentally sent only to me please? Michael On 27/08/2019 08:02, CHATTON Anne wrote: Dear Michael, Thanks a lot for your suggestion. This is what I am trying to do with R (longpower and gee packages). But I am getting stuck with a confus

Re: [R] Gtk3 into R

2019-08-27 Thread Doran, Harold
Yes, see Shiny by R studio. Here is an example of my site that is built on Shiny and R. It also combines CSS, SQL, javascript, and some HTML. https://shiny.airast.org/METRICS/ -Original Message- From: R-help On Behalf Of Cleber N.Borges Sent: Monday, August 26, 2019 7:48 PM To: r-help@r

Re: [R] Code modification for post-hoc power

2019-08-27 Thread CHATTON Anne via R-help
Dear Michael, Thanks a lot for your suggestion. This is what I am trying to do with R (longpower and gee packages). But I am getting stuck with a confusing error message sent earlier I don't understand. Best, Anne -Message d'origine- De : Michael Dewey [mailto:li...@dewey.myzen.co.uk]