[R] Help its urgent
Josue Nuñez Rico
josue_n_r at hotmail.com
Sat Oct 2 03:49:59 CEST 2010
Hi Josh
Thank you very much for your prompt response.
Maybe you can advise me how to solve the problem if it causes you any inconvenience.
The program I'm creating is to estimate the surface of coral, with measures taken form field which is a series of triangles scalene, which measures the txt file are separated by a, b and c (a and b are the sides and c the base), each triangle has 100 repetitions each, of these repetitions of the 13 triangles formed from the field measurements. I have to calculate its area with the formula of Heron for which and I have to get the semiperimeter, the problem is that some values are negative so I have to be removed from the matrix and apply a correction factor. I attached a file which can guide me to create a good program.
Sorry for any inconvenience it may cause you, I am very sorry but there are things that I read more than I do not understand.
Cheers
Joshua
> Date: Fri, 1 Oct 2010 18:03:11 -0700
> Subject: Re: [R] Help its urgent
> From: jwiley.psych en gmail.com
> To: josue_n_r en hotmail.com
> CC: r-help en r-project.org
>
> Hi Josue,
>
> This should help, you are almost there.
>
> # consider this
> dat <- c(1, 2)
> # passing TRUE/FALSE to the extraction function
> dat[c(TRUE, FALSE)]
>
> # Now moving to an array
> # Create an array with dimensions 100, 13 filled with random normal numbers
> dat <- array(data = rnorm(100*13), dim = c(100, 13))
> # Now apply the principle above to the array
> # the logical test returns TRUE/FALSE, which is used to select from column 1
> dat[ ,1][dat[ ,1] < 0]
>
> # for the entire dataset
> dat[dat < 0]
>
> Cheers,
>
> Josh
>
> On Fri, Oct 1, 2010 at 5:52 PM, Josue Nuñez Rico <josue_n_r en hotmail.com> wrote:
> >
> > Hi I am student of Masters and wanted to know if you can help with a problem I have. I have an array of 100 * 13 and need to extract all values of that array that are less than a value p = x, insert this code data = c (dat [, 1]> = p1), but only and managed to tell me if is false or true that the data in "column 1" of Table "dat" is greater than p1 and what I need is to extract the values from the table.
> > urgent
> > [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help en r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
>
>
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> University of California, Los Angeles
> http://www.joshuawiley.com/
------------ pr?xima parte ------------
An embedded and charset-unspecified text was scrubbed...
Name: simulacion.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101001/b4d5c1de/attachment.txt>
More information about the R-help
mailing list