R Function Global Naming

32 views
Skip to first unread message

JISHNU BHATTACHARYA

unread,
Feb 19, 2013, 10:57:47 AM2/19/13
to bru...@googlegroups.com
I am trying to automate sometasks by a function

bill_1 <- read.csv("1st.csv")

head(bill_1,n=10)
tail(bill_1,n=10)
nrow(bill_1)
names(bill_1)
str(bill_1)

############ Select Only Enterprise Accounts #################

jSelect.d <- function ( df1) { 

df2  <- df1[which(df1$Segment == "Enterprise"),]

df2$CHARGE_START_DATE  <- NULL
df2$bill_11$Sr.No. <- NULL
df2$Service  <- NULL
df2$Text.2 <- NULL

############# Create the final dataset ########
bill_11 <<- df2

 }
jSelect.d(bill_1)

But I am naming the final df inside function, how can I pass the name from outside such SAS global macro variables ?
any help

Reply all
Reply to author
Forward
0 new messages