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

PIKAL Petr petr@p|k@| @end|ng |rom prechez@@cz
Tue Jul 10 14:01:47 CEST 2018


Hi

What about

dat<-as.data.frame(tibble.dat)

Cheers
Petr
Osobn� �daje: Informace o zpracov�n� a ochran� osobn�ch �daj� obchodn�ch partner� PRECHEZA a.s. jsou zve�ejn�ny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner's personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/
D�v�rnost: Tento e-mail a jak�koliv k n�mu p�ipojen� dokumenty jsou d�v�rn� a podl�haj� tomuto pr�vn� z�vazn�mu prohl�en� o vylou�en� odpov�dnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/

From: akshay kulkarni [mailto:akshay_e4 using hotmail.com]
Sent: Tuesday, July 10, 2018 1:43 PM
To: Eric Berger <ericjberger using gmail.com>; PIKAL Petr <petr.pikal using precheza.cz>
Cc: R help Mailing list <r-help using r-project.org>
Subject: Re: [R] inconsistency in display of character vector....

dear members,
                             I've gone through debug(update.snlcqn)  (update.snlcqn is the above function) and  I think the problem lies in read_excel returning a tibble...any suggestions on how to convert it to a regular data frame? Any other packages that read xls files as a regular data frame?

Very many thanks for your time and effort....
Yours sincerely,
AKSHAY M KULKARNI

________________________________
From: Eric Berger <ericjberger using gmail.com<mailto:ericjberger using gmail.com>>
Sent: Monday, July 9, 2018 12:15 PM
To: PIKAL Petr
Cc: akshay kulkarni; R help Mailing list
Subject: Re: [R] inconsistency in display of character vector....

>  If (identical(snlcqn, snlcqna)) snlcqn else snlcqna

??

Why not just always return snicqna ?


On Mon, Jul 9, 2018 at 9:43 AM, PIKAL Petr <petr.pikal using precheza.cz<mailto:petr.pikal using precheza.cz>> wrote:
Hi

You definitely should not use HTML formated mail. This is plain text mailing list for reason.

If you experience space between "NSE/" and pasted second part, you should read paste help page which states

paste (..., sep = " ", collapse = NULL)

so it has space as separator.

You should use paste0 if you want to get rid of separating space or axplicitely state
paste (..., sep = "")

> lneq <- c()
> for (i in 1:10) lneq[i] <- letters[i]
> lneq
 [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
> snlcqna<-LETTERS[1:10]
> for (j in 1:10) snlcqna[j] <- paste("NSE/",lneq[j])
> snlcqna
 [1] "NSE/ a" "NSE/ b" "NSE/ c" "NSE/ d" "NSE/ e" "NSE/ f" "NSE/ g" "NSE/ h"
 [9] "NSE/ i" "NSE/ j"
> for (j in 1:10) snlcqna[j] <- paste0("NSE/",lneq[j])
> snlcqna
 [1] "NSE/a" "NSE/b" "NSE/c" "NSE/d" "NSE/e" "NSE/f" "NSE/g" "NSE/h" "NSE/i"
[10] "NSE/j"

Cheers
Petr

Osobn� �daje: Informace o zpracov�n� a ochran� osobn�ch �daj� obchodn�ch partner� PRECHEZA a.s. jsou zve�ejn�ny na: https://www.precheza.cz/zasady-ochrany-osobnich-udaju/ | Information about processing and protection of business partner's personal data are available on website: https://www.precheza.cz/en/personal-data-protection-principles/
D�v�rnost: Tento e-mail a jak�koliv k n�mu p�ipojen� dokumenty jsou d�v�rn� a podl�haj� tomuto pr�vn� z�vazn�mu prohl�en� o vylou�en� odpov�dnosti: https://www.precheza.cz/01-dovetek/ | This email and any documents attached to it may be confidential and are subject to the legally binding disclaimer: https://www.precheza.cz/en/01-disclaimer/

> -----Original Message-----
> From: R-help [mailto:r-help-bounces using r-project.org<mailto:r-help-bounces using r-project.org>] On Behalf Of akshay
> kulkarni
> Sent: Sunday, July 8, 2018 2:38 PM
> To: R help Mailing list <r-help using r-project.org<mailto:r-help using r-project.org>>
> Subject: [R] Fw: inconsistency in display of character vector....
>
> dear members,
>                              The mail is not showing the spaces between [192]
> "NSE/YESBANK" and  [193] "NSE/ZEEL" ...Actually there is a lot of empty spaces
> between the two.....!!!!!!
>
> ________________________________________
> From: R-help <r-help-bounces using r-project.org<mailto:r-help-bounces using r-project.org>> on behalf of akshay kulkarni
> <akshay_e4 using hotmail.com<mailto:akshay_e4 using hotmail.com>>
> Sent: Sunday, July 8, 2018 5:58 PM
> To: R help Mailing  list
> Subject: [R] inconsistency in display of character vector....
>
> 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]]
>
> ______________________________________________
> R-help using r-project.org<mailto:R-help using r-project.org> mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>       [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org<mailto:R-help using r-project.org> mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help using r-project.org<mailto:R-help using r-project.org> mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


	[[alternative HTML version deleted]]




More information about the R-help mailing list