[R] A simple string alienation question.

Eric Berger er|cjberger @end|ng |rom gm@||@com
Tue Apr 14 11:48:22 CEST 2020

Hi Sam,
This should be straightforward. But to help out the people who could give
you an answer it would be better if you could provide the information a bit
more clearly as follows:
1. send your email in plain text mode. If you use gmail, when you are
composing your email, you can click on the 3 dots in the lower right and
select 'Plain text mode'. The R-help list doesn't handle HTML.
2. We cannot see your "Fight.csv" file. Include in your email, say, the
first couple of lines of this file.
3. Also provide the sample output (or data frame) that you would like to
get from this shortened version of your input.


On Tue, Apr 14, 2020 at 12:29 PM Sam Charya via R-help <r-help using r-project.org>

> Hello Dear R Community,
> I would ask a little bit of help from you please:I have a dataset, which
> is in a CSV file – I have read it into R as follows:
>                  V11   tropical fruit"2       whole milk"3        pip
> fruit"4 other vegetables"5       whole milk"6       rolls/buns"
> The issue is: the data set in Csv file also appears with the quotation
> marks “. I can’t get rid of the quotation marks. I want to do it in R. The
> Quotes only appear at the end of the string. The dataset has many rows –
> this is just a copy. My intention is to be able to get rid of the quotes
> and then want to separate the strings with a ‘/’. i.e. rolls/buns should be
> rolls in one column and buns in another.
> I know this is something very simple I am lacking – but if you could
> please show me how to do this? If someone could throw some light please. I
> read the data in with a simple read.csv statement:
>  calc <- read.csv("Fight.csv", stringsAsFactors = F, header = F)  str(x)
> Output: > str(calc)'data.frame': 38765 obs. of  1 variable: $ V1: chr
> "tropical fruit\"" "whole milk\"" "pip fruit\"" "other vegetables\"" ...
> Many Thanks in advance for your help.
> Kind Regards,
> Sam.
>         [[alternative HTML version deleted]]
> ______________________________________________
> 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