Re: [R] Rename variables starting with digits

2021-10-05 Thread Jim Lemon
Hi Anne, As mentioned above, you may have to do nothing. Here is an example that might clarify that: azdat<-read.table(text="subject 1 2 3 1 10 20 30 2 11 22 33", header=TRUE,stringsAsFactors=FALSE) azdat subject X1 X2 X3 1 1 10 20 30 2 2 11 22 33 As you can see, R simply prepends an

Re: [R] Descriptive Statistics: useful hacks

2021-10-05 Thread Leonard Mada via R-help
Dear R users, I wrote in the meantime a new function: apply.html(html, XPATH, FUN, ...) This function applies FUN to the nodes selected using XPATH. However, I wonder if there is a possibility to use more simple selectors (e.g. jQuery). Although I am not an expert with jQuery, it may be easi

Re: [R] Rename variables starting with digits

2021-10-05 Thread Bert Gunter
... and to add to what Eric and Duncan have said, what you have as column names depends on how the data were imported. e.g.: > d1 <-data.frame(a = 1:3, `1b` = letters[1:3]) ## check.names has a default of TRUE > names(d1) [1] "a" "X1b" ## note the conversion to a syntactically valid name. See

Re: [R] Rename variables starting with digits

2021-10-05 Thread Duncan Murdoch
On 04/10/2021 2:02 p.m., Anne Zach wrote: Dear R users, I have a dataframe that contains several variables, among which 105 correspond to scores on certain trials. Unfortunately, when I imported this dataframe into R, I realised that the variable names corresponding to each trial begin with digi

Re: [R] Rename variables starting with digits

2021-10-05 Thread Eric Berger
Hi Anne, It would be helpful to include at least part of behavioral_df for people to understand the issue better. Please do the following in R and post the output. dput( head( behavioral_df) ) Also, set your email to plain text as HTML is stripped from emails on this list. Best, Eric On Tue,

Re: [R] Rename variables starting with digits

2021-10-05 Thread Andrew Simmons
Hello, I think you have to use 'matches' instead of 'starts_with', I believe starts_with does not accept a regular expression whereas matches does. On Tue, Oct 5, 2021 at 12:15 PM Anne Zach wrote: > Dear R users, > > I have a dataframe that contains several variables, among which 105 > corresp

[R] Rename variables starting with digits

2021-10-05 Thread Anne Zach
Dear R users, I have a dataframe that contains several variables, among which 105 correspond to scores on certain trials. Unfortunately, when I imported this dataframe into R, I realised that the variable names corresponding to each trial begin with digits, which violates R naming conventions. I

Re: [R] Need in formatting data for circos plot

2021-10-05 Thread pooja sinha
Thanks, the code is working now but it is not plotting in the colorwise manner ie, khaki4 and indian red. Maybe I need to work more. If you have any clue then please let me know. Thanks again, Puja On Tue, Oct 5, 2021 at 9:19 AM PIKAL Petr wrote: > Hm, > > Maybe if you change > > C(-7, 7) > Er

Re: [R] Need in formatting data for circos plot

2021-10-05 Thread PIKAL Petr
Hm, Maybe if you change > C(-7, 7) Error in C(-7, 7) : object not interpretable as a factor to > c(-7, 7) [1] -7 7 Cheers Petr S pozdravem | Best Regards RNDr. Petr PIKAL Vedoucí Výzkumu a vývoje | Research Manager PRECHEZA a.s. nábř. Dr. Edvarda Beneše 1170/24 | 750 02 Přerov | Czech Repub

[R] Need in formatting data for circos plot

2021-10-05 Thread pooja sinha
Hi All, I have gene expression data with differential fold change value and the file looks like as below: Chrom start_pos end_pos value 14 20482867 20496901 2.713009346 4 123712710 123718202 -2.20797815 13 80883384 80896042 1.646405782 16 48842551 48844461 -1.636002557 17 28399094 28517527 1.03306