[R] inconsistency in display of character vector....

akshay kulkarni @k@h@y_e4 @ending from hotm@il@com
Sun Jul 8 14:28:27 CEST 2018


dear members,
                            I have the following code to update the list of stocks:

function (snlcqn)
{
                  lneq <- c()
                  URL <- "https://canmoney.in/Intraday%20scrip.xls"
                  file.string <- tempfile()

                  download.file(URL,file.string)

                  IDT <- read_excel(file.string)

                  leq <- IDT[,1]

                  for(i in 1:length(leq)){
                  lneq[i] <- substr(leq[i],1,(nchar(leq[i])-2))}

                  for(j in 1:length(lneq)){
                  snlcqna[j] <- paste("NSE/",lneq[j])}

                  if(identical(snlcqn,snlcqna) == "FALSE"){
                  return(snlcqna)                         }

                  else                                    {
                  return(snlcqn)                          }

}
snlcqn is the list of present stocks and snlcqna is the list of updated stocks.
The problem is the return object, instead of getting displayed in contiguous list, is getting displayed with lots of spaces...( I am using R on a LINUX RHEL AWS instance):

[192] "NSE/YESBANK"
[193] "NSE/ZEEL"

Why is this happening? How can I get the return object as a contiguous list?
Very many thanks for your time and effort...
yours sincerely,
AKSHAY M KULKARNI

	[[alternative HTML version deleted]]



More information about the R-help mailing list