Re: [R] Mapping 2D to 3D

2020-09-20 Thread Abby Spurdle
> I was looking at this example which uses geom_contour(): > > ggvolcano = volcano %>% > reshape2::melt() %>% > ggplot() + > geom_tile(aes(x=Var1,y=Var2,fill=value)) + > geom_contour(aes(x=Var1,y=Var2,z=value),color="black") + > scale_x_continuous("X",expand = c(0,0)) + >

Re: [R] Calling a procedure

2020-09-20 Thread Steven Yen
Thanks to all for educating me about procedures and argument. Those were very helpful!! On 2020/9/21 上午 12:26, Bert Gunter wrote: > Argument passing is fundamental, even more so when you write your own > functions, which any half-serious R user will want to do. What has > heretofore been

Re: [R] Mapping 2D to 3D

2020-09-20 Thread H
On 09/19/2020 04:33 PM, Abby Spurdle wrote: >> Understood > I'd recommend you try to be more precise. > >> I just began looking at the volcano dataset which uses geom_contour. > The volcano dataset does *not* use geom_contour. > However, the help file for the volcano dataset, does use the >

Re: [R-es] expresiones regulares

2020-09-20 Thread Eric
Al parecer sólo hay que eliminar los espacios, no ? On 20-09-20 13:32, Carlos Ortega wrote: Hola, Extraer los tres primeros caracteres de cada cadena se puede hacer así: library(stringr) mis_str <-

Re: [R-es] TOMAR ID (número de orden de las filas) DE DATAFRAME Y CONVERTIRLO EN UNA COLUMNA (VARIABLE) NUEVA

2020-09-20 Thread Marcelino de la Cruz Rot
Hola: Varias posibilidades serían: DATAFRAME$variable_nueva <- 1:nrow(DATAFRAME) DATAFRAME$variable_nueva <- row.names(DATAFRAME) o DATAFRAME$variable_nueva <- as.numeric(row.names(DATAFRAME)) dependiendo de tu objetivo final. Saludos, Marcelino El 20/09/2020 a las 18:41, Jesus MARTIN F.

[R-es] TOMAR ID (número de orden de las filas) DE DATAFRAME Y CONVERTIRLO EN UNA COLUMNA (VARIABLE) NUEVA

2020-09-20 Thread Jesus MARTIN F.
Buenas tardes, Consulto cómo tomar el ID (número de orden de las filas) de un DATAFRAME y hacer un "mutate" a una variable nueva que contenga ese valor (número de orden de la fila), Gracias Jesús _ *Jesús MARTÍN FRADE * Skype:jmfpas Tel (celular):

Re: [R-es] expresiones regulares

2020-09-20 Thread Carlos Ortega
Hola, Extraer los tres primeros caracteres de cada cadena se puede hacer así: > library(stringr) > > mis_str <- c('1.3ptd','1.3ptdm','4.4ptdm23j','7.716s','1.4hola','1.4hola.hola','5.5v6','5.5v6sdp','5.5v10sdp') > > res_out <- vector() > for(i in 1:length(mis_str)) { + wrd_tmp <- mis_str[i] +

Re: [R] Calling a procedure

2020-09-20 Thread Bert Gunter
Argument passing is fundamental, even more so when you write your own functions, which any half-serious R user will want to do. What has heretofore been discussed in this thread is not the whole story (e.g. there are ... arguments and functions as binary operators, among other things). See section

Re: [R] Calling a procedure

2020-09-20 Thread Mark Leeds
Hi Steven: Rui's detailed explanation was great. The way I think of it is, if you don't want to send the variables in with the same order as the formal arguments, then you better name them as you send them in. On Sun, Sep 20, 2020 at 7:23 AM Steven Yen wrote: > Thanks. So, to be safe,

[R-es] expresiones regulares

2020-09-20 Thread Samura .
Hola a tod@s �alquien sabria como convertir estas frases con expresiones regulares? 1.3ptd -> 1.3 ptd 1.3ptdm -> 1.3 ptdm 4.4ptdm23j -> 4.4 ptdm 23j 7.716s -> 7.7 16s 1.4hola -> 1.4 hola 1.4hola.hola -> 1.4 hola.hola 5.5v6 -> 5.5 v6 5.5v6sdp -> 5.5 v6 sdp 5.5v10sdp -> 5.5 v10 sdp de forma

Re: [R] Calling a procedure

2020-09-20 Thread Steven Yen
Thanks. So, to be safe, always a good idea to give the argument, e.g., q=1.96, log.p=FALSE, skipping mean=0 and sd=1 if not needed. Thanks. pnorm(q=1.96, log.p = FALSE) On 2020/9/20 下午 06:36, Rui Barradas wrote: > Hello, > > You are making a confusion between > > 1. the formal argument log.p >

Re: [R] Calling a procedure

2020-09-20 Thread Rui Barradas
Hello, You are making a confusion between 1. the formal argument log.p 2. the variable log.p In the function body, log.p is a variable that exists in the function's frame, not the formal argument of pnorm. The first and the 3rd calls that follow output the same value. try(x = 1.2, log.p =

[R] Calling a procedure

2020-09-20 Thread Steven Yen
Can someone tell me a proper call to a procedure, in this case, pnorm. In what follows, I had expected a = b, but they are not equal. What are wrong with first call and second call? Thank you! try<-function(x,log.p=FALSE){ a<-pnorm(x,log.p)   # first call b<-pnorm(x,log.p=log.p) # second