similar to: Help with IF operator

Displaying 20 results from an estimated 4000 matches similar to: "Help with IF operator"

2011 Jan 06
4
Creating a Matrix from a vector with some conditions
Hi Suppose we have an object with strings: A<-c("a","b","c","d") Now I do: B<-matrix(A,4,4, byrow=F) and I get a a a a b b b b c c c c d d d d But what I really want is: a b c d b c d a c d a b d a b c How can I do this? thank you A. Dias -- View this message in context:
2011 Jan 01
3
How to make this script ask again
Hi, as an example I have made this script to give the user the answer if a number is odd or even: { cat("Please, enter a number (Zero ends)") n<-scan(n=1) if(n==0)break i<-("The number is odd") p<-("The number is even") if (n%%2==0) p else i } If you run this script it will only work once, I mean, after it gives you the answer is won't ask for
2011 Jan 04
5
Help with "For" instruction
Hi, I am having a problem in doing something similar to this example: Suppose I have this vector a, and from it I wish to create 5 other vector each one with less one value than what object a has So I have "a" a<-c(1,2,3,4,5) and I want a1 that shoud have (2,3,4,5) a2 that should have (1,3,4,5) a3 that should have (1,2,4,5) a4 that should have (1,2,3,5) a5 that should have
2011 Feb 01
3
sum the values in a vector as a complete number
Hi I am trying to create a function that is able to calculate this sum: a<-c(2,3,5) b<-(8,7) with "a" meaning 235 and "b" 87. So the result of this sum would be 235 + 87 = 322. I've searched a function like strsplit but that worked for integers and in reverse - not spliting but combining. Can you give me a hand on this please? thanks AD -- View this message in
2011 Jan 18
4
Relative frequency on a character vector
Hi, I have this character vector: A<-c("Tell me how many different letter this vector has?") Is there a way with R that it can let me know how many different letters I have on this vector? If I use nchar(A) que gives me the number 50. With this function he is counting all the letters present and also spaces between the words. Can we also not count the spaces between words? Then
2010 Jun 14
1
Sintaxis para Medidas repetidas
Estimados, Mi problema consiste en probar efectos de dos sistemas de siembra en la abundancia de insectos (variable de conteo). Tengo un diseño en bloques con el sistema de siembra, con muestreo semanales de insectos (10 semanas) en cada unidad experimental. Quiero aplicar un modelo lineal generalizado con distribución de Poisson, con medidas repetidas en el tiempo. Agradecería ayuda con la
2018 Feb 15
1
RV: Problem_graphic
Hi everyone, I am beginner using R but I try to learn more. I need this graphic or similar but instead of tropical and temperate are three ontogenetic states Larva Met Juv CTMAX CTMIN SP SP SP This is my scrip: Ex = subset(Expr, Outlayer=="N") Ex2 = subset (Ex, S0 == 1) Ex3
2011 Feb 02
2
matrix and a function - apply function
Hi I have this function and this matrix: function(x,y) x+y/x m<-matrix(c(1,2,4,2,10,8),3,2) > m [,1] [,2] [1,] 1 2 [2,] 2 10 [3,] 4 8 each row represent a point (x,y) in a chart and I want via my fucntion to calculate the image in order to get this results: for point (1,2) I would get 1+2/1 = 3 for point (2,10) I would get 2+10/2 = 7 for point (4,8) I would get
2009 Aug 18
2
open txt
Não consigo abrir a pasta txt no R, dá a mensagem: Warning message: In file(file, "r") : cannot open file 'plantula.txt': No such file or directory O arquivo está na mesma página do Scrip. Não sei qual é o problema???? [[alternative HTML version deleted]]
2012 May 03
1
AMI disconnects
Hi all. I've got a perl script that connects to Asterisk's management interface using Asterisk::AMI. So far, its proven to be very useful. I'm hoping to use this to detect and respond to asterisk restarts and sip reloads. However, my script gets disconnected quite frequently, causing false alarms in my monitoring. Here's what the code looks like:
2005 Jun 15
2
ploting error
Hello! I've tried to execute an R script that I used to use with older versions with no problem. In the scrip ,I try to create a series of plots in png format, and now there is an error (my actual verion is R2.0.1) Error in title(main=main,sub=sub,xlab=xlab,ylab=ylab,...): X11 font at size 14 could not be loaded Perhaps I did something wrong with this new install? Thanks and best
2018 Jul 23
4
Ayuda ggplot
Estimad en s, Junto con saludar, quería saber si alguien me podría ayudar con este gráfico, tengo un análisis de datos del año 2016 de 3 variables con dos dimensiones (muestra objetivo y muestra lograda), y quería agregar la comparación con el año 2015, me gustaría agregar un gráfico de linea y puntos para el año 2015, pero no he podido lograrlo , la idea es generar un gráfico de esta forma.
2012 Mar 02
3
xm domstate command not found
hi alll.. i want to find the xen domain''s state using xm domstate command, domstate command works fine inside virish but when i try with xm like [xm domestate VM_NAME] its giving an error saying subcomand domestate not found. i just want to shutoff the xen virtual domains using a scrip to take backup. so i just want to make sure that the domain are shutdown successfully after
2007 Feb 15
2
Initialization scripts
I'm trying to create an initialization scrip in the /etc/init.d/. Of course, the one I have is failing! At the top of the other initialization scripts in the same directory, there is are two lines, the chkconfig and description # chkconfig: 2345 55 25 # description: OpenSSH server daemon On the check config line, what are the numbers/attributes that follow? If I'm creating an
2020 Jan 24
4
Perl AGI: read variable with quotes
Hi Gang I have stumbled of this problem. I need the P-Asserted-Identity header in an AGI scrip. In the Dial-Plan I do: same => n,Set(PAI=${PJSIP_HEADER(read,P-Asserted-Identity)}) In the AGI I do: my $pai = $AGI->get_variable(PAI); This works fine, unless the PAI contains quotes: P-Asserted-Identity: <sip:1000 at 1.2.3.4:5060;user=phone> I get "<sip:1000 at
2015 Apr 05
3
Nouveau kernel module exhausting CPU
Hello I recently switched from Nvidia binary driver to Nouveau. I have encountered a possible bug in the kernel module. Before I file a bug report I would like to know if this is a known issue or not. I believe it is related to sleep state and power management of the driver. The Bug: When the computer is left on it's own to go to a power save mode X takes 100% CPU-time in its thread. A
2005 Aug 23
3
Linux to Windows
Hello to all, I have a script which uses rsync quite nicely to backup my Linux mail server to my XP machine from time to time to facilitate CDR archives. The scrip is run as a batch file on the XP box and is scheduled via Windows Scheduler. It works quite well with one exception: many of the mail files come through as 0KB files and it seems that most of these have unusual filenames,
2004 Dec 25
2
Dynamic extensions without using DynExtenDB?
Hi, Am using Asterisk to call peoples phone as part of a service of my website. It will call people for various things...one of them to tell people sports scores. I am using several sound files to piece together a dynamic message saying who played and what the score was. The problem is that I can hardcode the sound files that are needed to play and it works fine, but I cannot hardcode the
2013 Aug 06
2
data.frame
Hola a todos, estoy trabajando con dos archivos csv. En uno de ellos extraigo dos variables (que son coordenadas), del segundo archivo extraigo otra variable que transformo. Con estas tres variables construyo un data.frame (las tres variables tienen la misma longitud). Hasta ahí todo bien, solo que cuando quiero usar este data.frame para hacer un plot.geodata me marca el siguiente error Error en
2007 Mar 03
1
Asterisk - e164 (enum) lookup confused
I would like to implement enum lookup in my dial plan but searching for solution / implementation I'm getting confused what is current standard. On some pages I read that the ENUMLOOKUP is not in development anymore and suggesting on using Enumlookup.agi scrip , some are saying that Asterisk 1.2.0 comes with a new powerful ENUMLOOKUP. So there is probably no need to use this script anymore;