Displaying 2 results from an estimated 2 matches for "v1_1".
Did you mean:
v1.1
2010 May 17
2
Dynamically build variable names
I'm trying to dynamically build variable names to use on a list. Let's say I have a list like this one:
l <- list(V1_1=c(1,2,3), V1_2=c('One','Two','Three'))
And I succesfully build my variable name like this:
paste('l$', 'V1_1', sep='')
Why can't I just run a mean call with the pasted variable name?
mean(paste('l$', 'V1_1', sep=''))
S...
2008 May 28
1
Search&replace string?
...ould like to know if it is possible to modify a text file with a R function.
In fact I would like to know if a function "Search & Replace" exists.
My problem is to create config files from a Base file in which I have to modify values of parameters.
My Base File:
#...
#...
Param1= V1_1
#...
Param2 = V2_1
Param3 = V3_1
#...
What I would like for each created file i:
#...
#...
Param1= V1_i
#...
Param2 = V2_i
Param3 = V3_i
#...
For the moment my solution is to read each line of the config file, modify if needed the line and recopy it in the new file. But the problem is that...