similar to: switch() vs eval() for choosing pre-existing alternatives?

Displaying 20 results from an estimated 30000 matches similar to: "switch() vs eval() for choosing pre-existing alternatives?"

2011 Aug 16
2
How to use 'switch' with strings containing spaces?
Hi, Does anyone know if the alternatives in the 'switch' function can be specified as strings containing spaces?  Neither of the two approaches below works. switch(expr, "Choice 1"="My first choice", "Choice 2"="My 2nd choice", "Choice 3"="My 3rd choice") x <- c("Choice 1", "Choice 2", "Choice
2012 Nov 21
3
Problems understanding use of regular expression (in gsub) for manipulating currency
Hello, After reading help file, various threads on this board, and other online tutorials, I've attempted to use gsub (using Perl-like syntax) to change a currency string into something that can be converted to numeric type using only one regular expression.  Can anybody point out my error?  Note that >  x <- "\"$ 1,200,300,400.50\"" Tried the following in an
2012 Mar 30
1
How to use access results of gregexpr in data frames
Hello, I'm trying to figure out how to find the index of the second occurrence of "/" in a string (which happens to represent a date) within a data frame column. I've used the following code successfully to find the first instance of "/". dframe <- data.frame(date=c("5/14/2011", "4/7/2011")) dframe$x1 <- regexpr("/", dframe[, 1])
2012 Aug 27
2
Inexplicably different results using subset vs bracket notation on logical variable
Hi, Would anyone have any idea as to why I would obtain completely different results when subsetting using the subset function vs bracket notation? I have a data frame with 65 variables and 4382 rows. When I use execute the following subset command I get the correct results (125 rows) > subset(df, Renewal==TRUE, 1:2)   However, I tried to obtain the same results with bracket notation as
2011 Jun 09
3
How to subset based on column name that is a number ?
Hi, I have a data frame with column names "1", "2", "3", ... and I'd like to extract a subset based on the values in the first column. None of the methods I tried worked (below). x <- subset(dframe, 1 = = "My Text") x <- subset(dframe, "1" = = "My Text") x <- subset(dframe, names(dframe)[1] = = "My Text") Q
2011 Sep 14
1
Can 'mosaic' be used with a continuous variable?
Hello, I'm wondering if the 'mosaic' plot of the vcd package (or any other function for that matter) can be used with a continuous variable that should be represented via various categorical variables.  All the documentation I've read lead me to believe that it only works with counts of categories. Alternatively, I've thought of first creating a contingency table where the
2012 Dec 15
1
How to limit string size when displaying data frames?
Hello, Is there a way to set the maximum width of character columns when printing a data frame? I've looked into print(), format(), and options() and have been unsuccessful. For example, I'd like to achieve the results below without having to modify the data itself. > x <- data.frame(c1=rnorm(5), c2="ABCDEFGHIJKLMNOPQRSTUVWXYZ") > x c1 c2 1
2012 Nov 22
2
BibTeX entries in CITATION file
Dear List, While trying to define a customised CITATION file for a package, following R-exts, I realised that if I use only one 'citEntry' I got both a text description and a BibTex entry for the package, as for the 'nlme' package: -------------------------- citation('nlme') To cite package 'nlme' in publications use: Jose Pinheiro, Douglas Bates, Saikat
2006 Sep 18
1
Choosing Domain vs. Workgroup
I thought I wanted to set up my Solaris file-server as domain controller for my small home network, but the more I look at it the less I'm sure. Plus I'm having trouble doing it :-). I do plan to put my primary files (and other people's) on the server, for better safety (mirrored disks, and ZFS) and backup. I certainly want the logon transactions over the network to be encrypted,
2011 Mar 29
1
'RQuantLib for 2.12 version
Dear R users, I have been trying to use RQuantLib in the 2.12.2 R version. I downloaded the .zip file from <http://sourceforge.net/projects/quantlib/files/QuantLib/> http://sourceforge.net/projects/quantlib/files/QuantLib/ which didn't work, so I I downloaded the package source from <http://sourceforge.net/projects/quantlib/files/QuantLib/1.0.1/>
2010 Jun 08
0
R 2.11.0 for Ubuntu 10.04 Lucid Lynx on CRAN [solved]
Thank you very much Christophe by your advice. However, my situation was the opposite to yours, because I'm behind a proxy but my sudo account couldn't see it, and when looked for the proxy configuration of the sudo account with : $ sudo printenv | grep proxy the result was empty. Finally, thanks to all the advice received in this thread, I could fix the problem by editing the
2016 Jun 22
2
Ayuda sencilla (SQL)
Estoy en 3.3.0 y "sqldf" lo instala sin problemas... El 23 de junio de 2016, 1:23, Mauricio Monsalvo <m.monsalvo en gmail.com> escribió: > Malas nuevas para mi: > package ?sqldb? is not available (for R version 3.3.0) > ¿Puedo hacer algo más que esperar? No me voy a "bajar" de versión de R. > > El 22 de junio de 2016, 20:02, Mauricio Monsalvo
2020 Feb 19
2
Problemas con tinytex (base Latex)
Aquí hay una posible solución... https://tex.stackexchange.com/questions/27138/how-can-i-fix-the-error-gui-framework-cannot-be-initialized-with-texniccenter El mié., 19 feb. 2020 a las 23:16, MAURICIO MARDONES (< mauricio.mardones en ifop.cl>) escribió: > Esto... > > 2020-02-19 18:29:50,307-0300 INFO pdflatex - starting with command line: >
2019 Mar 20
3
Como asignar valores de un archivo a otro
Toda la razon!!! merge era todo! Saludos El mié., 20 mar. 2019 a las 10:57, Carlos Ortega (<cof en qualityexcellence.es>) escribió: > Hola Mauricio, > > No, creo que no es lo que dices.. > > Con merge, indicas por qué columna (pueden ser varias) quieres juntar los > dos dataframes y con los parámetros "all.x", "all.y" y "all" indicas si
2024 Jan 22
0
hydroTSM back on CRAN (v0.7-0 released)
Dear all, After being archived on CRAN on 2023-10-1, hydroTSM is finally back on CRAN since January 18th: https://cran.r-project.org/package=hydroTSM. This new version 0.7-0 has several new functions, improvements, bugfixes, and a new dataset, mostly devoted to work with sub-daily and sub-hourly time series. *) New functions: baseflow, plot_pq, calendarHeatmap, subhourly2hourly,
2024 Jan 22
0
hydroGOF back on CRAN (v0.5-4 released)
Dear all, After being archived on CRAN on 2023-10-16 , hydroGOF is finally back on CRAN since January 21th: https://cran.r-project.org/package=hydroGOF. This new version 0.5-4 includes: *) the following new functions: -) KGElf (Garc?a et al., 2017), -) sKGE (Fowler et al., 2018), -) KGEnp (Pool et al., 2018), -) dr (Willmott et al., 2012), -) ubRMSE (Entekhabi et al.,
2024 Jan 22
0
hydroTSM back on CRAN (v0.7-0 released)
Dear all, After being archived on CRAN on 2023-10-1, hydroTSM is finally back on CRAN since January 18th: https://cran.r-project.org/package=hydroTSM. This new version 0.7-0 has several new functions, improvements, bugfixes, and a new dataset, mostly devoted to work with sub-daily and sub-hourly time series. *) New functions: baseflow, plot_pq, calendarHeatmap, subhourly2hourly,
2024 Jan 22
0
hydroGOF back on CRAN (v0.5-4 released)
Dear all, After being archived on CRAN on 2023-10-16 , hydroGOF is finally back on CRAN since January 21th: https://cran.r-project.org/package=hydroGOF. This new version 0.5-4 includes: *) the following new functions: -) KGElf (Garc?a et al., 2017), -) sKGE (Fowler et al., 2018), -) KGEnp (Pool et al., 2018), -) dr (Willmott et al., 2012), -) ubRMSE (Entekhabi et al.,
2019 Mar 20
2
Como asignar valores de un archivo a otro
merge sirve pero no para cumplir la condición de si un dato es "x", buscarlo en el otro data.frame y asignarlo El mié., 20 mar. 2019 a las 10:23, Carlos J. Gil Bellosta (< cgb en datanalytics.com>) escribió: > ?merge > > El mié., 20 mar. 2019 a las 14:22, MAURICIO MARDONES (< > mauricio.mardones en ifop.cl>) escribió: > >> Amigos erreros >>
2010 Oct 13
2
vectorizing: selecting one record per group
Hi, I want to select a subsample from my data, choosing one record from each group. I know how to do this with a for. For example: lets say I have the data: A=cbind(rnorm(100),runif(100),(rep(c(1,2,3,4,5),20))) Where the third column is the group variable. Then what I want is to select 5 observations. Each one taken randomly from each group. INDEX =NULL i=1 for(index_g in