similar to: dynamically create columns using a function

Displaying 12 results from an estimated 12 matches similar to: "dynamically create columns using a function"

2017 Jul 21
0
dynamically create columns using a function
Hi, I don't know about the lazyeval package or what you are trying to do but to answer the main question "How to create columns dynamically using a function?" I would do something like that: # dataset dem <- structure(list(id = c("L1", "L2", "L3", "M1", "M2", "M3"), TEST_SET_NAME = c("A", "A",
2012 May 21
3
Replace a variable by its value
I have a dataset called "raw-data" . I am trying to use the following code - col_name<-names(raw_data) for (i in 1:(length(names(raw_data))-2)) { tbl=table(raw_data$Pay.Late.Dummy, raw_data$col_name[i]) chisqtest<-chisq.test(tbl) } Say the 1st column of my raw_data is Column1. The idea is when i=1 then raw_data$col_name[i] will automatically become raw_data$Column1 ,
2012 Jul 10
2
estimation of NA by predict command
Dear arun and all R users, I will first of all try to simply define my issue.. I have data in the following format Year Discharge dd/mm/yyyy x .. … … … There are some NA values in the discharge which I would like to predict by using “predict command”. I cant figure out the way to write the coding for that. Could you please help me on that??? I have also ,written
2007 Aug 13
0
about REALTIME application
Hi all, In version 1.2, there is a realtime function and it is very easy to use with prefix. exten => s,1,RealTime(table|name|peter|user_) and we can easy get back the value as user_name, user_id, etc. However, I found the the function will be depreciated in 1.4. There is a replacement using application REALTIME. I found that it is very troublesome to use it. ---------from web site---------
2012 Oct 17
3
aggregate function not working?
The aggregate function for some reason will now work for me. The error I'm getting is: "Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list?" agPriceList=aggregate(PriceList$Size, list(PriceList$bandNum),sum) *Price list dataframe:* dput(PriceList) structure(list(Price = c(0, 8.18, 8.27, 10.42, 10.5, 10.6, 11.13,
2010 Oct 28
1
adding copies of rows toa data frame based upon start and end dates
Hello All and thanks in advance for any advice. I have a data frame with rows corresponding radio-collared animals (see sample data below). There is a start date (DATESTART), and end date (DATEEND), and the number of days on air (DAYSONAIR). What I would like to do is add a column called DATE to so that each row ID has a row for every day that the radio collar was on the air while copying all
2013 Jan 29
1
starting values in glm(..., family = binomial(link = log))
Dear R-helpers, i have a problem with a glm-model. I am trying to fit models with the log as link function instead of the logit. However, in some cases glm fails to estimate those models and suggests to give start values. However, when I set start = coef(logistic_model) within the function call, glm still says it cannot find starting values? This seems to be more of a problem, when I include a
2006 Jul 18
3
DB Migrations & Column Order
Hello, I created a table and about 10 migrations down the line I decided that I needed to add an ID column (this was actually a table for a has_many :through and I recently realized that it needs an ID column, unlike HABTM tables). I am a big perfectionist and I frequently run "SHOW COLUMNS IN table;", so I naturally expect to see the "id" column the first one listed. However,
2016 Apr 27
0
R Script Template
The subject of your email is missing. Perhaps you need to read the Posting Guide (again?) about attachments. Embedding your example directly in the body of the email is generally more accessible in archives than attaching it. -- Sent from my phone. Please excuse my brevity. On April 27, 2016 1:14:17 PM GMT+01:00, G.Maubach at gmx.de wrote: >Hi All, > >I am addressing this post to all
2016 Apr 27
2
R Script Template
Hi All, I am addressing this post to all who are new to R. When learing R in the last weeks I took some notes for myself to have code snippets ready for the data analysis process. I put these snippets together as a script template for future use. Almost all of the given command prototypes are tested. The template script contains snippets for best practices and leaves out the commands that
2010 Apr 20
5
Assigning Week Numbers
R experts, How could I extract the week number from a date vector (in Date class) such that week numbering (week 1...2...) begins (May 01) and ends (October 31) on the same specific dates each year? Week numbering must conform to the following day numbering format (Sat=1,Sun=2,Mon=3.....Fri=7). This means that new weeks must begin on Saturdays, and end on Fridays (except for the first date
2011 Feb 04
1
read.table error
R experts, I am working with a fairly large data set comprised of 563 rows by 116 columns including several different modes. I have been unable to read in the data set completely using the read.table function and the RGui (i.e. nearly half the total number of rows are missing from the data set along with the column names). The data does read in fully using Tinn-R's Rterm; however, at several