Say I have the instructions to create a df as such:
data.frame(Tech = c(rep('Cell',20),rep('Therapy',20)),
Gene1 = runif(40, 0, 30),
Gene2 = runif(40, 10, 25),
Gene3 = runif(40, 5, 50))
But this is stored in a vector (FYI, this is because I have imported it from a local HTML file):
dfcode<-"Tech = c(rep('Cell',20),rep('Therapy',20)),
Gene1 = runif(40, 0, 30),
Gene2 = runif(40, 10, 25),
Gene3 = runif(40, 5, 50)"
Is there some way I can generate the dataframe useing the dfcode
vector (i.e. without simply copy and pasting it)?
My attempts have revolved around something like below, which invariably gets me a 1x1 df:
df<-data.frame(dfcode)
Thanks.