Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Jeff Newmiller
All elements of a vector must be of the same type. Rephrasing: You cannot change one element of a character vector to a numeric value. The numeric value WILL be converted into character before it is put into the target element. -- Sent from my phone. Please excuse my brevity. On August 30, 20

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Jim Lemon
Hi Nelly, It would be helpful to see what you are actually trying to convert: strtoi("1") [1] 1 What is in set[10,1]? Jim On Thu, Aug 31, 2017 at 2:01 PM, Nelly Reduan wrote: > Thanks very much for your answer. > > I’m trying the function “strtoi” but it fails to convert character to > numeri

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Nelly Reduan
Thanks very much for your answer. I�m trying the function �strtoi� but it fails to convert character to numeric after the command "set[index] <- strtoi(set[index])". > strtoi(set[index]) ## This works: all values are numeric !!! [1] 1 2 3 4 2 8 9 7 > set[index] <- strtoi(set[index]) > pr

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Jeff Newmiller
This seems to be a case where the question exists because the asker thinks R acts like Excel, instead of learning how R does work. Data frames in R are lists of columns. Each column is a vector, and all elements in a vector are the same type. [1] Since a number can be stored in a character str

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Jim Lemon
Hi Nelly, Are you trying to convert hexadecimal to decimal? nrdf Setting Value 1 Parameters a 2 Parameters b 3 Parameters c 4 Parameters d 5 Parameters e 6 Parameters 2 7 Parameters 8 8 Parameters 9 9 Parameters 7 10 1 a 11

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Nelly Reduan
The Excel file can be found from this link: https://1drv.ms/x/s!Apkg2VlgfYyDgQ_mcJ8F4CaXV_Nh [https://r1.res.office365.com/owa/prem/images/dc-xlsx_40.png] File.xlsx Partag� via OneDrive Thanks

Re: [R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread David Winsemius
> On Aug 30, 2017, at 12:24 PM, Nelly Reduan wrote: > > Hello, > > From an Excel file imported into R where each cell contains characters, I > would like to convert some characters to numeric. However, my code doesn’t > work. When I write data to worksheets in an Excel file, some numbers in t

[R] Converting character to numeric using the package "XLConnect"

2017-08-30 Thread Nelly Reduan
Hello, >From an Excel file imported into R where each cell contains characters, I >would like to convert some characters to numeric. However, my code doesn’t >work. When I write data to worksheets in an Excel file, some numbers in the >cells are stored as text (instead of numeric). Here is my c

Re: [R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
by using these two tables we have to create third table in this format where categories will be on the top and transaction will be in the rows, On 30 August 2017 at 16:42, Hemant Sain wrote: > Hello Ulrik, > Can you please once check this code again on the following data set > because it doesn't

[R] [R-pkgs] Announcing mfe 0.1.0

2017-08-30 Thread Luís Paulo F . Garcia
Dear R users, I am pleased to announce that the package mfe (Meta-Feature Extractor) is now available on CRAN (https://cran.r-project.org/package=mfe). The mfe package extracts meta-features from datasets to support the design of recommendation systems based on Meta-Learning. The meta-features, a

Re: [R] Dataframe Manipulation

2017-08-30 Thread Ulrik Stervbo
Hi Hemant, Does this help you along? table_1 <- textConnection("Item_1;Item_2;Item_3 1KG banana;300ML milk;1kg sugar 2Large Corona_Beer;2pack Fries; 2 Lux_Soap;1kg sugar;") table_1 <- read.csv(table_1, sep = ";", na.strings = "", stringsAsFactors = FALSE, check.names = FALSE) table_2 <- textCon

Re: [R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
Hey PIKAL, It's not a homework neithe that is the real dataset i have signer NDA for my company so that i can share the original data file, Actually I'm working on a market basket analysis task but not able to convert my existing data table to appropriate format so that i can apply Apriori algorith

[R] [R-pkgs] New CRAN Package Announcement: splashr

2017-08-30 Thread Bob Rudis
I'm pleased to announce that splashr is now on CRAN: https://CRAN.R-project.org/package=splashr The package is an R interface to the Splash javascript rendering service. It works in a similar fashion to Selenium but is fear more geared to web scraping and has quite a bit of power under the hood.

Re: [R] Dataframe Manipulation

2017-08-30 Thread PIKAL Petr
Hi It seems to me like homework, there is no homework policy on this help list. What do you want to do with your table 3? It seems to me futile. Anyway, some combination of melt, merge, cast and regular expressions could be employed in such task, but it could be rather tricky. But be aware tha

[R] Dataframe Manipulation

2017-08-30 Thread Hemant Sain
i want to do a market basket analysis and I’m trying to create a dataset for that i have two tables, one table contains daily transaction of products in which each row of table shows item purchased by the customer, The second table contains parent group under those products are fallen, for example