Re: [R] save() and load()

2023-09-25 Thread Jeff Newmiller via R-help
You never created any object in R called irisdataTest. Objects in the global environment have names that are unrelated to the names of files on disk. The load function modifies an environment to create a variable named as it was named in the environment from which it was saved. Thus, you cannot

Re: [R] save() and load()

2023-09-25 Thread Shu Fai Cheung
Hi, You can try this: head(irisdata) Objects loaded by load() keep their names when being saved. In your case, it is 'irisdata'. You can also use verbose = TRUE to show the names of objects loaded: load(file = "irisdataTest.RData", verbose = TRUE) Hope this helps. Regards, Shu Fai On Tue,

[R] save() and load()

2023-09-25 Thread AbouEl-Makarim Aboueissa
Dear ALL: I am teaching statistical packages class this semester, in R programing I am trying to explain the use of save() and load() with an example using the iris data. It seems that the save() function works, BUT when I tried to load the data back to R, it seems that there is a problem(s), I

Re: [R] How to fix this problem

2023-09-25 Thread CALUM POLWART
Using readr to read the data might let you clean it on the way in... readr::read_csv("filename.csv", col_types = list(rep(col_numeric(),6)) On Mon, 25 Sep 2023, 16:54 Ebert,Timothy Aaron, wrote: > An update please: > Collectively we have suggested removing commas from the "E..coli" column, >

Re: [R] How to fix this problem

2023-09-25 Thread Ebert,Timothy Aaron
An update please: Collectively we have suggested removing commas from the "E..coli" column, checking for different forms of "NA", and looking outside the dataset for e-trash (spaces, text, or other content). For removing commas, I would use global replace to ensure that all commas were removed

Re: [R] How to fix this problem

2023-09-25 Thread Michael Dewey
It looks here as though the E coli column has commas in it so will be treated as character. Michael On 25/09/2023 15:45, avi.e.gr...@gmail.com wrote: David, This may just be the same as your earlier problem. When the type of a column is guessed by looking at the early entries, any

Re: [R] How to fix this problem

2023-09-25 Thread avi.e.gross
David, This may just be the same as your earlier problem. When the type of a column is guessed by looking at the early entries, any non-numeric entry forces the entire column to be character. Suggestion: fix your original EXCEL FILE or edit your CSV to remove the last entries that look just

Re: [R] How to fix this problem

2023-09-25 Thread Ivan Krylov
On Sun, 24 Sep 2023 18:05:43 + "Parkhurst, David" wrote: > I have a matrix, KD6, and I_m trying to get a correlation matrix from > it. When I enter cor(KD6), I get the message _Error in cor(KD6) : > 'x' must be numeric_. > Here are some early lines from KD6: >Flow E..coli

Re: [R] How to fix this problem

2023-09-25 Thread Ivan Calandra
Dear David, simply check str(KD6). My guess (because we don't have your dataset, only a print of it) is that KD6 is not a matrix but a data.frame. The problem seems to come from the column "E..coli" which contains commas instead of periods (so text and not number). There might be other issues

[R] How to fix this problem

2023-09-25 Thread Parkhurst, David
I have a matrix, KD6, and I�m trying to get a correlation matrix from it. When I enter cor(KD6), I get the message �Error in cor(KD6) : 'x' must be numeric�. Here are some early lines from KD6: Flow E..coliTNSRP TPTSS 1 38.82,4201.65300 0.0270 0.0630

Re: [R] data.table installation on intel macOS Ventura 13.6

2023-09-25 Thread Carlos Ortega
Hi, Yes, on Mac, it takes a while to even get the build to allow data.table to be used on multithread. See this installation guide which has sections specially dedicated for Mac. - https://github.com/Rdatatable/data.table/wiki/Installation You will see that you will most likely have to

Re: [R] data.table installation on intel macOS Ventura 13.6

2023-09-25 Thread Ivan Krylov
On Sun, 24 Sep 2023 23:42:14 + Naresh Gurbuxani wrote: > Instruction on this site do not apply to Ventura 13.6 What happens whey you try to follow them? The data.table maintainers have prepared the following guide: . In particular, in