I'm new to R and i'm trying to read some files with an annotation string for each filename. Using the c() function to build a list of annotated filenames i get inconsistent results, as in the following example. Why does c() result in two different types when using similar strings?
A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need. Just do dput(mydata) where mydata is your data. Copy the output and paste it here.
As @jrkrideau statet, those strings are not identical. The latter is shorter, hence all character symbols can go on one line. If both strings are too long to go on one line, there will simply be another line. It is not inconsistent at all.
in the first 1:50 I had the Rstudio console pane wider, and for the second i narrowed it; since R had to print on more rows the numbering it shows as to what number element begins the line necessarily changed.
As you can see; c() wasnt involved in this; theres a more fundamental issue of how R prints vectors to the console.
Oh man this is quite embarrassing. Thanks for the explanation! I thought print() putting two lines [1], [2] instead of only one means the underlying vector has different dimensions. That really confused me.